2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
8 // http://www.apache.org/licenses/LICENSE-2.0
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.
18 * @file FApp_AppManagerProxy.h
19 * @brief This is the header file for the _AppManagerProxy class.
22 #ifndef _FAPP_INTERNAL_APP_MANAGER_PROXY_H_
23 #define _FAPP_INTERNAL_APP_MANAGER_PROXY_H_
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"
34 namespace Tizen { namespace Io { class _IpcClient; } }
36 namespace Tizen { namespace App
39 class _IAppManagerEventListener;
40 class _IAppManagerServiceEventListener;
41 class _AppManagerEventArg;
43 class _OSP_EXPORT_ _AppManagerProxy
45 , public Tizen::Io::_IIpcClientEventListener
46 , public Tizen::Base::Object
49 virtual ~_AppManagerProxy(void);
51 virtual result LaunchApplication(const AppId& appId, int req);
53 virtual result TerminateApplication(const AppId& appId);
55 virtual bool IsRunning(const AppId& appId);
57 virtual result GetRunningAppList(Tizen::Base::Collection::ArrayList* pList);
60 virtual result InitEventListener(_IAppManagerServiceEventListener* pListener);
62 virtual result AddEventListener(int clientId );
64 virtual result RemoveEventListener(int clientId );
66 virtual result RegisterApplication(const Tizen::Base::String& packageId, const Tizen::Base::String& executableName, _AppType appType, int pid);
68 virtual result UnregisterApplication(int pid);
70 static _IAppManager* GetService(void);
72 static void SetService(_IAppManager* pAppManager);
75 _AppManagerProxy(void);
77 _AppManagerProxy(const _AppManagerProxy& value);
79 _AppManagerProxy& operator =(const _AppManagerProxy& source);
81 result Construct(void);
83 virtual void OnIpcResponseReceived(Tizen::Io::_IpcClient& client, const IPC::Message& message);
85 bool OnEventReceived(const Tizen::App::_AppManagerEventArg& arg);
86 void OnTerminateApplicationRequested(void);
89 static _IAppManager* __pSelf;
90 Tizen::Io::_IpcClient* __pIpcClient;
91 static _IAppManagerServiceEventListener* __pServiceEventListener;
92 }; // _AppManagerProxy
96 #endif // _FAPP_INTERNAL_APP_MANAGER_PROXY_H_