2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
9 // http://www.apache.org/licenses/LICENSE-2.0
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.
19 * @file FApp_AppManagerStub.h
20 * @brief This is the header file of the _AppManagerStub class.
22 * This header file contains the declarations of the _AppManagerStub class.
25 #ifndef _FAPP_INTERNAL_APP_MANAGER_STUB_H_
26 #define _FAPP_INTERNAL_APP_MANAGER_STUB_H_
28 #include <FBaseObject.h>
29 #include <FBaseString.h>
30 #include <FBaseRtIEventListener.h>
33 #include <FAppTypes.h>
35 #include <FIo_IIpcServerEventListener.h>
36 #include <FApp_IAppManager.h>
37 #include <FApp_IAppManagerServiceEventListener.h>
40 namespace Tizen { namespace App {
42 class _AppManagerService;
43 class _ContextManager;
46 * @class _AppManagerStub
47 * @brief Handles IPC requests and calls real methods.
51 : public Tizen::Base::Object
52 , public Tizen::Io::_IIpcServerEventListener
53 , public _IAppManagerServiceEventListener
54 , virtual public Tizen::Base::Runtime::IEventListener
57 _AppManagerStub(void);
59 virtual ~_AppManagerStub(void);
61 result Construct(_ContextManager* pContextMgr);
64 bool OnLaunchApplication(const AppId& appID, const Tizen::Base::String& serviceId, int req);
65 bool OnTerminateApplication(const AppId& appID, const Tizen::Base::String& executableName, result *pRes);
66 bool OnIsRunning(const AppId& appID, const Tizen::Base::String& executableName, bool *pRes);
67 bool OnGetRunningAppList(Tizen::Base::Collection::ArrayList* pArray, result *pRes);
68 bool OnRegisterApplication(const AppId& appID, const Tizen::Base::String& executableName, int appType, int pid);
69 bool OnUnregisterApplication(int pid);
70 bool OnAddEventListener(int pid);
71 bool OnRemoveEventListener(int pid);
73 // send message to client
75 // _IIpcServerEventListener
76 virtual void OnIpcServerStarted(const Tizen::Io::_IpcServer& server);
77 virtual void OnIpcServerStopped(const Tizen::Io::_IpcServer& server);
78 virtual void OnIpcClientConnected(const Tizen::Io::_IpcServer& server, int clientId);
79 virtual void OnIpcClientDisconnected(const Tizen::Io::_IpcServer&server, int clientId);
80 virtual void OnIpcRequestReceived(Tizen::Io::_IpcServer& server, const IPC::Message& message);
83 virtual result OnServiceEventReceived(int clientId, const _AppManagerEventArg& arg);
84 virtual result OnTerminateApplicationRequested(int clientId);
87 result StartIpcServer(void);
88 _AppManagerStub(const _AppManagerStub& value);
89 _AppManagerStub& operator =(const _AppManagerStub& source);
92 typedef Tizen::Base::Collection::HashMapT<int, Tizen::Base::String*> _AppManagerEventListeners;
93 typedef Tizen::Base::Collection::IMapEnumeratorT <int, Tizen::Base::String*> _AppManagerEventListenersEnumerator;
95 Tizen::Io::_IpcServer *__pIpcServer;
96 _AppManagerService* __pAppManagerService;
101 #endif//_FAPP_INTERNAL_APP_MANAGER_STUB_H_