sort out public/internal apis. 10/68110/3
authorHermet Park <hermet@hermet.pe.kr>
Mon, 2 May 2016 08:41:09 +0000 (17:41 +0900)
committerHermet Park <hermet@hermet.pe.kr>
Mon, 2 May 2016 13:36:53 +0000 (22:36 +0900)
Change-Id: Iad050a5570e6119fd325994d84b26e22e597019b
target: ui_iface_overlay.

15 files changed:
src/include/efl/ui_base_key_listener.h
src/include/efl/ui_base_overlay.h
src/include/efl/ui_base_view.h
src/include/efl/ui_base_viewmanager.h
src/include/efl/ui_base_viewmgr.h
src/include/interface/ui_iface_overlay.h
src/include/interface/ui_iface_view.h
src/include/interface/ui_iface_viewmanager.h
src/lib/efl/mobile/ui_key_listener.cpp
src/lib/efl/ui_base_key_listener.cpp
src/lib/efl/ui_base_view.cpp
src/lib/efl/ui_base_viewmgr.cpp
src/lib/interface/ui_iface_overlay.cpp
src/lib/interface/ui_iface_view.cpp
src/lib/interface/ui_iface_viewmgr.cpp

index cc0849d8755b523baed9502f0f495f6bdeb0258b..05f6a214b97d05d131431da4c474fa621b4b743e 100644 (file)
 
 namespace efl_viewmanager
 {
+
 class ui_base_viewmgr;
-class ui_base_view;
 
 class ui_base_key_listener
 {
-protected:
-       ui_base_viewmgr *viewmgr;
-       Evas_Object *key_grabber;
-
 public:
        ui_base_key_listener(ui_base_viewmgr *viewmgr);
-       virtual ~ui_base_key_listener() {}
+       virtual ~ui_base_key_listener();
 
        virtual bool init();
        virtual bool term();
        virtual void extend_event_proc(ui_base_view *view, Evas_Event_Key_Down *ev) {}
 
-       ui_base_viewmgr *get_viewmgr() { return this->viewmgr; }
+       ui_base_viewmgr *get_viewmgr();
+
+protected:
+       Evas_Object *get_keygrab_obj();
+
+private:
+       _UI_DECLARE_PRIVATE_IMPL(ui_base_key_listener);
+       _UI_DISABLE_COPY_AND_ASSIGN(ui_base_key_listener);
 };
 
 }
index ee0fb750e79ae660d1ceabd7a98ee1f2b5f4e54c..f369c50bf235f5b0dc8b039db04af4728221d7e5 100644 (file)
@@ -20,7 +20,6 @@
 namespace efl_viewmanager
 {
 
-class ui_base_viewmgr;
 class ui_base_view;
 
 class ui_base_overlay: public ui_iface_overlay
index 2f41438d802b0260b4ce00fbbce3b2f1d30a255d..3afdbb722683f826037ca39f1d522e20b1b81ca9 100644 (file)
@@ -34,29 +34,6 @@ namespace efl_viewmanager
  */
 class ui_base_view: public ui_iface_view
 {
-       friend class ui_base_viewmgr;
-
-protected:
-       /** @brief Get a parent object of view.
-        *
-        *  @note This is calling viewmgr get_base() method internally.
-        *
-        *  @return base layout of viewmgr.
-        */
-       Evas_Object *get_parent();
-
-       /** @brief toggle event block.
-        *
-        *  @note It makes internal conformant event freeze during effect showing.
-        *
-        *  @param block @c true, when blocking is enabled, otherwise @c false.
-        */
-       virtual void set_event_block(bool block);
-
-       virtual void on_rotate(int degree);
-       virtual void on_portrait();
-       virtual void on_landscape();
-
 public:
        ///Constructor.
        ui_base_view(const char *name = NULL);
@@ -93,6 +70,32 @@ public:
         *  @return Current rotation degree, -1 if it fails to get degree information.
         */
        virtual int get_degree();
+
+protected:
+       /** @brief Get a parent object of view.
+        *
+        *  @note This is calling viewmgr get_base() method internally.
+        *
+        *  @return base layout of viewmgr.
+        */
+       Evas_Object *get_parent();
+
+       /** @brief toggle event block.
+        *
+        *  @note It makes internal conformant event freeze during effect showing.
+        *
+        *  @param block @c true, when blocking is enabled, otherwise @c false.
+        */
+       virtual void set_event_block(bool block);
+
+       virtual void on_rotate(int degree);
+       virtual void on_portrait();
+       virtual void on_landscape();
+
+private:
+       _UI_DECLARE_PRIVATE_IMPL(ui_base_view);
+       _UI_DISABLE_COPY_AND_ASSIGN(ui_base_view);
+       _UI_DECLARE_FRIENDS(ui_base_viewmgr);
 };
 
 }
