2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
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.
20 #include <dpl/application.h>
21 #include <dpl/generic_event.h>
22 #include <dpl/event/controller.h>
23 #include <dpl/type_list.h>
25 #include <dpl/optional_typedefs.h>
27 #include <i_runnable_widget_object.h>
28 #include <dpl/wrt-dao-ro/widget_dao_read_only.h>
29 #include <dpl/wrt-dao-ro/common_dao_types.h>
30 #include "widget_state.h"
31 #include <launch_user_data.h>
32 #include "window_data.h"
33 #include "splash_screen_support.h"
35 DECLARE_GENERIC_EVENT_0(NextStepEvent)
37 namespace ClientModule {
42 public DPL::Application,
43 private DPL::Event::Controller<DPL::TypeListDecl<NextStepEvent>::Type>,
44 public DPL::TaskDecl<WrtClient>
61 ReturnStatus::Type getReturnStatus() const;
63 static std::string getTizenIdFromArgument(int argc, char **argv);
64 void autoRotationSetOrientation(Evas_Object* obj);
67 virtual void OnStop();
68 virtual void OnCreate();
69 virtual void OnResume();
70 virtual void OnPause();
71 virtual void OnReset(bundle *b);
72 virtual void OnTerminate();
77 void showHelpAndQuit();
78 void setDebugMode(bundle* b);
79 void initializeWindowModes();
82 virtual void OnEventReceived(const NextStepEvent& event);
86 static Eina_Bool naviframeBackButtonCallback(void* data,
88 static int appcoreLowMemoryCallback(void* data);
89 static int languageChangedCallback(void *data);
90 static void autoRotationCallback(void* data, Evas_Object* obj, void* event);
91 static void focusedCallback(void* data,
94 static void unfocusedCallback(void* data,
99 void setInitialViewMode();
102 void setWindowOrientation(int angle);
103 void setWindowInitialOrientation();
104 void unsetWindowOrientation();
105 void setEwkInitialOrientation();
108 void setCtxpopupItem();
109 void ctxpopupShare();
110 void ctxpopupReload();
111 void ctxpopupLaunchBrowser();
114 void hwkeyCallback(const std::string& key);
120 void loadFinishCallback(Evas_Object* webview);
121 void resetCallback(bool result);
122 void progressStartedCallback();
123 void loadProgressCallback(Evas_Object* webview, double value);
124 void progressFinishCallback();
125 void webkitExitCallback();
126 void webCrashCallback();
127 void enterFullscreenCallback(Evas_Object* obj);
128 void exitFullscreenCallback(Evas_Object* obj);
129 void setLayout(Evas_Object* newBuffer);
130 void unsetLayout(Evas_Object* currentBuffer);
133 std::string m_tizenId;
139 ReturnStatus::Type m_returnStatus;
140 WRT::RunnableWidgetObjectPtr m_widget;
141 WrtDB::WidgetDAOReadOnlyPtr m_dao;
142 WidgetSettingListPtr m_settingList;
143 WidgetState m_widgetState;
144 std::unique_ptr<WindowData> m_windowData;
145 std::unique_ptr<SplashScreenSupport> m_splashScreen;
146 std::string m_initialViewMode;
147 std::string m_currentViewMode;
148 bool m_isWebkitFullscreen;
150 std::unique_ptr<ClientModule::SubmodeSupport> m_submodeSupport;
153 #endif // WRT_CLIENT_H