be61005da98891dd667d94c85d5b60b37aa6c803
[framework/osp/appwidget-service.git] / inc / FShell_AppWidgetManagerStub.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Flora License, Version 1.1 (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        FShell_AppWidgetManagerStub.h
20  * @brief       This is the header file for the %_AppWidgetManagerStub class.
21  *
22  * This header file contains the declarations of the %_AppWidgetManagerStub class.
23  */
24
25 #ifndef _FSHELL_INTERNAL_APPWIDGET_MANAGER_STUB_H_
26 #define _FSHELL_INTERNAL_APPWIDGET_MANAGER_STUB_H_
27
28 #include <FBaseObject.h>
29 #include <FBaseString.h>
30 #include <FBaseRtIEventListener.h>
31 #include <FSystem.h>
32 #include <FIo.h>
33
34 #include <FIo_IIpcServerEventListener.h>
35 //#include <FApp_IAppManager.h>
36
37
38 namespace Tizen { namespace Shell  { namespace App {
39
40 /**
41  * @class               _AppWidgetManagerStub
42  * @brief               Handles IPC requests and calls real methods.
43  * @since 2.1
44  */
45 class _AppWidgetManagerStub
46         : public Tizen::Base::Object
47         , public Tizen::Io::_IIpcServerEventListener
48         , virtual public Tizen::Base::Runtime::IEventListener
49 {
50
51 public:
52         bool SendTouchEvent(const int clientId, const Tizen::Base::String& instanceId, int eventType, double timestamp, double x, double y);
53         bool SendTouchEventForPD(const int clientId, const Tizen::Base::String& instanceId, int eventType, double timestamp, double x, double y);
54
55 protected:
56         _AppWidgetManagerStub(void);
57         virtual ~_AppWidgetManagerStub(void);
58
59         // handlers
60         bool OnRequestUpdate(const Tizen::App::AppId& appId, const Tizen::Base::String& providerName, const Tizen::Base::String& argument, result* pRes);
61         bool OnRequestUpdateInstance(const Tizen::Base::String& instanceId, const Tizen::Base::String& argument, result* pRes);
62         bool OnRequestSharedMemoryId(const Tizen::Base::String& instanceId, int width, int height, int* pShmId);
63         bool OnRequestSharedMemoryIdForPD(const Tizen::Base::String& instanceId, int width, int height, int* pShmId);
64         bool OnRequestSyncSharedMemory(const Tizen::Base::String& instanceId, int width, int height, result* pRes);
65         bool OnRequestSyncSharedMemoryForPD(const Tizen::Base::String& instanceId, result* pRes);
66         bool OnRequestReleaseSharedMemory(const Tizen::Base::String& instanceId, result* pRes);
67         bool OnRequestReleaseSharedMemoryForPD(const Tizen::Base::String& instanceId, result* pRes);
68
69         // interface to service
70         virtual result RequestUpdate(const Tizen::App::AppId& appId, const Tizen::Base::String& providerName, const Tizen::Base::String& argument) = 0;
71         virtual result RequestUpdateInstance(const Tizen::Base::String& instanceId, const Tizen::Base::String& argument) = 0;
72         virtual result RequestSharedMemoryId(const Tizen::App::AppId& appId, const Tizen::Base::String& instanceId, int width, int height, int& shmId) = 0;
73         virtual result RequestSharedMemoryIdForPD(const Tizen::App::AppId& appId, const Tizen::Base::String& instanceId, int width, int height, int& shmId) = 0;
74         virtual result RequestSyncSharedMemory(const Tizen::App::AppId& appId, const Tizen::Base::String& instanceId, int width, int height) = 0;
75         virtual result RequestSyncSharedMemoryForPD(const Tizen::App::AppId& appId, const Tizen::Base::String& instanceId) = 0;
76         virtual result RequestReleaseSharedMemory(const Tizen::App::AppId& appId, const Tizen::Base::String& instanceId) = 0;
77         virtual result RequestReleaseSharedMemoryForPD(const Tizen::App::AppId& appId, const Tizen::Base::String& instanceId) = 0;
78
79         // _IIpcServerEventListener
80         virtual void OnIpcServerStarted(const Tizen::Io::_IpcServer& server);
81         virtual void OnIpcServerStopped(const Tizen::Io::_IpcServer& server);
82         virtual void OnIpcClientConnected(const Tizen::Io::_IpcServer& server, int clientId);
83         virtual void OnIpcClientDisconnected(const Tizen::Io::_IpcServer&server, int clientId);
84         virtual void OnIpcRequestReceived(Tizen::Io::_IpcServer& server, const IPC::Message& message);
85
86         result StartIpcServer(void);
87
88 private:
89         _AppWidgetManagerStub(const _AppWidgetManagerStub& value);
90         _AppWidgetManagerStub& operator =(const _AppWidgetManagerStub& source);
91
92
93 protected:
94         Tizen::Io::_IpcServer *__pIpcServer;
95 };      //_AppWidgetManagerStub
96
97 }}}
98
99 #endif//_FSHELL_INTERNAL_APPWIDGET_MANAGER_STUB_H_