index f03c71178f0f2580a3fbd6e97f8ab27eac49bf97..6b5f37e3202b1993619680ca563ef398bc3fb09b 100644 (file)
 #ifndef _UI_BASE_VIEWMANAGER_H_
 #define _UI_BASE_VIEWMANAGER_H_
 
+//FIXME: ??
+#ifndef Elm_Conformant
+#define Elm_Conformant Evas_Object
+#endif
+
 #include "../interface/ui_iface_viewmanager.h"
 #include "ui_base_overlay.h"
 #include "ui_base_key_listener.h"
index 55e697f3fba98116e67fff852e202123bbcd36ec..54a67314d06b815447843714ef1309fa03842274 100644 (file)
 #ifndef _UI_BASE_VIEWMGR_H_
 #define _UI_BASE_VIEWMGR_H_
 
-#include <map>
-#include <string>
-
-using namespace std;
-
-//FIXME: ??
-#ifndef Elm_Conformant
-#define Elm_Conformant Evas_Object
-#endif
-
 namespace efl_viewmanager
 {
 
@@ -45,80 +35,7 @@ class ui_base_view;
  */
 class ui_base_viewmgr: public ui_iface_viewmgr
 {
-       friend class ui_base_view;
-
-private:
-       Elm_Win *win;                                      //This is acting like a base object of viewmgr.
-       Elm_Conformant *conform;                   //Conformant for viewmgr.
-       Elm_Scroller *scroller;                    //Scroller for viewmgr.
-       Elm_Layout *layout;                        //Viewmgr's base layout.
-       ui_base_key_listener *key_listener;        //HW Key Handler such as "BACK" key...
-       ui_view_indicator indicator;               //Mode of indicator.
-       string transition_style;                   //Current transition effect style name
-       map<string, Elm_Layout *> effect_map;      //Map for effect layouts.
-
-       Elm_Layout *set_transition_layout(string transition_style);
-
-       /**
-        *  @brief Create a conformant.
-        *
-        *  @param win viewmgr's window object. this will be parent of conformant object.
-        *
-        *  @return @c true success or @c false not.
-        */
-       bool create_conformant(Elm_Win *win);
-
-       /**
-        *  @brief Create a Scroller.
-        *
-        *  @param conform viewmgr's conformant object. this will be parent of layout object.
-        *
-        *  @note We add a scroller for an exceptional case. If user view content is larger than window,
-        *        then the content will be automatically scrollable by this scroller.
-        *        For instance, if the virtual keypad is enabled in the landscape mode,
-        *        the content area would be smaller than content minimum size.
-        *        We could avoid clipping the content by scroller.
-        *
-        *  @return @c true success or @c false not.
-        */
-
-       bool create_scroller(Elm_Conformant *conform);
-       /**
-        *  @brief Create a base layout.
-        *
-        *  @param scroller viewmgr's scroller object. this will be parent of layout object.
-        *  @param style view's transition effect style.
-        *
-        *  @return @c true success or @c false not.
-        */
-       bool create_base_layout(Elm_Scroller *scroller, const char *style);
-
-       /** @brief Set the indicator mode.
-        *
-        *  @param indicator The mode to set, one of #ui_view_indicator.
-        */
-       bool set_indicator(ui_view_indicator indicator);
-
-       void activate_top_view();
-
-protected:
-       ui_base_viewmgr(const char *pkg, ui_base_key_listener *key_listener);
-
-       ///Constructor.
-       ui_base_viewmgr(const char *pkg);
-       ///Destructor.
-       virtual ~ui_base_viewmgr();
-
-       /** @brief Get a base layout of viewmgr.
-        */
-       Evas_Object *get_base()
-       {
-               return this->layout;
-       }
-
-
 public:
-
        /**
         *  @brief Activate this view manager.
         *
@@ -203,17 +120,11 @@ public:
 
        /** @brief Get a window object of viewmgr.
         */
-       Elm_Win *get_window()
-       {
-               return this->win;
-       }
+       Elm_Win *get_window();
 
        /** @brief Get a conformant object of viewmgr.
         */
-       Elm_Conformant *get_conformant()
-       {
-               return this->conform;
-       }
+       Elm_Conformant *get_conformant();
 
        /** @brief Get a last view of current view stack.
         */
@@ -234,7 +145,26 @@ public:
         *  @see get_view_count()
         */
        ui_base_view *get_view(unsigned int idx);
+
+       /** @brief Get a base layout of viewmgr.
+        */
+       Evas_Object *get_base();
+
+protected:
+       bool set_indicator(ui_view_indicator indicator);
+
+       ///Constructor
+       ui_base_viewmgr(const char *pkg, ui_base_key_listener *key_listener);
+       ui_base_viewmgr(const char *pkg);
+       ///Destructor.
+       virtual ~ui_base_viewmgr();
+
+private:
+       _UI_DECLARE_PRIVATE_IMPL(ui_base_viewmgr);
+       _UI_DISABLE_COPY_AND_ASSIGN(ui_base_viewmgr);
+       _UI_DECLARE_FRIENDS(ui_base_view);
 };
+
 }
 
 #endif /* _UI_BASE_VIEWMGR_H_ */
