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.
19 #include <dpl/application.h>
20 #include <dpl/generic_event.h>
21 #include <dpl/event/controller.h>
22 #include <dpl/type_list.h>
24 #include <dpl/optional_typedefs.h>
26 #include <i_runnable_widget_object.h>
27 #include <dpl/wrt-dao-ro/widget_dao_read_only.h>
28 #include <dpl/wrt-dao-ro/common_dao_types.h>
29 #include "widget_state.h"
30 #include <launch_user_data.h>
31 #include "window_data.h"
32 #include "splash_screen_support.h"
34 DECLARE_GENERIC_EVENT_0(NextStepEvent)
37 public DPL::Application,
38 private DPL::Event::Controller<DPL::TypeListDecl<NextStepEvent>::Type>,
39 public DPL::TaskDecl<WrtClient>
56 ReturnStatus::Type getReturnStatus() const;
58 static std::string getTizenIdFromArgument(int argc, char **argv);
61 virtual void OnStop();
62 virtual void OnCreate();
63 virtual void OnResume();
64 virtual void OnPause();
65 virtual void OnReset(bundle *b);
66 virtual void OnTerminate();
71 void showHelpAndQuit();
73 void setSdkLauncherDebugData();
74 bool checkDebugMode(SDKDebugData* debugData);
75 void connectElmCallback();
76 void initializeWindowModes();
80 virtual void OnEventReceived(const NextStepEvent& event);
83 static void backButtonCallback(void* data,
86 static Eina_Bool naviframeBackButtonCallback(void* data,
89 // Low Memory Callback
90 static int appcoreLowMemoryCallback(void* data);
91 static int languageChangedCallback(void *data);
94 void setOrientationWindow();
95 void unsetOrientationWindow();
96 void setOrientationEwk();
102 void loadFinishCallback(Evas_Object* webview);
103 void progressStartedCallback();
104 void loadProgressCallback(Evas_Object* webview, double value);
105 void progressFinishCallback();
106 void webkitExitCallback();
107 void webCrashCallback();
108 void toggleFullscreenCallback(bool fullscreen);
109 void imeChangedCallback(bool open);
110 void setLayout(Evas_Object* newBuffer);
111 void unsetLayout(Evas_Object* currentBuffer);
114 std::string m_tizenId;
115 DPL::OptionalUInt m_appControlIndex;
120 int m_sdkLauncherPid;
122 unsigned short m_debuggerPort;
123 ReturnStatus::Type m_returnStatus;
124 WRT::RunnableWidgetObjectPtr m_widget;
125 WrtDB::WidgetDAOReadOnlyPtr m_dao;
126 WidgetSettingListPtr m_settingList;
127 WidgetState m_widgetState;
128 std::unique_ptr<WindowData> m_windowData;
129 std::unique_ptr<SplashScreenSupport> m_splashScreen;
133 #endif // WRT_CLIENT_H