f16c8ecefeef22e34f18a08375b409a81694a3e8
[platform/framework/native/appfw.git] / src / app / inc / FApp_AppManagerProxy.h
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
4 // Licensed under the Apache License, Version 2.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 //     http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16
17 /**
18  * @file        FApp_AppManagerProxy.h
19  * @brief       This is the header file for the _AppManagerProxy class.
20  */
21
22 #ifndef _FAPP_INTERNAL_APP_MANAGER_PROXY_H_
23 #define _FAPP_INTERNAL_APP_MANAGER_PROXY_H_
24
25 #include <FBaseObject.h>
26 #include <FBaseColArrayList.h>
27 #include <FAppTypes.h>
28 #include <FOspConfig.h>
29 #include <FIo_IIpcClientEventListener.h>
30 #include "FApp_Types.h"
31 #include "FApp_IAppManager.h"
32 #include "FApp_AppManagerEvent.h"
33
34 namespace Tizen { namespace Io { class _IpcClient; } }
35
36 namespace Tizen { namespace App
37 {
38
39 class _IAppManagerEventListener;
40 class _IAppManagerServiceEventListener;
41 class _AppManagerEventArg;
42
43 class _OSP_EXPORT_ _AppManagerProxy
44         : public _IAppManager
45         , public Tizen::Io::_IIpcClientEventListener
46         , public Tizen::Base::Object
47 {
48 public:
49         virtual ~_AppManagerProxy(void);
50
51         virtual result LaunchApplication(const AppId& appId, int req);
52
53         virtual result TerminateApplication(const AppId& appId);
54
55         virtual bool IsRunning(const AppId& appId);
56
57         virtual result GetRunningAppList(Tizen::Base::Collection::ArrayList* pList);
58
59         // for platform
60         virtual result InitEventListener(_IAppManagerServiceEventListener* pListener);
61
62         virtual result AddEventListener(int clientId );
63
64         virtual result RemoveEventListener(int clientId );
65
66         virtual result RegisterApplication(const Tizen::Base::String& packageId, const Tizen::Base::String& executableName, _AppType appType, int pid);
67
68         virtual result UnregisterApplication(int pid);
69
70         static _IAppManager* GetService(void);
71
72         static void SetService(_IAppManager* pAppManager);
73
74 private:
75         _AppManagerProxy(void);
76
77         _AppManagerProxy(const _AppManagerProxy& value);
78
79         _AppManagerProxy& operator =(const _AppManagerProxy& source);
80
81         result Construct(void);
82
83         virtual void OnIpcResponseReceived(Tizen::Io::_IpcClient& client, const IPC::Message& message);
84
85         bool OnEventReceived(const Tizen::App::_AppManagerEventArg& arg);
86         void OnTerminateApplicationRequested(void);
87
88 private:
89         static _IAppManager* __pSelf;
90         Tizen::Io::_IpcClient* __pIpcClient;
91         static _IAppManagerServiceEventListener* __pServiceEventListener;
92 }; // _AppManagerProxy
93
94 } } // Tizen::App
95
96 #endif // _FAPP_INTERNAL_APP_MANAGER_PROXY_H_