index 9493a2e1860c15fd3949bc7e5fa0b8158c9f1eec..e3d0544b7eed12f73c9758c25460478e6468bb66 100644 (file)
@@ -27,20 +27,21 @@ class ui_iface_overlay: public ui_iface_rotatable
 public:
        virtual bool set_content(T content);
        virtual T unset_content();
+       virtual void on_back();
+       virtual bool activate();
+       virtual bool deactivate();
+       virtual bool is_activated();
+
        ui_iface_view *get_view();
        virtual T get_content();
-       virtual void on_back();
-       virtual bool activate() = 0;
-       virtual bool deactivate() = 0;
-       virtual bool is_activated() = 0;
 
 protected:
        ui_iface_overlay(ui_iface_view *view);
        virtual ~ui_iface_overlay();
 
 private:
-       ui_iface_view *view;
-       T content;
+       _UI_DECLARE_PRIVATE_IMPL(ui_iface_overlay);
+       _UI_DISABLE_COPY_AND_ASSIGN(ui_iface_overlay);
 };
 
 }
index 00e862c6542c7e1ce3d8a1b3724c40f189b9c5eb..e219c9bd9aeb1eff555799a7a3899c9692a3bbae 100644 (file)
@@ -140,7 +140,7 @@ public:
         */
        ui_view_indicator get_indicator();
 
-       void on_back();
+       virtual void on_back();
 
 protected:
 
index bb8f2dc12113c377cd685a4f7a35b863f1858612..592e93e35608feedc771f8efb5bd14b7d4c95daf 100644 (file)
@@ -54,7 +54,8 @@ enum ui_view_state
 #define LOG_TAG "UI_VIEWMGR"
 
 #define _UI_DECLARE_FRIENDS(A) \
-       friend class A##_impl
+       friend class A##_impl; \
+       friend class A
 
 #define _UI_DECLARE_PRIVATE_IMPL(A) \
        class A##_impl *impl; \
