Maeomm Reference Documentation: hildonsmm
Main Page   Namespaces   Book  

Hildon::Banner Class Reference
[Widgets]

Inheritance diagram for Hildon::Banner:

Inheritance graph
[legend]
List of all members.

Detailed Description

The Hildon::Banners are used in many places in the Maemo applications.

They show a small information banner in the top right corner of the application view for a few seconds and then disappear automatically. They are used for all kinds of notifications, such as "File Saved", "Unable to make connection" or "Choose one option only".

There are multiple static methods to choose, depending on the information you want to show. The banner can show the user plain text, a custom icon, or a progress bar.


Public Member Functions

const HildonBanner* gobj () const
 Provides access to the underlying C GtkObject.
HildonBanner* gobj ()
 Provides access to the underlying C GtkObject.
void set_fraction (double fraction)
 The fraction is the completion of progressbar, the scale is from 0.0 to 1.0.
void set_icon (const Glib::ustring& icon_name)
 Sets the icon to be used in the banner.
void set_icon_from_file (const std::string& icon_file)
 Sets the icon from its filename to be used in the banner.
void set_markup (const Glib::ustring& markup)
 Sets the text with markup that is displayed in the banner.
void set_text (const Glib::ustring& text)
 Sets the text that is displayed in the banner.
void set_timeout (guint timeout)
 Sets the timeout on the banner.
virtual ~Banner ()

Static Public Member Functions

static Bannershow_animation (Gtk::Widget& widget, const Glib::ustring& text)
 Shows an animated progress notification.
static Bannershow_animation (Gtk::Widget& widget, const Glib::ustring& animation_name, const Glib::ustring& text)
 Shows an animated progress notification.
static void show_information (Gtk::Widget& widget, const Glib::ustring& text)
 This function creates and displays an information banner that automatically goes away after a certain time period.
static void show_information (Gtk::Widget& widget, const Glib::ustring& icon_name, const Glib::ustring& text)
 This function creates and displays an information banner that automatically goes away after certain time period.
static void show_information_with_markup (Gtk::Widget& widget, const Glib::ustring& markup)
 This function creates and displays an information banner that automatically goes away after a certain time period.
static void show_information_with_markup (Gtk::Widget& widget, const Glib::ustring& icon_name, const Glib::ustring& markup)
 This function creates and displays an information banner that automatically goes away after certain time period.
static Bannershow_progress (Gtk::Widget& widget, const Glib::ustring& text)
 Shows progress notification.
static Bannershow_progress (Gtk::Widget& widget, Gtk::ProgressBar& bar, const Glib::ustring& text)
 Shows progress notification.

Protected Member Functions

 Banner ()

Related Functions

(Note that these are not member functions.)

Hildon::Bannerwrap (HildonBanner* object, bool take_copy=false)
 
Parameters:
object The C instance


Constructor & Destructor Documentation

virtual Hildon::Banner::~Banner (  )  [virtual]

Hildon::Banner::Banner (  )  [protected]


Member Function Documentation

const HildonBanner* Hildon::Banner::gobj (  )  const [inline]

Provides access to the underlying C GtkObject.

Reimplemented from Gtk::Window.

HildonBanner* Hildon::Banner::gobj (  )  [inline]

Provides access to the underlying C GtkObject.

Reimplemented from Gtk::Window.

void Hildon::Banner::set_fraction ( double  fraction  ) 

The fraction is the completion of progressbar, the scale is from 0.0 to 1.0.

Sets the amount of fraction the progressbar has.

Since: 0.12.2

Parameters:
fraction Double.

void Hildon::Banner::set_icon ( const Glib::ustring icon_name  ) 

Sets the icon to be used in the banner.

Parameters:
icon_name The name of icon to use. Can be 0 for default icon.

void Hildon::Banner::set_icon_from_file ( const std::string &  icon_file  ) 

Sets the icon from its filename to be used in the banner.

Parameters:
icon_file The filename of icon to use. Can be 0 for default icon.

Reimplemented from Gtk::Window.

void Hildon::Banner::set_markup ( const Glib::ustring markup  ) 

Sets the text with markup that is displayed in the banner.

Parameters:
markup A new text with Pango markup to display in the banner.

void Hildon::Banner::set_text ( const Glib::ustring text  ) 

Sets the text that is displayed in the banner.

Parameters:
text A new text to display in banner.

void Hildon::Banner::set_timeout ( guint  timeout  ) 

Sets the timeout on the banner.

After the given amount of miliseconds has elapsed the banner will go away. Note that settings this only makes sense on the banners that are timed and that have not been yet displayed on the screen.

Parameters:
timeout Timeout to set in miliseconds.

