diff options
Diffstat (limited to 'lib/common/Ui')
-rw-r--r-- | lib/common/Ui/Genlist/Genlist.cpp | 56 | ||||
-rw-r--r-- | lib/common/Ui/Genlist/Item.cpp | 92 | ||||
-rw-r--r-- | lib/common/Ui/Genlist/include/Genlist.h | 57 | ||||
-rw-r--r-- | lib/common/Ui/Genlist/include/Item.h | 123 | ||||
-rw-r--r-- | lib/common/Ui/Widget.cpp | 50 | ||||
-rw-r--r-- | lib/common/Ui/include/Widget.h | 56 |
6 files changed, 0 insertions, 434 deletions
diff --git a/lib/common/Ui/Genlist/Genlist.cpp b/lib/common/Ui/Genlist/Genlist.cpp deleted file mode 100644 index 5a9b779..0000000 --- a/lib/common/Ui/Genlist/Genlist.cpp +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2012-2013 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.1 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://floralicense.org/license/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "Genlist.h" -#include "phone.h" - -namespace Ui -{ - namespace Genlist - { - bool Genlist::create(Evas_Object *parent) - { - PH_TRACE; - if(parent && !getObject()) - { - return setObject(elm_genlist_add(parent)); - } - else - { - return false; - } - } - - Elm_Object_Item * Genlist::append(Item *item, Elm_Object_Item *parent) - { - PH_TRACE; - check_if(!item, return NULL); - Elm_Object_Item *objItem = elm_genlist_item_append(getObject(), item->getClass(), item, parent, item->getType(), onItemSelect, item); - return objItem; - } - - void Genlist::onItemSelect(void *data, Evas_Object *obj, void *event_info) - { - PH_TRACE; - if(data && event_info) - { - Item *item = static_cast<Item *>(data); - Elm_Object_Item *objItem = static_cast<Elm_Object_Item *>(event_info); - item->onSelect(*objItem); - } - } - } -} diff --git a/lib/common/Ui/Genlist/Item.cpp b/lib/common/Ui/Genlist/Item.cpp deleted file mode 100644 index c43982f..0000000 --- a/lib/common/Ui/Genlist/Item.cpp +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright 2012-2013 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.1 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://floralicense.org/license/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "Item.h" -#include "phone.h" - -namespace Ui -{ - namespace Genlist - { - Item::Item(Elm_Genlist_Item_Type type) - : m_Type(type) - { - PH_TRACE; - } - - Item::~Item() - { - PH_TRACE; - } - - Elm_Genlist_Item_Class * Item::createClass(const char *style, const char *decorateStyle, const char *editStyle) - { - PH_TRACE; - Elm_Genlist_Item_Class *itemClass = elm_genlist_item_class_new(); - check_if(!itemClass, return NULL); - itemClass->item_style = style; - itemClass->decorate_item_style = decorateStyle; - itemClass->decorate_all_item_style = editStyle; - itemClass->func.text_get = Item::getText; - itemClass->func.content_get = Item::getContent; - itemClass->func.state_get = Item::getState; - itemClass->func.del = Item::onDestroy; - return itemClass; - } - - char * Item::getText(void *data, Evas_Object *obj, const char *part) - { - PH_TRACE; - if(data) - { - return static_cast<Item *>(data)->getText(part); - } - - return NULL; - } - - Evas_Object * Item::getContent(void *data, Evas_Object *obj, const char *part) - { - PH_TRACE; - if(data) - { - return static_cast<Item *>(data)->getContent(part, obj); - } - - return NULL; - } - - Eina_Bool Item::getState(void *data, Evas_Object *obj, const char *part) - { - PH_TRACE; - if(data) - { - return static_cast<Item *>(data)->getState(part); - } - - return EINA_FALSE; - } - - void Genlist::Item::onDestroy(void *data, Evas_Object *obj) - { - PH_TRACE; - if(data) - { - delete static_cast<Item *>(data); - } - } - } -} diff --git a/lib/common/Ui/Genlist/include/Genlist.h b/lib/common/Ui/Genlist/include/Genlist.h deleted file mode 100644 index a3df78d..0000000 --- a/lib/common/Ui/Genlist/include/Genlist.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2012-2013 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.1 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://floralicense.org/license/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef __UI_GENLIST_GENLIST_H__ -#define __UI_GENLIST_GENLIST H__ - -#include "Widget.h" -#include "Item.h" - -namespace Ui -{ - namespace Genlist - { - /* - * \par Description: - * Genlist wrapper class. - */ - class Genlist : public Widget - { - public: - /* - * \par Description: - * Create new genlist with @p parent as parent. - * - * @see Widget::create - */ - bool create(Evas_Object *parent); - - /* - * \par Description: - * Add item to the end of genlist. - * - * @return A handle to the item added or @c NULL if not possible - * @see elm_genlist_item_append - */ - Elm_Object_Item * append(Item *item, Elm_Object_Item *parent = NULL); - - private: - static void onItemSelect(void *data, Evas_Object *obj, void *event_info); - }; - } -} - -#endif /* __UI_GENLIST_GENLIST_H__ */ diff --git a/lib/common/Ui/Genlist/include/Item.h b/lib/common/Ui/Genlist/include/Item.h deleted file mode 100644 index 28876ea..0000000 --- a/lib/common/Ui/Genlist/include/Item.h +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Copyright 2012-2013 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.1 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://floralicense.org/license/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef __UI_GENLIST_ITEM_H__ -#define __UI_GENLIST_ITEM_H__ - -#include <Elementary.h> -#include "NonCopyable.h" - -namespace Ui -{ - namespace Genlist - { - /* - * \par Description: - * Wrapper class for genlist item. Redirects item's callbacks to virtual methods. - * Any instance of this class should be allocated with operator new. - * It will be automatically deleted by genlist when item is deleted. - */ - class Item : public Utils::NonCopyable - { - public: - Item(Elm_Genlist_Item_Type type = ELM_GENLIST_ITEM_NONE); - virtual ~Item(); - - /* - * \par Description: - * Returned value should be individual for every derived class. - * This can be achieved by storing pointer to Elm_Genlist_Item_Class - * in a static variable inside overloaded method and initializing it using createClass. - * This way every derived class will have its own Elm_Genlist_Item_Class. - * - * @par example - * @code - * - * Elm_Genlist_Item_Class * getClass() const - * { - * static Elm_Genlist_Item_Class *itemClass = createClass("2text.1icon"); - * return itemClass; - * } - * - * @endcode - */ - virtual Elm_Genlist_Item_Class * getClass() const = 0; - - /* - * \par Description: - * Called whenever any item's text part needs to be updated. - * - * @param[in] part Name of the part - * @return Allocated string with text for a specified part, - * it will be deallocated with free() by genlist - */ - virtual char * getText(const char *part) const { return NULL; } - - /* - * \par Description: - * Called whenever any item's content part needs to be updated. - * - * @param[in] part Name of the part - * @param[in] parent Parent genlist to use as a parent object for content - * @return Content for a specified part - */ - virtual Evas_Object * getContent(const char *part, Evas_Object *parent) const { return NULL; } - - /* - * \par Description: - * Called whenever any item's state part needs to be updated. - * Genlist will emit signal "elm,state,x,active" or "elm,state,x,passive" - * with part's name instead of 'x'. - * - * @param[in] part Name of the part - * @return true for active, false for passive - * - */ - virtual bool getState(const char *part) const { return false; } - - /* - * \par Description: - * Called when selection event occurs on the item. - * - * @param item Elm_Object_Item for selected item - */ - virtual void onSelect(Elm_Object_Item &item) { } - - /* - * @return Item type - * @see Elm_Genlist_Item_Type - */ - Elm_Genlist_Item_Type getType() const { return m_Type; } - - protected: - static Elm_Genlist_Item_Class * createClass( - const char *style, - const char *decorateStyle = NULL, - const char *editStyle = NULL - ); - - private: - Elm_Genlist_Item_Type m_Type; - - static char * getText(void *data, Evas_Object *obj, const char *part); - static Evas_Object * getContent(void *data, Evas_Object *obj, const char *part); - static Eina_Bool getState(void *data, Evas_Object *obj, const char *part); - static void onDestroy(void *data, Evas_Object *obj); - }; - } -} - -#endif /* __UI_GENLIST_ITEM_H__ */ diff --git a/lib/common/Ui/Widget.cpp b/lib/common/Ui/Widget.cpp deleted file mode 100644 index 92b2b60..0000000 --- a/lib/common/Ui/Widget.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2012-2013 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.1 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://floralicense.org/license/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "Widget.h" -#include "phone.h" - -namespace Ui -{ - Widget::Widget() - : m_Object(NULL) - { - PH_TRACE; - } - - Widget::~Widget() - { - PH_TRACE; - if(m_Object) - { - evas_object_del(m_Object); - m_Object = NULL; - } - } - - Evas_Object * Widget::getObject() const - { - PH_TRACE; - return m_Object; - } - - bool Widget::setObject(Evas_Object *object) - { - PH_TRACE; - m_Object = object; - return m_Object != NULL; - } -} diff --git a/lib/common/Ui/include/Widget.h b/lib/common/Ui/include/Widget.h deleted file mode 100644 index 9e712f3..0000000 --- a/lib/common/Ui/include/Widget.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2012-2013 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.1 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://floralicense.org/license/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef __UI_WIDGET_H__ -#define __UI_WIDGET_H__ - -#include <Elementary.h> - -#include "NonCopyable.h" - -namespace Ui -{ - /* - * \par Description: - * Base wrapper class for all Evas objects. - */ - class Widget : public Utils::NonCopyable - { - public: - virtual ~Widget(); - - /* - * \par Description create derived widget with @p parent as parent. - * - * @return true on success, false otherwise - */ - virtual bool create(Evas_Object *parent) = 0; - - /* - * @return Underlying Evas_Object. - */ - Evas_Object * getObject() const; - - protected: - Widget(); - bool setObject(Evas_Object *object); - - private: - Evas_Object *m_Object; - }; -} - -#endif /* __UI_WIDGET_H__ */ |