2 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
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
8 // http://floralicense.org/license/
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.
18 * @file FShell_AppWidgetContextBase.h
19 * @brief This is the header file for the _AppWidgetContextBase class.
21 * This header file contains the declarations of the _AppWidgetContextBase class.
24 #ifndef _FSHELL_INTERNAL_APPWIDGET_CONTEXT_BASE_H_
25 #define _FSHELL_INTERNAL_APPWIDGET_CONTEXT_BASE_H_
29 #include <FAppTypes.h>
30 #include <FBaseObject.h>
31 #include <FBaseColHashMap.h>
33 #define APPWIDGET_PROVIDER_ID_ENABLE true
35 typedef struct _bundle_t bundle;//TODO move code to osp-appfw
37 namespace Tizen { namespace Shell { namespace App
40 class _AppWidgetContextBase:
41 public Tizen::Base::Object
44 enum _AppWidgetProviderState
52 _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);
53 virtual ~_AppWidgetContextBase();
55 virtual void OnPopupCreated(double x, double y, int width, int height) = 0;
56 virtual void OnPopupDestoyed(void) = 0;
58 virtual result SendTouchEvent(buffer_event event, double timestamp, double x, double y) = 0;
60 void SetIpcClientId(int clientId);
61 bool HasValidClientId(void) const;
62 // for buffered appWidget
63 int GetSharedMemId(int w, int h);
64 result ReleaseSharedMem(void);
69 bool IsRunning(void) const;
70 bool IsSharedMemCreated(void) const;
72 virtual Tizen::Base::Collection::HashMap* CreateRequestArgs(void) = 0;
73 result SendRequestToApp(const Tizen::App::AppId& appId, const Tizen::Base::String& operation, Tizen::Base::Collection::HashMap* pArgs);
77 Tizen::Base::String __userInfo;
78 Tizen::Base::String __appId;
79 Tizen::Base::String __providerName;
80 Tizen::Base::String __providerId;
81 Tizen::Base::String __instanceId;
87 bool __isForeground;// LB only?
91 struct livebox_buffer *__buffer_info;
93 _AppWidgetProviderState __providerState;
96 class _AppWidgetRequestHelper
99 static result SendRequestToApp(const Tizen::App::AppId& appId, const Tizen::Base::String& operation, Tizen::Base::Collection::HashMap* pArgs);
100 // static result AddStrArrayToBundle(bundle* b, const char* key, const Tizen::Base::Collection::IList* pList);
101 // static result ExtractPackageIdAndExecutableName(Tizen::App::AppId inAppId, Tizen::Base::String& outPackageId, Tizen::Base::String& outExecutableName);
104 extern const wchar_t ARG_KEY_INSTANCE_ID[];
105 extern const wchar_t ARG_KEY_PROVIDER_NAME[];
106 extern const wchar_t ARG_KEY_USER_INFO[];
107 extern const wchar_t ARG_KEY_X[];
108 extern const wchar_t ARG_KEY_Y[];
109 extern const wchar_t ARG_KEY_WIDTH[];
110 extern const wchar_t ARG_KEY_HEIGHT[];
111 extern const wchar_t ARG_KEY_POPUP_WIDTH[];
112 extern const wchar_t ARG_KEY_POPUP_HEIGHT[];
113 extern const wchar_t ARG_KEY_ARGUMENT[];
114 extern const wchar_t ARG_KEY_EVENT_TYPE[];
115 extern const wchar_t ARG_KEY_TIME_STAMP[];
117 } /* namespace App */
118 } /* namespace AppWidget */
119 } /* namespace Samsung */
120 #endif // _FSHELL_INTERNAL_APPWIDGET_CONTEXT_BASE_H_