index 201127136bec1823419523baf66caf5c056bc8a7..fe1849a0b60db50959faf1f56d23cc7575d9882d 100644 (file)
@@ -37,13 +37,13 @@ void ui_key_listener::extend_event_proc(ui_base_view *view, Evas_Event_Key_Down
 bool ui_key_listener::init()
 {
        if (!ui_base_key_listener::init()) return false;
-       if (!evas_object_key_grab(this->key_grabber, KEY_MENU, 0, 0, EINA_FALSE))
+       if (!evas_object_key_grab(this->get_keygrab_obj(), KEY_MENU, 0, 0, EINA_FALSE))
        {
                LOGE("Failed to grab MENU KEY(%s)\n", KEY_MENU);
                return false;
        }
 
-       if (!evas_object_key_grab(this->key_grabber, KEY_MENU2, 0, 0, EINA_FALSE))
+       if (!evas_object_key_grab(this->get_keygrab_obj(), KEY_MENU2, 0, 0, EINA_FALSE))
        {
                LOGE("Failed to grab MENU KEY(%s)\n", KEY_MENU2);
                return false;
index 19d29d669739a73b11a41782dc2625828b7bf823..81b924e74c74286144e32a05b67f49ffc5366e3b 100644 (file)
  */
 #include "../../include/efl/ui_base_viewmanager.h"
 
-static const char *KEY_BACK = "XF86Back";
-static const char *KEY_BACK2 = "XF86Stop";
-
-ui_base_key_listener::ui_base_key_listener(ui_base_viewmgr *viewmgr)
-               : viewmgr(viewmgr), key_grabber(NULL)
+/***********************************************************************************************/
+/* Internal class Implementation                                                               */
+/***********************************************************************************************/
+namespace efl_viewmanager
 {
-
+class ui_base_key_listener_impl
+{
+protected:
+       ui_base_key_listener *key_listener;
+       ui_base_viewmgr *viewmgr;
+       Evas_Object *key_grabber;
+
+public:
+       ui_base_key_listener_impl(ui_base_key_listener *key_listener, ui_base_viewmgr *viewmgr);
+       ~ui_base_key_listener_impl() {}
+
+       bool init();
+       bool term();
+       ui_base_viewmgr *get_viewmgr() { return this->viewmgr; }
+       Evas_Object *get_keygrab_obj() { return this->key_grabber; }
+};
 }
 
+static const char *KEY_BACK = "XF86Back";
+static const char *KEY_BACK2 = "XF86Stop";
+
 static void event_proc(ui_base_key_listener *key_listener, Evas_Event_Key_Down *ev)
 {
        //Only if view manager is activated
@@ -32,7 +49,7 @@ static void event_proc(ui_base_key_listener *key_listener, Evas_Event_Key_Down *
        if (!viewmgr->is_activated()) return;
 
        //Get Top View
-       ui_base_view *view = dynamic_cast<ui_base_view *>(viewmgr->get_last_view());
+       ui_base_view *view = viewmgr->get_last_view();
        if (!view) return;
 
        key_listener->extend_event_proc(view, ev);
@@ -42,13 +59,19 @@ static void event_proc(ui_base_key_listener *key_listener, Evas_Event_Key_Down *
        view->on_back();
 }
 
-bool ui_base_key_listener::term()
+ui_base_key_listener_impl::ui_base_key_listener_impl(ui_base_key_listener *key_listener, ui_base_viewmgr *viewmgr)
+               : key_listener(key_listener), viewmgr(viewmgr), key_grabber(NULL)
+{
+
+}
+
+bool ui_base_key_listener_impl::term()
 {
        evas_object_del(this->key_grabber);
        return true;
 }
 
-bool ui_base_key_listener::init()
+bool ui_base_key_listener_impl::init()
 {
        if (!this->viewmgr)
        {
@@ -75,7 +98,7 @@ bool ui_base_key_listener::init()
                Evas_Event_Key_Down *ev = static_cast<Evas_Event_Key_Down *>(event_info);
                ui_base_key_listener *key_listener = static_cast<ui_base_key_listener *>(data);
                event_proc(key_listener, ev);
-       }, this);
+       }, this->key_listener);
 
        if (!evas_object_key_grab(key_grab_rect, KEY_BACK, 0, 0, EINA_FALSE))
        {
@@ -95,3 +118,39 @@ bool ui_base_key_listener::init()
 
        return true;
 }
+
+
+/***********************************************************************************************/
+/* External class Implementation                                                               */
+/***********************************************************************************************/
+
+ui_base_key_listener::ui_base_key_listener(ui_base_viewmgr *viewmgr)
+{
+       this->impl = new ui_base_key_listener_impl(this, viewmgr);
+}
+
+ui_base_key_listener::~ui_base_key_listener()
+{
+       delete(this->impl);
+}
+
+bool ui_base_key_listener::term()
+{
+       return this->impl->term();
+}
+
+bool ui_base_key_listener::init()
+{
+       return this->impl->init();
+}
+
+Evas_Object *ui_base_key_listener::get_keygrab_obj()
+{
+       return this->impl->get_keygrab_obj();
+}
+
+
+ui_base_viewmgr *ui_base_key_listener::get_viewmgr()
+{
+       return this->impl->get_viewmgr();
+}
index 51c6a4ef44f18ce34cdb7829eda61023a07e3c70..b5f8759728a769516366f53c8ccfa9820579f125 100644 (file)
  */
 #include "../../include/efl/ui_base_viewmanager.h"
 
+
+/***********************************************************************************************/
+/* Internal class Implementation                                                               */
+/***********************************************************************************************/
+namespace efl_viewmanager
+{
+class ui_base_view_impl;
+}
+
+/***********************************************************************************************/
+/* External class Implementation                                                               */
+/***********************************************************************************************/
+
 static void content_del_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
 {
        ui_base_view *view = static_cast<ui_base_view *>(data);
@@ -93,7 +106,7 @@ void ui_base_view::set_indicator(ui_view_indicator indicator)
 
        if (!viewmgr->is_activated()) return;
 
-       if (dynamic_cast<ui_base_view *>(viewmgr->get_last_view()) != this) return;
+       if (viewmgr->get_last_view() != this) return;
 
        viewmgr->set_indicator(indicator);
 }
@@ -126,3 +139,4 @@ int ui_base_view::get_degree()
        }
        return elm_win_rotation_get(viewmgr->get_window());
 }
+
index 71ed03da0dc681fafecda85ee53ec78045c7753e..c8d52a0f0b233f393946783b2094a13faca0d382 100644 (file)
  *  limitations under the License.
  *
  */
+
+#include <map>
+#include <string>
 #include "../../include/efl/ui_base_viewmanager.h"
 
-bool ui_base_viewmgr::create_base_layout(Elm_Scroller *scroller, const char *style)
+using namespace std;
+
+/***********************************************************************************************/
+/* Internal class Implementation                                                               */
+/***********************************************************************************************/
+namespace efl_viewmanager
+{
+
+class ui_base_viewmgr_impl
+{
+       friend class ui_base_viewmgr;
+
+private:
+       ui_base_viewmgr *viewmgr;
+       Elm_Win *win;                                      //This is acting like a base object of viewmgr.
+       Elm_Conformant *conform;                   //Conformant for viewmgr.
+       Elm_Scroller *scroller;                    //Scroller for viewmgr.
+       Elm_Layout *layout;                        //Viewmgr's base layout.
+       ui_base_key_listener *key_listener;        //HW Key Handler such as "BACK" key...
+       ui_view_indicator indicator;               //Mode of indicator.
+       string transition_style;                   //Current transition effect style name
+       map<string, Elm_Layout *> effect_map;      //Map for effect layouts.
+
+       Elm_Layout *set_transition_layout(string transition_style);
+
+       bool create_conformant(Elm_Win *win);
+       bool create_scroller(Elm_Conformant *conform);
+       bool create_base_layout(Elm_Scroller *scroller, const char *style);
+       bool set_indicator(ui_view_indicator indicator);
+       void activate_top_view();
+       bool init();
+       bool term();
+
+public:
+       ui_base_viewmgr_impl(ui_base_viewmgr *viewmgr, const char *pkg, ui_base_key_listener *key_listener);
+       ~ui_base_viewmgr_impl();
+
+       bool activate();
+       bool deactivate();
+       ui_base_view *push_view(ui_base_view *view);
+       bool pop_view();
+       bool insert_view_before(ui_base_view *view, ui_base_view *before);
+       bool insert_view_after(ui_base_view *view, ui_base_view *after);
+
+       Evas_Object *get_base()
+       {
+               return this->layout;
+       }
+       Elm_Win *get_window()
+       {
+               return this->win;
+       }
+       Elm_Conformant *get_conformant()
+       {
+               return this->conform;
+       }
+};
+
+}
+
+bool ui_base_viewmgr_impl::create_base_layout(Elm_Scroller *scroller, const char *style)
 {
        char edj_path[PATH_MAX];
        char group_name[128];
@@ -41,7 +104,7 @@ bool ui_base_viewmgr::create_base_layout(Elm_Scroller *scroller, const char *sty
                                if (pview) viewmgr->push_view_finished(pview);
                                if (view) viewmgr->push_view_finished(view);
                        },
-                       this);
+                       this->viewmgr);
 
        //Pop Finished Event
        elm_layout_signal_callback_add(layout, "pop,finished", "viewmgr",
@@ -53,14 +116,14 @@ bool ui_base_viewmgr::create_base_layout(Elm_Scroller *scroller, const char *sty
                                if (pview) viewmgr->pop_view_finished(pview);
                                if (view) viewmgr->pop_view_finished(view);
                        },
-                       this);
+                       this->viewmgr);
 
        this->layout = layout;
 
        return true;
 }
 
