Merge branch working into tizen
[platform/framework/web/wrt.git] / src / wrt-client / wrt-client.h
index c2a6eae..18702d6 100644 (file)
@@ -16,6 +16,7 @@
 #ifndef WRT_CLIENT_H
 #define WRT_CLIENT_H
 
+#include <memory>
 #include <dpl/application.h>
 #include <dpl/generic_event.h>
 #include <dpl/event/controller.h>
 
 DECLARE_GENERIC_EVENT_0(NextStepEvent)
 
+namespace ClientModule {
+class SubmodeSupport;
+}
+
 class WrtClient :
     public DPL::Application,
     private DPL::Event::Controller<DPL::TypeListDecl<NextStepEvent>::Type>,
@@ -56,6 +61,7 @@ class WrtClient :
     ReturnStatus::Type   getReturnStatus() const;
     virtual void Quit();
     static std::string getTizenIdFromArgument(int argc, char **argv);
+    void autoRotationSetOrientation(Evas_Object* obj);
 
   protected:
     virtual void OnStop();
@@ -69,59 +75,83 @@ class WrtClient :
 
   private:
     void showHelpAndQuit();
-    bool checkArgument();
-    void setSdkLauncherDebugData();
-    bool checkDebugMode(SDKDebugData* debugData);
-    void connectElmCallback();
+    void setDebugMode(bundle* b);
     void initializeWindowModes();
 
     // Events
     virtual void OnEventReceived(const NextStepEvent& event);
 
     // UI callback
-    static void backButtonCallback(void* data,
-                                   Evas_Object* obj,
-                                   void* event_info);
-    // UI callback
     static void ExitCallback(void* data,
                                    Evas_Object* obj,
                                    void* event_info);                                  
-    // Low Memory Callback
+    // 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 setOrientationWindow();
-    void unsetOrientationWindow();
-    void setOrientationEwk();
+    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();
-    static int languageChangedCallback(void *data);
     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_tizenId;
-    DPL::OptionalUInt m_appControlIndex;
 
     bool m_launched;
     bool m_initializing;
     bool m_initialized;
-    int m_sdkLauncherPid;
     bool m_debugMode;
-    unsigned short m_debuggerPort;
     ReturnStatus::Type m_returnStatus;
     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;
+
+    std::unique_ptr<ClientModule::SubmodeSupport> m_submodeSupport;
 };
 
 #endif // WRT_CLIENT_H