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;
62 Tizen::Base::String pageTitle;
63 Tizen::Base::String pageUrl;
64 Tizen::Web::Controls::Web* pCurrentWeb;
65 Tizen::Graphics::Bitmap* pFavicon;
66 static Tizen::Graphics::Bitmap* pFormCanvasBitmap;
67 Tizen::Graphics::Bitmap* pWebCanvasBitmap;
68 Tizen::Base::String sceneID;
70 static int __windowId;
73 class MultipleWindowPresentationModel
78 * This method add the windowInfo object in ArrayList
80 * @return An error code
81 * @param[in] WindowInfo The windowInfo object to be added.
82 * @exception E_SUCCESS The method is successful.
83 * @exception E_OUT_OF_MEMORY The memory is insufficient.
84 * @remarks This method performs a shallow copy. It adds just the pointer; not the element itself.
86 result AddWindoInfo(WindowInfo* pWindowInfo);
89 *@name CreateNewMainViewScene
90 *@brief Create new instance of MainScene form
91 *@param[in] no input parameter
92 *@retval no return value
94 WindowInfo* CreateNewMainViewSceneN(const Tizen::Base::String& Url = L"", bool isAppControlTriggered = false);
97 * To get active Window URL and title
99 * @return An error code
102 * @exception E_SUCCESS The method is successful.
104 WindowInfo* GetActiveWindowInfo(void);
107 * This method returns the ArrayList object
111 * @remarks Return the ArrayList object
113 Tizen::Base::Collection::ArrayList* GetAllWindowArrayList(void);
116 * To get current sceneID of Main Form
118 * @return An error code
119 * @param currentSceneID The Current Scene ID
120 * @exception E_SUCCESS The method is successful.
122 void GetCurrentSceneId(Tizen::Base::String& currentSceneId);
125 * @brief The method used to get the already created instance of the MultipleWindowPresentationModel
127 static MultipleWindowPresentationModel* GetInstance(void);
130 * Object is returned corresponding to its key value
132 * @return An error code
133 * @param[in] key The key of the object needed
134 * @param[in] Object A pointer to a pointer to an objec_t
135 * @exception E_SUCCESS The method is successful.
136 * @exception E_OUT_OF_MEMORY The memory is insufficient.
137 * @remarks To work properly, existing key has to be passed
139 result GetValue(Key key, Tizen::Base::Object**);
142 * To set current sceneID of Main Form
144 * @return An error code
145 * @param currentSceneID The Current Scene ID
146 * @exception E_SUCCESS The method is successful.
148 void SetCurrentSceneID(const Tizen::Base::String& currentSceneID);
151 * Object is set corresponding to its key value
153 * @return An error code
154 * @param[in] key The key of the object to be set
155 * @param[in] Object A pointer to an object
156 * @exception E_SUCCESS The method is successful.
157 * @exception E_INVALID_ARG A specified input parameter is invalid, or
158 * the comparer has failed to compare the keys.
159 * @exception E_OBJ_NOT_FOUND The specified @c key is not found in the map.
160 * @remarks To work properly, existing key and object has to be passed
162 result SetValue(Key key, Tizen::Base::Object*);
165 * Uninitialize MultiWindowManager
167 * @return no return value
168 * @param[in] no input parameters
170 void UnInitialize(void);
173 * Uninitialize MultiWindowManager
175 * @return no return value
176 * @param[in] pTitle The Title of the popup to be created
177 * @param[in] pText The Text of the popup to be created
179 void ShowPopup(Tizen::Base::String& pTitle, Tizen::Base::String& pText);
184 * Default constructor, It is declared as private to make this class a singleton class
186 MultipleWindowPresentationModel(void);
191 virtual ~MultipleWindowPresentationModel(void);
196 MultipleWindowPresentationModel(const MultipleWindowPresentationModel& multipleWindowModelObj);
199 * assignment operator
202 MultipleWindowPresentationModel& operator=(const MultipleWindowPresentationModel& multipleWindowModelObj);
205 * Initializing MultiWindowManager
207 * @return An error code
208 * @param[in] no input parameters
209 * @exception E_SUCCESS The method is successful.
210 * @exception E_INVALID_ARG A specified input parameter is invalid, or
211 * the @c capacity or the @c loadFactor is negative.
212 * @exception E_OUT_OF_MEMORY The memory is insufficient.
215 result Construct(void);
218 * @brief The method used to create the instance of the MultipleWindowPresentationModel class
220 static void CreateInstance(void);
223 * @brief The method used to remove the already created instance of the MultipleWindowPresentationModel
225 static void DestroyInstance(void);
229 static Tizen::Base::String __currentSceneId;
230 static Tizen::Base::Collection::HashMapT< Key, Tizen::Base::Object* > __keyAndValues;
231 static Tizen::Base::Collection::ArrayList* __pAllWindowList;
232 static WindowInfo* __pCurWindowInfo;
233 static MultipleWindowPresentationModel* __pMultiWindowManager;
236 #endif // _INT_MULTIPLE_WINDOW_PRESENTATION_MODEL_H_