-Elm_Layout *ui_base_viewmgr::set_transition_layout(string transition_style)
+Elm_Layout *ui_base_viewmgr_impl::set_transition_layout(string transition_style)
 {
        Elm_Layout *effect_layout = NULL;
        Elm_Layout *pcontent;
@@ -97,12 +160,12 @@ Elm_Layout *ui_base_viewmgr::set_transition_layout(string transition_style)
        return this->layout;
 }
 
-void ui_base_viewmgr::activate_top_view()
+void ui_base_viewmgr_impl::activate_top_view()
 {
        Evas_Object *pcontent = elm_object_part_content_unset(this->get_base(), "content");
        if (pcontent) evas_object_hide(pcontent);
 
-       ui_base_view *view = this->get_last_view();
+       ui_base_view *view = this->viewmgr->get_last_view();
 
        //In case of ui_base_view, it doesn't have any base form. It uses viewmgr base instead.
        Evas_Object *content;
@@ -122,7 +185,7 @@ void ui_base_viewmgr::activate_top_view()
 
 //FIXME: How to deal with indicator in other UI framework? Dali? Volt?
 //Is it possible make this interface common?
-bool ui_base_viewmgr::set_indicator(ui_view_indicator indicator)
+bool ui_base_viewmgr_impl::set_indicator(ui_view_indicator indicator)
 {
        if (this->indicator == indicator) return false;
        this->indicator = indicator;
@@ -154,7 +217,7 @@ bool ui_base_viewmgr::set_indicator(ui_view_indicator indicator)
        return true;
 }
 
-bool ui_base_viewmgr::create_conformant(Elm_Win *win)
+bool ui_base_viewmgr_impl::create_conformant(Elm_Win *win)
 {
        Elm_Conformant *conform = elm_conformant_add(win);
        if (!conform) return false;
@@ -169,7 +232,7 @@ bool ui_base_viewmgr::create_conformant(Elm_Win *win)
        return true;
 }
 
-bool ui_base_viewmgr::create_scroller(Elm_Conformant *conform)
+bool ui_base_viewmgr_impl::create_scroller(Elm_Conformant *conform)
 {
        Elm_Scroller *scroller = elm_scroller_add(conform);
        if (!scroller) return false;
@@ -185,14 +248,15 @@ bool ui_base_viewmgr::create_scroller(Elm_Conformant *conform)
        return true;
 }
 
-ui_base_viewmgr::ui_base_viewmgr(const char *pkg, ui_base_key_listener *key_listener)
-               : ui_iface_viewmgr(), key_listener(key_listener), transition_style("default")
+ui_base_viewmgr_impl::ui_base_viewmgr_impl(ui_base_viewmgr *viewmgr, const char *pkg, ui_base_key_listener *key_listener)
+               : viewmgr(viewmgr), key_listener(key_listener), transition_style("default")
 {
        if (!pkg)
        {
                LOGE("Invalid package name");
                return;
        }
+
        //Window
        this->win = elm_win_util_standard_add(pkg, pkg);
 
@@ -223,8 +287,7 @@ ui_base_viewmgr::ui_base_viewmgr(const char *pkg, ui_base_key_listener *key_list
                                if (rot == 0 || rot == 180) view->on_portrait();
                                else view->on_landscape();
                        }
-                       , this);
-
+                       , this->viewmgr);
        //Window is requested to delete.
        evas_object_smart_callback_add(this->win, "delete,request",
                        [](void *data, Evas_Object *obj, void *event_info) -> void
@@ -234,7 +297,7 @@ ui_base_viewmgr::ui_base_viewmgr(const char *pkg, ui_base_key_listener *key_list
                                //FIXME: Window is destroyed. Terminate Application!
                                //ui_app_exit();
                        },
-                       this);
+                       this->viewmgr);
 
        //FIXME: Make conformant configurable?
        if (!this->create_conformant(this->win))
