2 // Copyright (c) 2012 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 GlMainFrame.cpp
19 * @brief This is the implementation file for MainFrame class.
23 #include "GlGalleryApp.h"
24 #include "GlFormFactory.h"
25 #include "GlMainFrame.h"
26 #include "GlPanelFactory.h"
29 using namespace Tizen::Base;
30 using namespace Tizen::Base::Collection;
31 using namespace Tizen::Ui;
32 using namespace Tizen::Ui::Controls;
33 using namespace Tizen::Ui::Scenes;
35 MainFrame::MainFrame(void)
38 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
41 MainFrame::~MainFrame(void)
44 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
48 MainFrame::OnInitializing(void)
52 static FormFactory formFactory;
53 static PanelFactory panelFactory;
55 SceneManager* pSceneManager = SceneManager::GetInstance();
57 r = pSceneManager->RegisterFormFactory(formFactory);
58 r = pSceneManager->RegisterPanelFactory(panelFactory);
60 r = pSceneManager->RegisterScene(IDSCN_ALBUM_LIST, IDC_FORM_ALBUM_LIST, IDC_PANEL_BLANK);
61 r = pSceneManager->RegisterScene(IDSCN_ALBUM_LIST_EDITOR, IDC_FORM_ALBUM_LIST_EDITOR, IDC_PANEL_BLANK);
62 r = pSceneManager->RegisterScene(IDSCN_ALBUM_NAME_EDITOR, IDC_FORM_ALBUM_NAME_EDITOR, IDC_PANEL_BLANK);
64 r = pSceneManager->RegisterScene(IDSCN_ALL_LIST, IDC_FORM_FILE_LIST, IDC_PANEL_ALL_LIST);
65 r = pSceneManager->RegisterScene(IDSCN_IMAGE_LIST, IDC_FORM_FILE_LIST, IDC_PANEL_IMAGE_LIST);
66 r = pSceneManager->RegisterScene(IDSCN_VIDEO_LIST, IDC_FORM_FILE_LIST, IDC_PANEL_VIDEO_LIST);
68 r = pSceneManager->RegisterScene(IDSCN_ALL_LIST_EDITOR, IDC_FORM_FILE_LIST_EDITOR, IDC_PANEL_ALL_LIST_EDITOR);
69 r = pSceneManager->RegisterScene(IDSCN_IMAGE_LIST_EDITOR, IDC_FORM_FILE_LIST_EDITOR, IDC_PANEL_IMAGE_LIST_EDITOR);
70 r = pSceneManager->RegisterScene(IDSCN_VIDEO_LIST_EDITOR, IDC_FORM_FILE_LIST_EDITOR, IDC_PANEL_VIDEO_LIST_EDITOR);
72 r = pSceneManager->RegisterScene(IDSCN_ALL_LIST_SELECTION, IDC_FORM_FILE_LIST_EDITOR,
73 IDC_PANEL_ALL_LIST_SELECTION);
75 r = pSceneManager->RegisterScene(IDSCN_SETTING_MAIN, IDC_FORM_SETTING_MAIN, IDC_PANEL_BLANK);
76 r = pSceneManager->RegisterScene(IDSCN_SETTING_INTERVAL, IDC_FORM_SETTING_INTERVAL, IDC_PANEL_BLANK);
77 r = pSceneManager->RegisterScene(IDSCN_SETTING_TRANSITION, IDC_FORM_SETTING_TRANSITION, IDC_PANEL_BLANK);
80 GalleryApp* pGalleryApp = static_cast<GalleryApp*>(GalleryApp::GetInstance());
82 String operationID = pGalleryApp->GetAppControlOperationId();
84 if (operationID.CompareTo(APPCONTROL_OPERATION_ID_MAIN) == 0)
86 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALBUM_LIST), null);
88 else if (operationID.CompareTo(APPCONTROL_OPERATION_ID_PICK) == 0)
90 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALBUM_LIST), null);
92 else if (operationID.CompareTo(APPCONTROL_OPERATION_ID_CONFIGURE) == 0)
94 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SETTING_MAIN), null);
98 pGalleryApp->Terminate();
100 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
106 MainFrame::OnTerminating(void)
108 AppLogDebug("ENTER");
109 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));