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_AppManagerService.h
20 * @brief This is the header file of the _AppManagerService class.
22 * This header file contains the declarations of the _AppManagerService class.
25 #ifndef _FAPP_INTERNAL_APP_MANAGER_SERVICE_H_
26 #define _FAPP_INTERNAL_APP_MANAGER_SERVICE_H_
31 #include <FAppTypes.h>
33 #include <FApp_IAppManager.h>
35 #include "FApp_ContextManager.h"
38 namespace Tizen { namespace App {
40 class _IAppManagerServiceEventListener;
43 * @class _AppManagerService
44 * @brief Manages and control applications.
47 class _AppManagerService
48 : public Tizen::Base::Object
50 , public _IContextManagerEventListener
51 , virtual public Tizen::Base::Runtime::IEventListener
54 _AppManagerService(void);
56 virtual ~_AppManagerService(void);
58 result Construct(_ContextManager* pContextMgr, _IAppManagerServiceEventListener* pStub);
60 virtual result LaunchApplication(const AppId& appId, const Tizen::Base::String& executableName, int req);
61 virtual result TerminateApplication(const AppId& appId, const Tizen::Base::String& executableName);
62 virtual bool IsRunning(const AppId& appId, const Tizen::Base::String& executableName);
63 virtual result GetRunningAppList(Tizen::Base::Collection::ArrayList* pArray);
64 virtual result RegisterApplication(const AppId& appId, const Tizen::Base::String& executableName, _AppType appType, int pid);
65 virtual result RegisterApplication(const AppId& appId, const Tizen::Base::String& executableName, _AppType appType, int pid, int clientId);
66 virtual result UnregisterApplication(int pid);
68 virtual result InitEventListener( _IAppManagerServiceEventListener* pListener);
69 virtual result AddEventListener(int clientId);//, _IAppManagerServiceEventListener* pListener);
70 virtual result RemoveEventListener(int clientId);//, _IAppManagerServiceEventListener* pListener);
71 virtual void OnApplicationTerminated(const _AppContext& appInfo);
74 // const _AppContext* GetAppInfoSimple(const AppId& appId) const;
77 result SendEventToAllListeners(const _AppManagerEventArg& arg);
80 typedef Tizen::Base::Collection::HashMapT<int, _IAppManagerServiceEventListener*> _AppManagerServiceEventListeners;
81 typedef Tizen::Base::Collection::IMapEnumeratorT <int, _IAppManagerServiceEventListener*> _AppManagerServiceEventListenerEnum;
83 _ContextManager* __pContextMgr;
84 _AppManagerServiceEventListeners __eventListeners;
85 _IAppManagerServiceEventListener* __pStub;
86 _IAppManagerServiceEventListener* __pProxy;
90 friend class UTs_AppManagerServiceP;
91 }; //_AppManagerService
95 #endif//_APP_MANAGER_SERVICE_H_