@@ -260,29 +323,29 @@ ui_base_viewmgr::ui_base_viewmgr(const char *pkg, ui_base_key_listener *key_list
        elm_win_indicator_opacity_set(this->win, ELM_WIN_INDICATOR_OPAQUE);
 
        elm_win_autodel_set(this->win, EINA_TRUE);
-
-       key_listener->init();
 }
 
-ui_base_viewmgr::ui_base_viewmgr(const char *pkg)
-               : ui_base_viewmgr(pkg, new ui_base_key_listener(this))
+ui_base_viewmgr_impl::~ui_base_viewmgr_impl()
 {
+       delete(this->key_listener);
 }
 
-ui_base_viewmgr::~ui_base_viewmgr()
+bool ui_base_viewmgr_impl::init()
 {
-       this->key_listener->term();
-       delete(this->key_listener);
+       return this->key_listener->init();
 }
 
-bool ui_base_viewmgr::activate()
+bool ui_base_viewmgr_impl::term()
 {
-       if (!ui_iface_viewmgr::activate()) return false;
+       return this->key_listener->term();
+}
 
+bool ui_base_viewmgr_impl::activate()
+{
        this->activate_top_view();
 
        //FIXME: Necessary??
-       ui_base_view *view = this->get_last_view();
+       ui_base_view *view = this->viewmgr->get_last_view();
        view->on_activate();
 
        evas_object_show(this->win);
@@ -290,14 +353,12 @@ bool ui_base_viewmgr::activate()
        return true;
 }
 
-bool ui_base_viewmgr::deactivate()
+bool ui_base_viewmgr_impl::deactivate()
 {
-       if (!ui_iface_viewmgr::deactivate()) return false;
-
        //FIXME: based on the profile, we should app to go behind or terminate.
        if (true)
        {
-               ui_base_view *view = this->get_last_view();
+               ui_base_view *view = this->viewmgr->get_last_view();
                if (view) view->on_deactivate();
                evas_object_lower(this->win);
        }
@@ -310,27 +371,16 @@ bool ui_base_viewmgr::deactivate()
        return true;
 }
 