static Banner* Hildon::Banner::show_animation ( Gtk::Widget widget,
const Glib::ustring text 
) [static]

Shows an animated progress notification.

It's recommended not to try to show more than one progress notification at a time, since they will appear on top of each other. You can use progress notifications with timed banners. In this case the banners are located so that you can somehow see both.

Please note that banners are destroyed automatically once the window they are attached to is closed. The pointer that you receive with this function does not contain additional references, so it can become invalid without warning (this is true for all toplevel windows in gtk).

Parameters:
widget The widget that wants to display a banner.
text,: the text to display.
Returns:
A Hildon::Banner widget. You must call delete once you are finished with the banner.

static Banner* Hildon::Banner::show_animation ( Gtk::Widget widget,
const Glib::ustring animation_name,
const Glib::ustring text 
) [static]

Shows an animated progress notification.

It's recommended not to try to show more than one progress notification at a time, since they will appear on top of each other. You can use progress notifications with timed banners. In this case the banners are located so that you can somehow see both.

Please note that banners are destroyed automatically once the window they are attached to is closed. The pointer that you receive with this function do not contain additional references, so it can become invalid without warning (this is true for all toplevel windows in gtk). To make sure that the banner do not disapear automatically, you can separately ref the return value (this doesn't prevent the banner from disappearing, but the object it just not finalized). In this case you have to delete it manually.

Parameters:
widget The Gtk::Widget that wants to display banner.
animation_name The progress animation to use. You usually can just pass 0 for the default animation.
text The text to display.
Returns:
A Hildon::Banner widget. You must delete it once you are ready with the banner.
Since: 0.12.2.

static void Hildon::Banner::show_information ( Gtk::Widget widget,
const Glib::ustring text 
) [static]

This function creates and displays an information banner that automatically goes away after a certain time period.

For each window in your application there can only be one timed banner, so if you spawn a new banner before the earlier one has timed out, the previous one will be replaced.

Parameters:
widget The widget that wants to display a banner.
text The name of the icon to use.

static void Hildon::Banner::show_information ( Gtk::Widget widget,
const Glib::ustring icon_name,
const Glib::ustring text 
) [static]

This function creates and displays an information banner that automatically goes away after certain time period.

For each window in your application there can only be one timed banner, so if you spawn a new banner before the earlier one has timed out, the previous one will be replaced.

Parameters:
widget The Gtk::Widget that is the owner of the banner.
icon_name The name of icon to use. Can be 0 for default icon.
text Text to display.
Returns:
The newly created banner.

static void Hildon::Banner::show_information_with_markup ( Gtk::Widget widget,
const Glib::ustring markup 
) [static]

This function creates and displays an information banner that automatically goes away after a certain time period.

For each window in your application there can only be one timed banner, so if you spawn a new banner before the earlier one has timed out, the previous one will be replaced.

Parameters:
widget The widget that wants to display a banner.
markup A markup string to display (see Pango markup format)

static void Hildon::Banner::show_information_with_markup ( Gtk::Widget widget,
const Glib::ustring icon_name,
const Glib::ustring markup 
) [static]

This function creates and displays an information banner that automatically goes away after certain time period.

For each window in your application there can only be one timed banner, so if you spawn a new banner before the earlier one has timed out, the previous one will be replaced.

Parameters:
widget The Gtk::Widget that wants to display banner.
icon_name The name of icon to use. Can be 0 for default icon.
markup A markup string to display (see Pango markup format).
Returns:
The newly created banner.

static Banner* Hildon::Banner::show_progress ( Gtk::Widget widget,
const Glib::ustring text 
) [static]

Shows progress notification.

See show_animation() for more information.

Parameters:
widget The widget that wants to display a banner.
text The text to display.
Returns:
A Hildon::Banner widget. You must call delete once you are finished with the banner.

static Banner* Hildon::Banner::show_progress ( Gtk::Widget widget,
Gtk::ProgressBar bar,
const Glib::ustring text 
) [static]

Shows progress notification.

See show_animation for more information.

Parameters:
widget The Gtk::Widget that wants to display banner.
bar Progressbar to use. You usually can just pass 0, unless you want somehow customized progress bar.
text Text to display.
Returns:
A Hildon::Banner widget. You must delete it when you do not need it any more.
Since: 0.12.2.


Friends And Related Function Documentation

Hildon::Banner* wrap ( HildonBanner *  object,
bool  take_copy = false 
) [related]

Parameters:
object The C instance

Parameters:
take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
Returns:
A C++ instance that wraps this C instance.


The documentation for this class was generated from the following file:
Generated for hildonmm by Doxygen 1.5.1 © 1997-2001