refactoring (now _AppContext manages list of _AppWidgetContext, IpcConnection state...
[framework/osp/appwidget-service.git] / inc / FShell_AppWidgetRemoteBuffer.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_AppWidgetRemoteBuffer.h
19  * @brief       This is the header file for the _AppWidgetRemoteBuffer class.
20  *
21  * This header file contains the declarations of the _AppWidgetRemoteBuffer class.
22  */
23
24 #ifndef _FSHELL_APPWIDGET_REMOTE_BUFFER_H_
25 #define _FSHELL_APPWIDGET_REMOTE_BUFFER_H_
26
27 #include <FBaseRtIEventListener.h>
28 #include <provider_buffer.h>
29
30 namespace Tizen { namespace Shell  { namespace App
31 {
32
33
34 class _IAppWidgetRemoteBufferEventListener
35         : virtual public Tizen::Base::Runtime::IEventListener
36 {
37 public:
38                 _IAppWidgetRemoteBufferEventListener(void){}
39                 ~_IAppWidgetRemoteBufferEventListener(void){}
40
41                 virtual void OnTouchEventReceived(buffer_event event, double timestamp, double x, double y) = 0;
42 };
43
44 /**
45  * @class       _AppWidgetContext
46  * @brief       This class wraps provider_buffer_xxx of libprovider.
47  */
48 class _AppWidgetRemoteBuffer
49         :public Tizen::Base::Object
50 {
51 public:
52         _AppWidgetRemoteBuffer(const Tizen::Base::String& providerId, const Tizen::Base::String& instanceId, target_type type, _IAppWidgetRemoteBufferEventListener* pListener);
53         ~_AppWidgetRemoteBuffer(void);
54
55         int Acquire(int w, int h);
56
57 private:
58         result Release(void);
59
60 private:
61         target_type __type;
62         Tizen::Base::String __providerId;
63         Tizen::Base::String __instanceId;
64         void* __buffer;
65         struct livebox_buffer* __buffer_info;
66         _IAppWidgetRemoteBufferEventListener* __pListener;
67
68 };      // class _AppWidgetRemoteBuffer
69
70 }}} // Tizen::Shell::App
71
72 #endif // _FSHELL_APPWIDGET_REMOTE_BUFFER_H_