2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Flora License, Version 1.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://floralicense.org/license/
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 FShell_AppWidgetContextBase.h
20 * @brief This is the header file for the _AppWidgetContextBase class.
22 * This header file contains the declarations of the _AppWidgetContextBase class.
25 #ifndef _FSHELL_INTERNAL_APPWIDGET_CONTEXT_BASE_H_
26 #define _FSHELL_INTERNAL_APPWIDGET_CONTEXT_BASE_H_
30 #include <FAppTypes.h>
31 #include <FBaseObject.h>
32 #include <FBaseColHashMap.h>
34 #define APPWIDGET_PROVIDER_ID_ENABLE true
36 typedef struct _bundle_t bundle;//TODO move code to osp-appfw
38 namespace Tizen { namespace Shell { namespace App
41 class _AppWidgetContextBase:
42 public Tizen::Base::Object
45 enum _AppWidgetProviderState
53 _AppWidgetContextBase(target_type type, const Tizen::Base::String& userInfo, const Tizen::Base::String& providerId, const Tizen::Base::String& instanceId, int width, int height, int priority);
54 virtual ~_AppWidgetContextBase();
56 virtual void OnPopupCreated(double x, double y, int width, int height) = 0;
57 virtual void OnPopupDestoyed(void) = 0;
59 virtual result SendTouchEvent(buffer_event event, double timestamp, double x, double y) = 0;
61 void SetIpcClientId(int clientId);
62 bool HasValidClientId(void) const;
63 // for buffered appWidget
64 int GetSharedMemId(int w, int h);
65 result ReleaseSharedMem(void);
70 bool IsRunning(void) const;
71 bool IsSharedMemCreated(void) const;
73 virtual Tizen::Base::Collection::HashMap* CreateRequestArgs(void) = 0;
74 result SendRequestToApp(const Tizen::App::AppId& appId, const Tizen::Base::String& operation, Tizen::Base::Collection::HashMap* pArgs);
78 Tizen::Base::String __userInfo;
79 Tizen::Base::String __appId;
80 Tizen::Base::String __providerName;
81 Tizen::Base::String __providerId;
82 Tizen::Base::String __instanceId;
88 bool __isForeground;// LB only?
92 struct livebox_buffer *__buffer_info;
94 _AppWidgetProviderState __providerState;
97 class _AppWidgetRequestHelper
100 static result SendRequestToApp(const Tizen::App::AppId& appId, const Tizen::Base::String& operation, Tizen::Base::Collection::HashMap* pArgs);
101 // static result AddStrArrayToBundle(bundle* b, const char* key, const Tizen::Base::Collection::IList* pList);
102 // static result ExtractPackageIdAndExecutableName(Tizen::App::AppId inAppId, Tizen::Base::String& outPackageId, Tizen::Base::String& outExecutableName);
105 extern const wchar_t ARG_KEY_INSTANCE_ID[];
106 extern const wchar_t ARG_KEY_PROVIDER_NAME[];
107 extern const wchar_t ARG_KEY_USER_INFO[];
108 extern const wchar_t ARG_KEY_X[];
109 extern const wchar_t ARG_KEY_Y[];
110 extern const wchar_t ARG_KEY_WIDTH[];
111 extern const wchar_t ARG_KEY_HEIGHT[];
112 extern const wchar_t ARG_KEY_POPUP_WIDTH[];
113 extern const wchar_t ARG_KEY_POPUP_HEIGHT[];
114 extern const wchar_t ARG_KEY_ARGUMENT[];
115 extern const wchar_t ARG_KEY_EVENT_TYPE[];
116 extern const wchar_t ARG_KEY_TIME_STAMP[];
118 } /* namespace App */
119 } /* namespace AppWidget */
120 } /* namespace Samsung */
121 #endif // _FSHELL_INTERNAL_APPWIDGET_CONTEXT_BASE_H_