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);
85 static void ExitCallback(void* data,
89 static Eina_Bool naviframeBackButtonCallback(void* data,
91 static int appcoreLowMemoryCallback(void* data);
92 static int languageChangedCallback(void *data);
93 static void autoRotationCallback(void* data, Evas_Object* obj, void* event);
94 static void focusedCallback(void* data,
97 static void unfocusedCallback(void* data,
102 void setInitialViewMode();
105 void setWindowOrientation(int angle);
106 void setWindowInitialOrientation();
107 void unsetWindowOrientation();
108 void setEwkInitialOrientation();
111 void setCtxpopupItem();
112 void ctxpopupShare();
113 void ctxpopupReload();
114 void ctxpopupLaunchBrowser();
117 void hwkeyCallback(const std::string& key);
123 void loadFinishCallback(Evas_Object* webview);
124 void resetCallback(bool result);
125 void progressStartedCallback();
126 void loadProgressCallback(Evas_Object* webview, double value);
127 void progressFinishCallback();
128 void webkitExitCallback();
129 void webCrashCallback();
130 void enterFullscreenCallback(Evas_Object* obj, bool isFullscreenByPlatform);
131 void exitFullscreenCallback(Evas_Object* obj);
132 void setLayout(Evas_Object* newBuffer);
133 void unsetLayout(Evas_Object* currentBuffer);
136 std::string m_tizenId;
142 ReturnStatus::Type m_returnStatus;
143 WRT::RunnableWidgetObjectPtr m_widget;
144 WrtDB::WidgetDAOReadOnlyPtr m_dao;
145 WidgetSettingListPtr m_settingList;
146 WidgetState m_widgetState;
147 std::unique_ptr<WindowData> m_windowData;
148 std::unique_ptr<SplashScreenSupport> m_splashScreen;
149 std::string m_initialViewMode;
150 std::string m_currentViewMode;
151 bool m_isWebkitFullscreen;
152 bool m_isFullscreenByPlatform;
154 std::unique_ptr<ClientModule::SubmodeSupport> m_submodeSupport;
157 #endif // WRT_CLIENT_H