#ifndef WRT_CLIENT_H
#define WRT_CLIENT_H
+#include <memory>
#include <dpl/application.h>
#include <dpl/generic_event.h>
#include <dpl/event/controller.h>
#include <dpl/type_list.h>
#include <dpl/task.h>
-#include <dpl/log/log.h>
-#include <utilX.h>
-#include <wrt_api.h>
-#include <string>
-#include <signal.h>
+#include <dpl/optional_typedefs.h>
#include <bundle.h>
+#include <i_runnable_widget_object.h>
+#include <dpl/wrt-dao-ro/widget_dao_read_only.h>
+#include <dpl/wrt-dao-ro/common_dao_types.h>
+#include "widget_state.h"
+#include <launch_user_data.h>
+#include "window_data.h"
+#include "splash_screen_support.h"
-DECLARE_GENERIC_EVENT_0(QuitEvent)
DECLARE_GENERIC_EVENT_0(NextStepEvent)
+namespace ClientModule {
+class SubmodeSupport;
+}
+
class WrtClient :
- public DPL::Application,
- private DPL::Event::Controller<DPL::TypeListDecl<QuitEvent,
- NextStepEvent>::Type>,
- public DPL::TaskDecl<WrtClient>
+ public DPL::Application,
+ private DPL::Event::Controller<DPL::TypeListDecl<NextStepEvent>::Type>,
+ public DPL::TaskDecl<WrtClient>
{
public:
WrtClient(int argc,
};
ReturnStatus::Type getReturnStatus() const;
+ virtual void Quit();
+ static std::string getTizenIdFromArgument(int argc, char **argv);
+ void autoRotationSetOrientation(Evas_Object* obj);
protected:
- virtual void OnStop();
- virtual void OnCreate();
- virtual void OnResume();
- virtual void OnPause();
- virtual void OnReset(bundle *b);
- virtual void OnTerminate();
+ virtual void OnStop();
+ virtual void OnCreate();
+ virtual void OnResume();
+ virtual void OnPause();
+ virtual void OnReset(bundle *b);
+ virtual void OnTerminate();
+
+ void setStep();
+
private:
- void showHelpAndQuit();
- void setStep();
- void setSdkLauncherDebugData();
+ void showHelpAndQuit();
+ void setDebugMode(bundle* b);
+ void initializeWindowModes();
// Events
- virtual void OnEventReceived(const QuitEvent &event);
- virtual void OnEventReceived(const NextStepEvent& event);
-
- // Installation steps
- void initStep();
- void launchStep();
- void installNewPlugins();
- void launchNameStep();
- void launchGUIDStep();
- void killWidgetStep();
- void finalizeLaunchStep();
- void shutdownStep();
- void setDeveloperModeStep();
- void setComplianceModeStep();
- void setComplianceImeiStep();
- void setComplianceMeidStep();
- void queryListStep();
-
- // Static callbacks
- static void staticWrtInitCallback(WrtErrStatus status,
- void* userdata);
- static void staticWrtLaunchWidgetCallback(void*,
- int,
- WrtErrStatus,
- const char*,
- void*);
- static void staticWrtStatusCallback(int handle,
- WrtErrStatus status,
- void* userdata);
- static void staticWrtPluginInstallationCallback(
- WrtErrStatus status,
- void* userdata);
- static void staticWrtPluginInstallProgressCb(
- float percent,
- const char* description,
- void* userdata);
- static void staticWrtResumeStatusCallback(int handle,
- WrtErrStatus status,
- void* userdata);
- static void staticWrtSuspendStatusCallback(int handle,
- WrtErrStatus status,
- void* userdata);
- static void staticWrtResetStatusCallback(int handle,
- WrtErrStatus status,
- void* userdata);
- static void staticCloseWidgetCallback(int widget_handle,
- void *userdata);
- static void staticSetDeveloperModeCallback(void *userParam);
- static void staticSetComplianceModeCallback(void *userParam);
- static void staticSetComplianceImeiCallback(void *userParam);
- static void staticSetComplianceMeidCallback(void *userParam);
+ virtual void OnEventReceived(const NextStepEvent& event);
+
+ // static Callback
+ static Eina_Bool naviframeBackButtonCallback(void* data,
+ Elm_Object_Item* it);
+ static int appcoreLowMemoryCallback(void* data);
+ static int languageChangedCallback(void *data);
+ static void autoRotationCallback(void* data, Evas_Object* obj, void* event);
+ static void focusedCallback(void* data,
+ Evas_Object* obj,
+ void* eventInfo);
+ static void unfocusedCallback(void* data,
+ Evas_Object* obj,
+ void* eventInfo);
+
+ //view-mode
+ void setInitialViewMode();
+
+ //orientation
+ void setWindowOrientation(int angle);
+ void setWindowInitialOrientation();
+ void unsetWindowOrientation();
+ void setEwkInitialOrientation();
+
+ //ctxpopup
+ void setCtxpopupItem();
+ void ctxpopupShare();
+ void ctxpopupReload();
+ void ctxpopupLaunchBrowser();
+
+ // hwkey
+ void hwkeyCallback(const std::string& key);
+
+ // launching steps
+ void initStep();
+ void launchStep();
+ void shutdownStep();
+ void loadFinishCallback(Evas_Object* webview);
+ void resetCallback(bool result);
+ void progressStartedCallback();
+ void loadProgressCallback(Evas_Object* webview, double value);
+ void progressFinishCallback();
+ void webkitExitCallback();
+ void webCrashCallback();
+ void enterFullscreenCallback(Evas_Object* obj, bool isFullscreenByPlatform);
+ void exitFullscreenCallback(Evas_Object* obj);
+ void setLayout(Evas_Object* newBuffer);
+ void unsetLayout(Evas_Object* currentBuffer);
// Private data
- std::string m_packagePath;
- int m_handle;
- std::string m_name;
+ std::string m_tizenId;
+ DPL::OptionalUInt m_appControlIndex;
+
bool m_launched;
+ bool m_initializing;
bool m_initialized;
- int m_sdkLauncherPid;
bool m_debugMode;
- bundle *m_bundle;
- unsigned short m_debuggerPort;
- bool m_developerMode;
- bool m_complianceMode;
- std::string m_complianceIMEI;
- std::string m_complianceMEID;
- size_t m_numPluginsToInstall;
ReturnStatus::Type m_returnStatus;
- bool m_startupPluginInstallation;
-};
+ WRT::RunnableWidgetObjectPtr m_widget;
+ WrtDB::WidgetDAOReadOnlyPtr m_dao;
+ WidgetSettingListPtr m_settingList;
+ WidgetState m_widgetState;
+ std::unique_ptr<WindowData> m_windowData;
+ std::unique_ptr<SplashScreenSupport> m_splashScreen;
+ std::string m_initialViewMode;
+ std::string m_currentViewMode;
+ bool m_isWebkitFullscreen;
+ bool m_isFullscreenByPlatform;
-struct WrtClientUserData
-{
- WrtClient *This;
- unsigned long *pid;
- int portnum;
- bool debugMode;
-
- WrtClientUserData() :
- This(NULL),
- pid(NULL),
- portnum(-1),
- debugMode(false)
- {
- }
-
- WrtClientUserData(WrtClient *currentClient,
- unsigned long *pidNum,
- int portNum,
- bool currentDebugMode) :
- This(currentClient),
- pid(pidNum),
- portnum(portNum),
- debugMode(currentDebugMode)
- {
- }
+ std::unique_ptr<ClientModule::SubmodeSupport> m_submodeSupport;
};
#endif // WRT_CLIENT_H