3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
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: IntMultipleWindowPresentationModel.h
20 *@brief: MultipleWindowPresentationModel is used to maintain browser window information
23 #ifndef _INT_MULTIPLE_WINDOW_PRESENTATION_MODEL_H_
24 #define _INT_MULTIPLE_WINDOW_PRESENTATION_MODEL_H_
27 #include <FGraphics.h>
31 #include "IntFaviconManager.h"
32 #include "IntFormFactory.h"
33 #include "IntSceneRegister.h"
42 : public Tizen::Base::Object
46 * WindowInfo default constructor
51 * WindowInfo default destructor
56 Tizen::Base::String faviconUrl;
57 Tizen::Base::String faviconFilePath;
58 Tizen::Base::String formID;
60 bool isAppcontrolTriggered;
61 bool isJavascriptInitiated;
63 Tizen::Base::String pageTitle;
64 Tizen::Base::String pageUrl;
65 Tizen::Web::Controls::Web* pCurrentWeb;
66 Tizen::Graphics::Bitmap* pFavicon;
67 static Tizen::Graphics::Bitmap* pFormCanvasBitmap;
68 Tizen::Graphics::Bitmap* pWebCanvasBitmap;
69 Tizen::Base::String sceneID;
71 static int __windowId;
74 class MultipleWindowPresentationModel
79 * This method add the windowInfo object in ArrayList
81 * @return An error code
82 * @param[in] WindowInfo The windowInfo object to be added.
83 * @exception E_SUCCESS The method is successful.
84 * @exception E_OUT_OF_MEMORY The memory is insufficient.
85 * @remarks This method performs a shallow copy. It adds just the pointer; not the element itself.
87 result AddWindoInfo(WindowInfo* pWindowInfo);
90 *@name CreateNewMainViewScene
91 *@brief Create new instance of MainScene form
92 *@param[in] no input parameter
93 *@retval no return value
95 WindowInfo* CreateNewMainViewSceneN(const Tizen::Base::String& Url = L"", bool isAppControlTriggered = false);
98 * To get active Window URL and title
100 * @return An error code
103 * @exception E_SUCCESS The method is successful.
105 WindowInfo* GetActiveWindowInfo(void);
108 * This method returns the ArrayList object
112 * @remarks Return the ArrayList object
114 Tizen::Base::Collection::ArrayList* GetAllWindowArrayList(void);
117 * To get current sceneID of Main Form
119 * @return An error code
120 * @param currentSceneID The Current Scene ID
121 * @exception E_SUCCESS The method is successful.
123 void GetCurrentSceneId(Tizen::Base::String& currentSceneId);
126 * @brief The method used to get the already created instance of the MultipleWindowPresentationModel
128 static MultipleWindowPresentationModel* GetInstance(void);
131 * Object is returned corresponding to its key value
133 * @return An error code
134 * @param[in] key The key of the object needed
135 * @param[in] Object A pointer to a pointer to an objec_t
136 * @exception E_SUCCESS The method is successful.
137 * @exception E_OUT_OF_MEMORY The memory is insufficient.
138 * @remarks To work properly, existing key has to be passed
140 result GetValue(Key key, Tizen::Base::Object**);
143 * To set current sceneID of Main Form
145 * @return An error code
146 * @param currentSceneID The Current Scene ID
147 * @exception E_SUCCESS The method is successful.
149 void SetCurrentSceneID(const Tizen::Base::String& currentSceneID);
152 * Object is set corresponding to its key value
154 * @return An error code
155 * @param[in] key The key of the object to be set
156 * @param[in] Object A pointer to an object
157 * @exception E_SUCCESS The method is successful.
158 * @exception E_INVALID_ARG A specified input parameter is invalid, or
159 * the comparer has failed to compare the keys.
160 * @exception E_OBJ_NOT_FOUND The specified @c key is not found in the map.
161 * @remarks To work properly, existing key and object has to be passed
163 result SetValue(Key key, Tizen::Base::Object*);
166 * Uninitialize MultiWindowManager
168 * @return no return value
169 * @param[in] no input parameters
171 void UnInitialize(void);
174 * Uninitialize MultiWindowManager
176 * @return no return value
177 * @param[in] pTitle The Title of the popup to be created
178 * @param[in] pText The Text of the popup to be created
180 void ShowPopup(Tizen::Base::String& pTitle, Tizen::Base::String& pText);
185 * Default constructor, It is declared as private to make this class a singleton class
187 MultipleWindowPresentationModel(void);
192 virtual ~MultipleWindowPresentationModel(void);
197 MultipleWindowPresentationModel(const MultipleWindowPresentationModel& multipleWindowModelObj);
200 * assignment operator
203 MultipleWindowPresentationModel& operator=(const MultipleWindowPresentationModel& multipleWindowModelObj);
206 * Initializing MultiWindowManager
208 * @return An error code
209 * @param[in] no input parameters
210 * @exception E_SUCCESS The method is successful.
211 * @exception E_INVALID_ARG A specified input parameter is invalid, or
212 * the @c capacity or the @c loadFactor is negative.
213 * @exception E_OUT_OF_MEMORY The memory is insufficient.
216 result Construct(void);
219 * @brief The method used to create the instance of the MultipleWindowPresentationModel class
221 static void CreateInstance(void);
224 * @brief The method used to remove the already created instance of the MultipleWindowPresentationModel
226 static void DestroyInstance(void);
230 static Tizen::Base::String __currentSceneId;
231 static Tizen::Base::Collection::HashMapT< Key, Tizen::Base::Object* > __keyAndValues;
232 static Tizen::Base::Collection::ArrayList* __pAllWindowList;
233 static WindowInfo* __pCurWindowInfo;
234 static MultipleWindowPresentationModel* __pMultiWindowManager;
235 bool __isShowInProcess;
238 #endif // _INT_MULTIPLE_WINDOW_PRESENTATION_MODEL_H_