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);
};
}
namespace efl_viewmanager
{
-class ui_base_viewmgr;
class ui_base_view;
class ui_base_overlay: public ui_iface_overlay
*/
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);
* @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);
};
}
#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"
#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
{
*/
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.
*
/** @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.
*/
* @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_ */
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);
};
}
*/
ui_view_indicator get_indicator();
- void on_back();
+ virtual void on_back();
protected:
#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; \
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;
*/
#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
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);
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)
{
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))
{
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();
+}
*/
#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);
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);
}
}
return elm_win_rotation_get(viewmgr->get_window());
}
+
* 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];
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",
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;
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;
//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;
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;
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;
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);
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
//FIXME: Window is destroyed. Terminate Application!
//ui_app_exit();
},
- this);
+ this->viewmgr);
//FIXME: Make conformant configurable?
if (!this->create_conformant(this->win))
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);
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);
}
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;
}
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;
}
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;
}
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;
}
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);
{
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);
+}
#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;
+}
/***********************************************************************************************/
/* Internal class Implementation */
/***********************************************************************************************/
-namespace ui_viewmanager {
+namespace ui_viewmanager
+{
class ui_iface_view_impl
{
/***********************************************************************************************/
/* Internal class Implementation */
/***********************************************************************************************/
-namespace ui_viewmanager {
+namespace ui_viewmanager
+{
class ui_iface_viewmgr_impl
{