- some more wrappers in Entry

- define const functions where possible


SVN revision: 79435
This commit is contained in:
Andreas Volz 2012-11-18 22:13:05 +00:00
parent ab56df9656
commit a20a205fff
4 changed files with 1359 additions and 25 deletions

File diff suppressed because it is too large Load Diff

View File

@ -65,7 +65,7 @@ public:
* *
* @ingroup Theme * @ingroup Theme
*/ */
Eflxx::CountedPtr <Einaxx::List<Theme*> > getOverlayList (); Eflxx::CountedPtr <Einaxx::List<Theme*> > getOverlayList () const;
/** /**
* Appends a theme extension to the list of extensions. * Appends a theme extension to the list of extensions.
@ -109,7 +109,7 @@ public:
* *
* @ingroup Theme * @ingroup Theme
*/ */
Eflxx::CountedPtr <Einaxx::List<Theme*> > getExtensionList (); Eflxx::CountedPtr <Einaxx::List<Theme*> > getExtensionList () const;
/** /**
* Set the theme search order for the given theme * Set the theme search order for the given theme
@ -143,7 +143,7 @@ public:
* *
* @ingroup Theme * @ingroup Theme
*/ */
std::string getTheme (); std::string getTheme () const;
/** /**
* Return the full path for a theme element * Return the full path for a theme element
@ -184,7 +184,7 @@ public:
* *
* @ingroup Theme * @ingroup Theme
*/ */
Eflxx::CountedPtr <Einaxx::List<Theme*> > getThemeList (); Eflxx::CountedPtr <Einaxx::List<Theme*> > getThemeList () const;
/** /**
* Flush the current theme. * Flush the current theme.
@ -197,7 +197,7 @@ public:
* *
* @ingroup Theme * @ingroup Theme
*/ */
void flush (); void flush () const;
/** /**
* This flushes all themes (default and specific ones). * This flushes all themes (default and specific ones).
@ -220,7 +220,7 @@ public:
* *
* @ingroup Theme * @ingroup Theme
*/ */
std::string getData (const std::string &key); std::string getData (const std::string &key) const;
private: private:
Theme (Elm_Theme *th); Theme (Elm_Theme *th);

View File

