Tizen 2.1 base
[platform/framework/native/channel-service.git] / inc / ChannelService.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17
18 /**
19  * @file                ChannelService.h
20  * @brief               This is the header file of the Channel service daemon.
21  */
22
23
24 #ifndef _CHANNEL_SERVICE_H_
25 #define _CHANNEL_SERVICE_H_
26
27 #include <FApp.h>
28 #include <FBase.h>
29 #include <FIo.h>
30
31
32 namespace Tizen { namespace Io {
33
34 class _ChannelService;
35 class _ChannelServiceStub;
36
37 class _MessagePortService;
38 class _MessagePortStub;
39 } }
40
41
42 /**
43  * [ChannelService] ServiceApp must inherit from ServiceApp class
44  * which provides basic features necessary to define an ServiceApp.
45  */
46 class ChannelService
47         : public Tizen::App::ServiceApp
48 {
49 public:
50
51         /**
52          * [ChannelService] ServiceApp must have a factory method that creates an instance of itself.
53          */
54         static Tizen::App::ServiceApp* CreateInstance(void);
55
56 public:
57
58         ChannelService();
59         ~ChannelService();
60
61 public:
62
63         // Called when the ServiceApp is initializing.
64         bool OnAppInitializing(Tizen::App::AppRegistry& appRegistry);
65
66         // Called when the ServiceApp initializing is finished.
67         bool OnAppInitialized(void);
68
69         // Called when the ServiceApp is requested to terminate.
70         bool OnAppWillTerminate(void);
71
72         // Called when the ServiceApp is terminating.
73         bool OnAppTerminating(Tizen::App::AppRegistry& appRegistry, bool forcedTermination = false);
74
75         // Called when the system memory is not sufficient to run the ServiceApp any further.
76         void OnLowMemory(void);
77
78 private:
79         Tizen::Io::_ChannelService*     __pChannelService;
80         Tizen::Io::_ChannelServiceStub* __pChannelServiceStub;
81
82         Tizen::Io::_MessagePortService* __pMessagePortService;
83         Tizen::Io::_MessagePortStub*    __pMessagePortStub;
84 }; // ChannelService
85
86 #endif // _CHANNEL_SERVICE_H_