Tizen 2.1 base
[platform/framework/native/app-service.git] / inc / FApp_ConditionManagerStub.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Flora License, Version 1.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://floralicense.org/license/
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         FApp_ConditionManagerStub.h
20  * @brief       This is the header file of the _ConditionManagerStub class.
21  *
22  * This header file contains the declarations of the _ConditionManagerStub class.
23  */
24
25 #ifndef _FAPP_INTERNAL_CONDITION_MANAGER_SERVER_H_
26 #define _FAPP_INTERNAL_CONDITION_MANAGER_SERVER_H_
27
28
29 #include <FBaseObject.h>
30 #include <FBaseString.h>
31 #include <FAppTypes.h>
32
33 #include <FIo_IIpcServerEventListener.h>
34
35
36 namespace Tizen { namespace App {
37
38 class _ConditionManagerService;
39
40
41 class _ConditionManagerStub :
42         public Tizen::Base::Object,
43         public Tizen::Io::_IIpcServerEventListener
44 {
45
46 public:
47         _ConditionManagerStub(void);
48         virtual ~_ConditionManagerStub(void);
49         result Construct(void);
50
51         void OnInstallComplete(const AppId& appId, const Tizen::Base::String& executableName, const Tizen::Base::String& packageName );
52         void OnUninstallComplete(const AppId& appId, const Tizen::Base::String& executableName);
53
54 private:
55         // ipc handlers.
56         bool OnRegisterAppLaunch(const AppId& appId, const Tizen::Base::String& executableName, const Tizen::Base::String& cond, const Tizen::Base::Collection::ArrayList& args , int flag, result *pRes);
57         bool OnUnregisterAppLaunch(const AppId& appId, const Tizen::Base::String& executableName, const Tizen::Base::String& cond, result *pRes);
58         bool OnIsAppLaunchRegistered(const AppId& appId, const Tizen::Base::String& executableName, const Tizen::Base::String& cond, bool *pIsAppLaunchRegistered, result *pException);
59         result ExtractDueAndPeriod(const Tizen::Base::String& src, Tizen::Base::String& dueTime, Tizen::Base::String& period);
60
61         // _IIpcServerEventListener
62         virtual void OnIpcServerStarted(const Tizen::Io::_IpcServer& server);
63         virtual void OnIpcServerStopped(const Tizen::Io::_IpcServer& server);
64         virtual void OnIpcClientConnected(const Tizen::Io::_IpcServer& server, int clientId);
65         virtual void OnIpcClientDisconnected(const Tizen::Io::_IpcServer&server, int clientId);
66         virtual void OnIpcRequestReceived(Tizen::Io::_IpcServer& server, const IPC::Message& message);
67
68         // internal
69         result StartIpcServer(void);
70
71 private:
72         Tizen::Io::_IpcServer *__pIpcServer;
73         _ConditionManagerService* __pConditionManagerService;
74 };      //_ConditionManagerStub
75
76 }} //Tizen::App
77 #endif // _FAPP_INTERNAL_CONDITION_MANAGER_SERVER_H_