3 // Copyright (c) 2012 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: IntSceneRegister.cpp
20 *@brief: This header file contains the declarations of the %lsceneRegister class.
26 #include "IntSceneRegister.h"
27 #include "IntFormFactory.h"
29 using namespace Tizen::Base;
30 using namespace Tizen::Base::Collection;
31 using namespace Tizen::Ui::Scenes;
33 const wchar_t* IDSCN_MAIN_VIEW = L"ScnMainMenu";
34 const wchar_t* IDSCN_BOOKMARK_VIEW = L"ScnBookmark";
35 const wchar_t* IDSCN_HISTORY_LIST = L"ScnHistory";
36 const wchar_t* IDSCN_FIND_WORD = L"ScnFindWord";
37 const wchar_t* IDSCN_EDIT_HISTORY_LIST = L"ScnEditHistory";
38 const wchar_t* IDSCN_SETTINGS_CLEAR_PRIVATE_DATA = L"ScnSettingsClearPrivateData";
39 const wchar_t* IDSCN_MULTIPLE_WINDOW = L"ScnMultipleWindow";
40 const wchar_t* IDSCN_MULTIPLE_WINDOW_GRID = L"ScnMultipleWindowGrid";
41 const wchar_t* IDSCN_SETTINGS = L"ScnSettings";
42 const wchar_t* IDSCN_ADD_BOOKMARK = L"ScnAddBookmark";
43 const wchar_t* IDSCN_ARTICLE_READER = L"ScnArticleReader";
44 const wchar_t* IDSCN_EDIT_BOOKMARK_LIST = L"ScnEditBookmarkList";
45 const wchar_t* IDSCN_CREATE_BOOKMARK_FOLDER = L"ScnCreateBookmarkFolder";
46 const wchar_t* IDSCN_FONT_SIZE = L"ScnFontSize";
47 const wchar_t* IDSCN_EDIT_HOMEPAGE_VIEW = L"ScnEditHomePage";
48 const wchar_t* IDSCN_BRIGHTNESS = L"ScnBrightness";
50 SceneRegister::SceneRegister(void)
55 SceneRegister::~SceneRegister(void)
61 SceneRegister::RegisterAllScenes(void)
63 static const wchar_t* PANEL_BLANK = L"";
64 static FormFactory formFactory;
65 SceneManager* pSceneManager = SceneManager::GetInstance();
67 if (pSceneManager == null)
71 pSceneManager->RegisterFormFactory(formFactory);
73 pSceneManager->RegisterScene(IDSCN_BOOKMARK_VIEW, IDL_FORM_BOOKMARK_LIST_SCENE, PANEL_BLANK);
74 pSceneManager->RegisterScene(IDSCN_HISTORY_LIST, IDL_FORM_HISTORY_LIST_SCENE, PANEL_BLANK);
75 pSceneManager->RegisterScene(IDSCN_FIND_WORD, IDL_FORM_FIND_WORD_SCENE, PANEL_BLANK);
76 pSceneManager->RegisterScene(IDSCN_EDIT_HISTORY_LIST, IDL_FORM_EDIT_HISTORY_LIST_SCENE, PANEL_BLANK);
77 pSceneManager->RegisterScene(IDSCN_SETTINGS_CLEAR_PRIVATE_DATA, IDL_FORM_SETTINGS_CLEAR_PRIVATE_DATA_SCENE, PANEL_BLANK);
78 pSceneManager->RegisterScene(IDSCN_MULTIPLE_WINDOW, IDL_FORM_MULTIPLE_WINDOW_SCENE, PANEL_BLANK);
79 pSceneManager->RegisterScene(IDSCN_SETTINGS, IDL_FORM_SETTINGS_SCENE, PANEL_BLANK);
80 pSceneManager->RegisterScene(IDSCN_ADD_BOOKMARK, IDL_FORM_ADD_BOOKMARK_SCENE, PANEL_BLANK);
81 pSceneManager->RegisterScene(IDSCN_ARTICLE_READER, IDL_FORM_ARTICLE_READER_SCENE, PANEL_BLANK);
82 pSceneManager->RegisterScene(IDSCN_EDIT_BOOKMARK_LIST, IDL_FORM_EDIT_BOOKMARK_LIST_SCENE, PANEL_BLANK);
83 pSceneManager->RegisterScene(IDSCN_CREATE_BOOKMARK_FOLDER, IDL_FORM_CREATE_BOOKMARK_FOLDER_SCENE, PANEL_BLANK);
84 pSceneManager->RegisterScene(IDSCN_FONT_SIZE, IDL_FORM_FONT_SIZE_SCENE, PANEL_BLANK);
85 pSceneManager->RegisterScene(IDSCN_EDIT_HOMEPAGE_VIEW, IDL_FORM_EDIT_HOME_PAGE_SCENE, PANEL_BLANK);
86 pSceneManager->RegisterScene(IDSCN_BRIGHTNESS, IDL_FORM_BRIGHTNESS_SCENE, PANEL_BLANK);
90 SceneRegister::RegisterNewMainView(const Tizen::Base::String& sceneID, const Tizen::Base::String& FormID)
93 static const wchar_t* PANEL_BLANK = L"";
94 SceneManager* pSceneManager = SceneManager::GetInstance();
96 if (pSceneManager == null)
101 r = pSceneManager->RegisterScene(sceneID, FormID, PANEL_BLANK);
103 if (GetLastResult() != E_SUCCESS)
105 AppLogDebug("fail Not registered");
109 AppLogDebug("success registered");
115 SceneRegister::DestroyAndUnRegisterScene(const String& sceneID)
117 result r = E_SUCCESS;
118 SceneManager* pSceneManager = SceneManager::GetInstance();
120 if (pSceneManager == null)
124 pSceneManager->UnregisterScene(sceneID);
125 pSceneManager->DestroyScene(sceneID);