@ -22,9 +22,40 @@ Entry *Entry::factory (Evasxx::Object &parent)
return new Entry (parent); return new Entry (parent);
} }
void Entry::setSingleLine (bool singleLine) void Entry::pushUserTextStyle(const std::string &style)
{ {
elm_entry_single_line_set (o, singleLine); elm_entry_text_style_user_push(o, style.c_str());
}
void Entry::popUserTextStyle()
{
elm_entry_text_style_user_pop(o);
}
std::string Entry::peekUserTextStyle()
{
const char *tmp = elm_entry_text_style_user_peek(o);
return tmp ? tmp : string ();
}
void Entry::setScrollable(bool scroll)
{
elm_entry_scrollable_set(o, scroll);
}
bool Entry::getScrollable() const
{
return elm_entry_scrollable_get(o);
}
void Entry::setSingleLine (bool single_line)
{
elm_entry_single_line_set (o, single_line);
}
bool Entry::getSingleLine() const
{
return elm_entry_single_line_get(o);
} }
void Entry::setPassword (bool password) void Entry::setPassword (bool password)
@ -32,18 +63,28 @@ void Entry::setPassword (bool password)
elm_entry_password_set (o, password); elm_entry_password_set (o, password);
} }
bool Entry::getPassword() const
{
return elm_entry_password_get(o);
}
void Entry::setText (const std::string &entry) void Entry::setText (const std::string &entry)
{ {
elm_entry_entry_set (o, entry.c_str ()); elm_entry_entry_set (o, entry.c_str ());
} }
const std::string Entry::getText () const std::string Entry::getText () const
{ {
const char *tmp = elm_entry_entry_get (o); const char *tmp = elm_entry_entry_get (o);
return tmp ? tmp : string (); return tmp ? tmp : string ();
} }
const std::string Entry::getSelection () const bool Entry::isEmpty() const
{
return elm_entry_is_empty(o);
}
std::string Entry::getSelection () const
{ {
const char *tmp = elm_entry_selection_get (o); const char *tmp = elm_entry_selection_get (o);
return tmp ? tmp : string (); return tmp ? tmp : string ();
@ -74,13 +115,13 @@ void Entry::selectAll ()
elm_entry_select_all (o); elm_entry_select_all (o);
} }
const std::string Entry::markupToUtf8 (const std::string &str) std::string Entry::markupToUtf8 (const std::string &str)
{ {
const char *tmp = elm_entry_markup_to_utf8 (str.c_str ()); const char *tmp = elm_entry_markup_to_utf8 (str.c_str ());
return tmp ? tmp : string (); return tmp ? tmp : string ();
} }
const std::string Entry::utf8ToMarkup (const std::string &str) std::string Entry::utf8ToMarkup (const std::string &str)
{ {
const char *tmp = elm_entry_utf8_to_markup (str.c_str ()); const char *tmp = elm_entry_utf8_to_markup (str.c_str ());
return tmp ? tmp : string (); return tmp ? tmp : string ();

View File

@ -46,7 +46,7 @@ void Theme::delOverlay(const std::string& item)
elm_theme_overlay_del(mTheme, item.c_str()); elm_theme_overlay_del(mTheme, item.c_str());
} }
Eflxx::CountedPtr <Einaxx::List<Theme*> > Theme::getOverlayList () Eflxx::CountedPtr <Einaxx::List<Theme*> > Theme::getOverlayList () const
{ {
Eina_List *list = const_cast <Eina_List*> (elm_theme_overlay_list_get(mTheme)); Eina_List *list = const_cast <Eina_List*> (elm_theme_overlay_list_get(mTheme));
@ -63,7 +63,7 @@ void Theme::delExtension (const std::string& item)
elm_theme_extension_del(mTheme, item.c_str()); elm_theme_extension_del(mTheme, item.c_str());
} }
Eflxx::CountedPtr <Einaxx::List<Theme*> > Theme::getExtensionList () Eflxx::CountedPtr <Einaxx::List<Theme*> > Theme::getExtensionList () const
{ {
Eina_List *list = const_cast <Eina_List*> (elm_theme_extension_list_get(mTheme)); Eina_List *list = const_cast <Eina_List*> (elm_theme_extension_list_get(mTheme));
@ -75,7 +75,7 @@ void Theme::setTheme (const std::string &theme)
elm_theme_set(mTheme, theme.c_str()); elm_theme_set(mTheme, theme.c_str());
} }
std::string Theme::getTheme () std::string Theme::getTheme () const
{ {
return elm_theme_get(mTheme); return elm_theme_get(mTheme);
} }
@ -90,14 +90,14 @@ std::string Theme::getItemListPath (const std::string &f, bool &in_search_path)
return ret; return ret;
} }
Eflxx::CountedPtr <Einaxx::List<Theme*> > Theme::getThemeList () Eflxx::CountedPtr <Einaxx::List<Theme*> > Theme::getThemeList () const
{ {
Eina_List *list = const_cast <Eina_List*> (elm_theme_list_get(mTheme)); Eina_List *list = const_cast <Eina_List*> (elm_theme_list_get(mTheme));
return Eflxx::CountedPtr <Einaxx::List<Theme*> > (Einaxx::List<Theme*>::wrap (list)); return Eflxx::CountedPtr <Einaxx::List<Theme*> > (Einaxx::List<Theme*>::wrap (list));
} }
void Theme::flush () void Theme::flush () const
{ {
elm_theme_flush(mTheme); elm_theme_flush(mTheme);
} }
@ -107,7 +107,7 @@ void Theme::flushFull ()
elm_theme_full_flush(); elm_theme_full_flush();
} }
std::string Theme::getData (const std::string &key) std::string Theme::getData (const std::string &key) const
{ {
return elm_theme_data_get(mTheme, key.c_str()); return elm_theme_data_get(mTheme, key.c_str());
} }