-bool ui_base_viewmgr::pop_view()
+bool ui_base_viewmgr_impl::pop_view()
 {
-       if (this->get_view_count() == 1)
-       {
-               this->deactivate();
-               return true;
-       }
-
-       if(!ui_iface_viewmgr::pop_view())
-       {
-               return false;
-       }
-
-       ui_base_view *pview = this->get_view(this->get_view_count() - 2);
-       ui_base_view *view = this->get_last_view();
+       ui_base_view *pview = this->viewmgr->get_view(this->viewmgr->get_view_count() - 2);
+       ui_base_view *view = this->viewmgr->get_last_view();
 
        //In case, if view doesn't have transition effect
        if (!strcmp(view->get_transition_style(), "none"))
        {
-               this->pop_view_finished(pview);
-               this->pop_view_finished(view);
+               this->viewmgr->pop_view_finished(pview);
+               this->viewmgr->pop_view_finished(view);
                this->activate_top_view();
                return true;
        }
@@ -339,8 +389,8 @@ bool ui_base_viewmgr::pop_view()
        Elm_Layout *effect = this->set_transition_layout(view->get_transition_style());
        if (!effect) {
                LOGE("invalid effect transition style?! = %s", view->get_transition_style());
-               this->pop_view_finished(pview);
-               this->pop_view_finished(view);
+               this->viewmgr->pop_view_finished(pview);
+               this->viewmgr->pop_view_finished(view);
                this->activate_top_view();
                return true;
        }
@@ -359,26 +409,24 @@ bool ui_base_viewmgr::pop_view()
        return true;
 }
 
