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