4 * Licensed under the Apache License, Version 2.0 (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://www.apache.org/licenses/LICENSE-2.0
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.
19 #include <AppCommon.h>
21 #include "FbBaseView.h"
22 #include "FbContextView.h"
24 #define PARAM_SOURCE "source"
25 #define FBR_WIN_TITLE "File Browser"
27 SET_TAG((char*)PACKAGE);
29 Evas_Object *_add_win(const char *name)
33 //win = elm_win_add(NULL, name, ELM_WIN_BASIC);
34 win = elm_win_util_standard_add(name, NULL);
38 elm_win_title_set(win, FBR_WIN_TITLE);
39 elm_win_focus_highlight_enabled_set(win, EINA_TRUE);
40 elm_win_focus_highlight_style_set(win, FBR_STYLE_WIN_FOCUS);
41 elm_config_focus_move_policy_set(ELM_FOCUS_MOVE_POLICY_CLICK);
42 evas_object_show(win);
47 class CApp : public CBaseApp {
55 CFbBaseView *pFbBaseView;
56 CContextView *pContextView;
59 virtual bool OnCreate(void)
63 elm_theme_overlay_add(NULL, THEMEFILE);
65 win = _add_win(ad.name);
71 elm_win_activate(ad.win);
72 CViewMgr::Initialize(ad.win,NULL);
73 CViewMgr* viewmgr = NULL;
75 CSortMgr::Initialize();
77 viewmgr = CViewMgr::GetInstance();
79 _ERR("Fail to get viewmgr instance");
84 pFbBaseView = new CFbBaseView(FBR_BASE_VIEW);
85 if(!viewmgr->AddView(pFbBaseView))
87 _ERR("Fail to add pFbBaseView");
92 pContextView = new CContextView(FBR_CONTEXT_VIEW);
93 if(!viewmgr->AddView(pContextView))
95 _ERR("Fail to add pContextView");
103 virtual void OnTerminate(void)
105 CViewMgr::Finalize();
108 evas_object_del(ad.win);
113 virtual void OnAppControl(app_control_h app_control)
115 _DBG(" ******************* OnAppControl *********************");
119 r = app_control_get_extra_data(app_control, PARAM_SOURCE, &source);
120 if (r != APP_CONTROL_ERROR_NONE)
124 ad.source = strdup(source);
129 ad.source = strdup("all");
133 virtual void OnResume(void)
135 _DBG(" ******************* OnService *********************");
136 CViewMgr* viewmgr = NULL;
138 viewmgr = CViewMgr::GetInstance();
140 _ERR("Fail to get viewmgr instance");
145 if (!viewmgr->PushView(FBR_BASE_VIEW, ad.source)) {
146 _ERR("Fail to push view");
154 virtual int Run(int argc, char **argv) {
155 memset(&ad, 0x00, sizeof(_appdata));
158 return CBaseApp::Run(argc, argv);
162 int main(int argc, char **argv)