-ui_base_view * ui_base_viewmgr::push_view(ui_base_view *view)
+ui_base_view * ui_base_viewmgr_impl::push_view(ui_base_view *view)
 {
-       ui_iface_viewmgr::push_view(view);
-
-       if (!this->is_activated()) return view;
+       if (!this->viewmgr->is_activated()) return view;
 
        //In case, if viewmgr has one view, we skip effect.
-       if (this->get_view_count() == 1) {
+       if (this->viewmgr->get_view_count() == 1) {
                this->activate_top_view();
-               this->push_view_finished(view);
+               this->viewmgr->push_view_finished(view);
                return view;
        }
 
-       ui_base_view *pview = this->get_view(this->get_view_count() - 2);
+       ui_base_view *pview = this->viewmgr->get_view(this->viewmgr->get_view_count() - 2);
 
        //In case, if view doesn't have transition effect
        if (!strcmp(view->get_transition_style(), "none")) {
                this->activate_top_view();
-               this->push_view_finished(pview);
-               this->push_view_finished(view);
+               this->viewmgr->push_view_finished(pview);
+               this->viewmgr->push_view_finished(view);
                return view;
        }
 
@@ -387,8 +435,8 @@ ui_base_view * ui_base_viewmgr::push_view(ui_base_view *view)
        if (!effect) {
                LOGE("invalid effect transition style?! = %s", view->get_transition_style());
                this->activate_top_view();
-               this->push_view_finished(pview);
-               this->push_view_finished(view);
+               this->viewmgr->push_view_finished(pview);
+               this->viewmgr->push_view_finished(view);
                return view;
        }
 
@@ -406,6 +454,69 @@ ui_base_view * ui_base_viewmgr::push_view(ui_base_view *view)
        return view;
 }
 
+/***********************************************************************************************/
+/* External class Implementation                                                               */
+/***********************************************************************************************/
+
+ui_base_viewmgr::ui_base_viewmgr(const char *pkg, ui_base_key_listener *key_listener)
+               : ui_iface_viewmgr()
+{
+       this->impl = new ui_base_viewmgr_impl(this, pkg, key_listener);
+       this->impl->init();
+}
+
+ui_base_viewmgr::ui_base_viewmgr(const char *pkg)
+               : ui_base_viewmgr(pkg, new ui_base_key_listener(this))
+{
+}
+
+ui_base_viewmgr::~ui_base_viewmgr()
+{
+       this->impl->term();
+       delete(this->impl);
+}
+
+bool ui_base_viewmgr::activate()
+{
+       if (!ui_iface_viewmgr::activate()) return false;
+
+       this->impl->activate();
+
+       return true;
+}
+
+bool ui_base_viewmgr::deactivate()
+{
+       if (!ui_iface_viewmgr::deactivate()) return false;
+
+       this->impl->deactivate();
+
+       return true;
+}
+
+bool ui_base_viewmgr::pop_view()
+{
+       if (this->get_view_count() == 1)
+       {
+               this->deactivate();
+               return true;
+       }
+
+       if(!ui_iface_viewmgr::pop_view())
+       {
+               return false;
+       }
+
+       return this->impl->pop_view();
+}
+
+ui_base_view * ui_base_viewmgr::push_view(ui_base_view *view)
+{
+       ui_iface_viewmgr::push_view(view);
+
+       return this->impl->push_view(view);
+}
+
 bool ui_base_viewmgr::insert_view_before(ui_base_view *view, ui_base_view *before)
 {
        return ui_iface_viewmgr::insert_view_before(view, before);
@@ -425,3 +536,21 @@ ui_base_view *ui_base_viewmgr::get_last_view()
 {
        return dynamic_cast<ui_base_view *>(ui_iface_viewmgr::get_last_view());
 }
+
+Evas_Object *ui_base_viewmgr::get_base()
+{
+       return this->impl->get_base();
+}
+Elm_Win *ui_base_viewmgr::get_window()
+{
+       return this->impl->get_window();
+}
+Elm_Conformant *ui_base_viewmgr::get_conformant()
+{
+       return this->impl->get_conformant();
+}
+
+bool ui_base_viewmgr::set_indicator(ui_view_indicator indicator)
+{
+       return this->impl->set_indicator(indicator);
+}
index e65aa3cbf9710d6b1642f2b2a70524181545020f..a56da6ad598a0d86f5174f2b5d280a7648f39c7b 100644 (file)
 
 #include "../../include/interface/ui_iface_viewmanager.h"
 
-ui_iface_overlay::ui_iface_overlay(ui_iface_view *view)
-               : view(view), content(NULL)
+
+/***********************************************************************************************/
+/* Internal class Implementation                                                               */
+/***********************************************************************************************/
+namespace ui_viewmanager
+{
+
+class ui_iface_overlay_impl
+{
+       friend class ui_iface_overlay;
+
+private:
+       ui_iface_overlay *overlay;
+       ui_iface_view *view;
+       T content;
+
+public:
+       bool set_content(T content);
+       T unset_content();
+       ui_iface_view *get_view();
+       T get_content();
+
+       ui_iface_overlay_impl(ui_iface_overlay *overlay, ui_iface_view *view);
+       ~ui_iface_overlay_impl();
+};
+
+}
+
+ui_iface_overlay_impl::ui_iface_overlay_impl(ui_iface_overlay *overlay, ui_iface_view *view)
+               : overlay(overlay), view(view), content(NULL)
 {
 }
 
-ui_iface_overlay::~ui_iface_overlay()
+ui_iface_overlay_impl::~ui_iface_overlay_impl()
 {
 }
 
-bool ui_iface_overlay::set_content(T content)
+bool ui_iface_overlay_impl::set_content(T content)
 {
        this->content = content;
        return true;
 }
 
-T ui_iface_overlay::unset_content()
+T ui_iface_overlay_impl::unset_content()
 {
        T prev = this->content;
        this->content = NULL;
        return prev;
 }
 
-T ui_iface_overlay::get_content()
+T ui_iface_overlay_impl::get_content()
 {
        return this->content;
 }
 
-ui_iface_view *ui_iface_overlay::get_view()
+ui_iface_view *ui_iface_overlay_impl::get_view()
 {
        return this->view;
 }
 
+
+/***********************************************************************************************/
+/* External class Implementation                                                               */
+/***********************************************************************************************/
+ui_iface_overlay::ui_iface_overlay(ui_iface_view *view)
+{
+       this->impl = new ui_iface_overlay_impl(this, view);
+}
+
+ui_iface_overlay::~ui_iface_overlay()
+{
+       delete(this->impl);
+}
+
+bool ui_iface_overlay::set_content(T content)
+{
+       return this->impl->set_content(content);
+}
+
+T ui_iface_overlay::unset_content()
+{
+       return this->impl->unset_content();
+}
+
+T ui_iface_overlay::get_content()
+{
+       return this->impl->get_content();
+}
+
+ui_iface_view *ui_iface_overlay::get_view()
+{
+       return this->impl->get_view();
+}
+
 void ui_iface_overlay::on_back()
 {
        this->deactivate();
 }
+
+bool ui_iface_overlay::activate()
+{
+       return true;
+}
+
+bool ui_iface_overlay::deactivate()
+{
+       return true;
+}
+
+bool ui_iface_overlay::is_activated()
+{
+       return true;
+}
index a4d19a719176f4c28856e5dcaa882015f10c0f58..f62e27395da0deff7db11ad2f6e95504a257d013 100644 (file)
@@ -24,7 +24,8 @@ using namespace std;
 /***********************************************************************************************/
 /* Internal class Implementation                                                               */
 /***********************************************************************************************/
-namespace ui_viewmanager {
+namespace ui_viewmanager
+{
 
 class ui_iface_view_impl
 {
index 3cd008397df733472c41e8ccba5219ec6eb1411b..c092e0371b633241b0ccbc0d6ae4e3b0972e964e 100644 (file)
@@ -23,7 +23,8 @@ using namespace std;
 /***********************************************************************************************/
 /* Internal class Implementation                                                               */
 /***********************************************************************************************/
-namespace ui_viewmanager {
+namespace ui_viewmanager
+{
 
 class ui_iface_viewmgr_impl
 {