2 // Open Service Platform
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://www.tizenopensource.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.
17 #include "FormMgr.h"
\r
18 #include "AnimationForm.h"
\r
19 #include "ButtonForm.h"
\r
20 #include "CheckButtonForm.h"
\r
21 #include "ColorPickerForm.h"
\r
22 #include "EditDateForm.h"
\r
23 #include "EditForm.h"
\r
24 #include "MenuForm.h"
\r
25 #include "MsgBoxPopupForm.h"
\r
26 #include "OverlayKeypadForm.h"
\r
27 #include "PanelForm.h"
\r
28 #include "ProgressForm.h"
\r
29 #include "RadioGroupForm.h"
\r
30 #include "SliderForm.h"
\r
31 #include "EditTimeForm.h"
\r
32 #include "NavigationForm.h"
\r
33 #include "DateTimeForm.h"
\r
34 #include "ListViewForm.h"
\r
35 #include "GroupedListViewForm.h"
\r
36 #include "IconListViewForm.h"
\r
37 #include "SearchBarForm.h"
\r
38 #include "EnrichedTextForm.h"
\r
39 #include "ExpandableEditAreaForm.h"
\r
40 #include "GalleryForm.h"
\r
41 #include "TextBoxForm.h"
\r
42 #include "CustomButtonForm.h"
\r
43 #include "DataBindingForm.h"
\r
45 using namespace Osp::App;
\r
46 using namespace Osp::Base;
\r
47 using namespace Osp::Ui;
\r
48 using namespace Osp::Ui::Controls;
\r
50 FormMgr::FormMgr(void):
\r
51 __pPreviousForm(null),
\r
56 FormMgr::~FormMgr(void)
\r
61 FormMgr::Initialize(void)
\r
63 result r = E_SUCCESS;
\r
64 r = Construct(FORM_STYLE_NORMAL);
\r
65 SetName(L"FormMgr");
\r
70 bool FormMgr::SetStarterForm(RequestId requestId, Osp::Base::Collection::IList* pArgs)
\r
72 Form* pCurrentForm = Application::GetInstance()->GetAppFrame()->GetFrame()->GetCurrentForm();
\r
74 if (pCurrentForm == this)
\r
75 SwitchToForm(requestId, pArgs);
\r
82 void FormMgr::OnUserEventReceivedN(RequestId requestId, Osp::Base::Collection::IList* pArgs)
\r
84 SwitchToForm(requestId, pArgs);
\r
88 FormMgr::SwitchToForm(RequestId requestId, Osp::Base::Collection::IList* pArgs)
\r
90 Frame* pFrame = Application::GetInstance()->GetAppFrame()->GetFrame();
\r
91 BaseForm* pExeForm = null;
\r
95 case REQUEST_MAINFORM:
\r
97 if (__pMainForm == null)
\r
99 __pMainForm = new MainForm();
\r
100 __pMainForm->Initialize();
\r
101 pFrame->AddControl(*__pMainForm);
\r
103 pFrame->SetCurrentForm(*__pMainForm);
\r
104 __pMainForm->Draw();
\r
105 if (__pPreviousForm != null)
\r
107 if (__pPreviousForm != __pMainForm)
\r
108 pFrame->RemoveControl(*__pPreviousForm);
\r
110 __pPreviousForm = __pMainForm;
\r
115 case REQUEST_ANIMATIONFORM:
\r
116 pExeForm = new AnimationForm();
\r
118 case REQUEST_BUTTONFORM:
\r
119 pExeForm = new ButtonForm();
\r
121 case REQUEST_CHECKBUTTONFORM:
\r
122 pExeForm = new CheckButtonForm();
\r
124 case REQUEST_COLORPICKERFORM:
\r
125 pExeForm = new ColorPickerForm();
\r
127 case REQUEST_EDITDATEFORM:
\r
128 pExeForm = new EditDateForm();
\r
130 case REQUEST_EDITFORM:
\r
131 pExeForm = new EditForm();
\r
133 case REQUEST_MENUFORM:
\r
134 pExeForm = new MenuForm();
\r
136 case REQUEST_MSGBOXPOPUPFORM:
\r
137 pExeForm = new MsgBoxPopupForm();
\r
139 case REQUEST_OVERLAYKEYPADFORM:
\r
140 pExeForm = new OverlayKeypadForm();
\r
142 case REQUEST_PANELFORM:
\r
143 pExeForm = new PanelForm();
\r
145 case REQUEST_PROGRESSFORM:
\r
146 pExeForm = new ProgressForm();
\r
148 case REQUEST_RADIOGROUPFORM:
\r
149 pExeForm = new RadioGroupForm();
\r
151 case REQUEST_SLIDABLRFORM:
\r
152 pExeForm = new SliderForm();
\r
154 case REQUEST_EDITTIMEFORM:
\r
155 pExeForm = new EditTimeForm();
\r
157 case REQUEST_NAVIGATIONFORM:
\r
158 pExeForm = new NavigationForm();
\r
160 case REQUEST_DATETIMEFORM:
\r
161 pExeForm = new DateTimeForm();
\r
163 case REQUEST_LISTVIEWFORM:
\r
164 pExeForm = new ListViewForm();
\r
166 case REQUEST_GROUPEDLISTVIEWFORM:
\r
167 pExeForm = new GroupedListViewForm();
\r
169 case REQUEST_ICONLISTVIEWFORM:
\r
170 pExeForm = new IconListViewForm();
\r
172 case REQUEST_SEARCHBARFORM:
\r
173 pExeForm = new SearchBarForm();
\r
175 case REQUEST_ENRICHEDTEXTFORM:
\r
176 pExeForm = new EnrichedTextForm();
\r
178 case REQUEST_EXPANDABLEEDITAREAFORM:
\r
179 pExeForm = new ExpandableEditAreaForm();
\r
181 case REQUEST_GALLERYFORM:
\r
182 pExeForm = new GalleryForm();
\r
184 case REQUEST_TEXTBOXFORM:
\r
185 pExeForm = new TextBoxForm();
\r
187 case REQUEST_CUSTOMBUTTONFORM:
\r
188 pExeForm = new CustomButtonForm();
\r
191 case REQUEST_DATABINDINGFORM:
\r
192 pExeForm = new DataBindingForm();
199 pExeForm->Initialize();
\r
200 pFrame->AddControl(*pExeForm);
\r
201 pFrame->SetCurrentForm(*pExeForm);
\r
204 if (__pPreviousForm != null)
\r
206 if (__pPreviousForm != __pMainForm)
\r
207 pFrame->RemoveControl(*__pPreviousForm);
\r
209 __pPreviousForm = pExeForm;
\r