Maeomm Reference Documentation: hildonsmm
Main Page   Namespaces   Book  

Hildon::Program Class Reference

Inheritance diagram for Hildon::Program:

Glib::Object Glib::ObjectBase sigc::trackable List of all members.

Detailed Description

A Hildon::Program is the base of any Hildon application.

It represents an application running in the Hildon framework. The Hildon::Program tracks the top-most status of an application and informs the task navigator when the application can be hibernated.

It also provides tools to get and set menus and toolbars which are common for all application windows.

The Hildon::Program object is created by calling the static get_instance() method, which takes no parameters and returns a new Hildon::Program.

The following methods are of particular interest:

Menus

The menus in Maemo use the GTK+/gtkmm menu functions, with the exception that the menu is attached to the Hildon::Window and appears in the title bar. A Gtk::Menu can be created and attached to the Hildon::Program to be used as a common menu for all Hildon::Windows that do not have their own menu. Another way is to use a Gtk::Menu in a HildonWindow. In this way, every application window can have a different menu.

The menus can be made both manually or using the action-based Gtk::UIManager.

Toolbars

To create an application that has a toolbar, create a normal Hildon::Window and a normal Gtk::Toolbar. The toolbar is used like any Gtk::Toolbar and it can contain normal Gtk::ToolItems, such as ToolButton, ToggleToolButton, etc.

The main difference in maemo compared to normal GTK+/gtkmm usage is that toolbars can be common to all Hildon::Windows in an application or they can be used only in a particular HildonWindow.


Public Member Functions

void add_window (Window& window)
 Registers a HildonWindow as belonging to a given HildonProgram .
bool get_can_hibernate () const
 
Returns:
Whether or not this Hildon::Program is set to be support hibernation from the Hildon task navigator.

const Gtk::Menuget_common_menu () const
 
Returns:
The GtkMenu that was set as common menu for this Hildon::Program, or 0 of no common menu was set.

Gtk::Menuget_common_menu ()
 
Returns:
The GtkMenu that was set as common menu for this Hildon::Program, or 0 of no common menu was set.

const Gtk::Toolbarget_common_toolbar () const
 
Returns:
The GtkToolbar that was set as common toolbar for this Hildon::Program, or 0 of no common menu was set.

Gtk::Toolbarget_common_toolbar ()
 
Returns:
The GtkToolbar that was set as common toolbar for this Hildon::Program, or 0 of no common menu was set.

bool get_is_topmost () const
 
Returns:
Whether or not one of the program's window or dialog is currenltly activated by the window manager.

const HildonProgram* gobj () const
 Provides access to the underlying C GObject.
HildonProgram* gobj ()
 Provides access to the underlying C GObject.
HildonProgram* gobj_copy ()
 Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
void remove_window (Window& window)
 Used to unregister a window from the program.
void set_can_hibernate (bool can_hibernate=true)
 Used to set whether or not the Hildon task navigator should be able to set the program to hibernation in case of low memory.
void set_common_menu (Gtk::Menu& menu)
 Sets a GtkMenu that will appear in all the HildonWindow registered to the Hildon::Program.
void set_common_toolbar (Gtk::Toolbar& toolbar)
 Sets a GtkToolbar that will appear in all the HildonWindow registered to the Hildon::Program.
virtual ~Program ()

Static Public Member Functions

static Glib::RefPtr<Programget_instance ()
 
Returns:
Returns the Hildon::Program for the current process.


Related Functions

(Note that these are not member functions.)

Glib::RefPtr<Hildon::Programwrap (HildonProgram* object, bool take_copy=false)
 
Parameters:
object The C instance


Constructor & Destructor Documentation

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


Member Function Documentation

void Hildon::Program::add_window ( Window window  ) 

Registers a HildonWindow as belonging to a given HildonProgram .

This allows to apply program-wide settings as all the registered windows, such as hildon_program_set_common_menu() and hildon_pogram_set_common_toolbar()

Parameters:
window A HildonWindow to be added.

bool Hildon::Program::get_can_hibernate (  )  const

Returns:
Whether or not this Hildon::Program is set to be support hibernation from the Hildon task navigator.

const Gtk::Menu* Hildon::Program::get_common_menu (  )  const

Returns:
The GtkMenu that was set as common menu for this Hildon::Program, or 0 of no common menu was set.

Gtk::Menu* Hildon::Program::get_common_menu (  ) 

Returns:
The GtkMenu that was set as common menu for this Hildon::Program, or 0 of no common menu was set.

const Gtk::Toolbar* Hildon::Program::get_common_toolbar (  )  const

Returns:
The GtkToolbar that was set as common toolbar for this Hildon::Program, or 0 of no common menu was set.

Gtk::Toolbar* Hildon::Program::get_common_toolbar (  ) 

Returns:
The GtkToolbar that was set as common toolbar for this Hildon::Program, or 0 of no common menu was set.

static Glib::RefPtr<Program> Hildon::Program::get_instance (  )  [static]

Returns:
Returns the Hildon::Program for the current process.

The object is created on the first call.

bool Hildon::Program::get_is_topmost (  )  const

Returns:
Whether or not one of the program's window or dialog is currenltly activated by the window manager.

const HildonProgram* Hildon::Program::gobj (  )  const [inline]

Provides access to the underlying C GObject.

Reimplemented from Glib::ObjectBase.

HildonProgram* Hildon::Program::gobj (  )  [inline]

Provides access to the underlying C GObject.

Reimplemented from Glib::ObjectBase.

HildonProgram* Hildon::Program::gobj_copy (  ) 

Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.

void Hildon::Program::remove_window ( Window window  ) 

Used to unregister a window from the program.

Subsequent calls to hildon_program_set_common_menu() and hildon_pogram_set_common_toolbar() will not affect the window

Parameters:
window The HildonWindow to unregister.

void Hildon::Program::set_can_hibernate ( bool  can_hibernate = true  ) 

Used to set whether or not the Hildon task navigator should be able to set the program to hibernation in case of low memory.

Parameters:
can_hibernate Whether or not the Hildon::Program can hibernate.

void Hildon::Program::set_common_menu ( Gtk::Menu menu  ) 

Sets a GtkMenu that will appear in all the HildonWindow registered to the Hildon::Program.

Only one common GtkMenu can be set, further call will detach the previous common GtkMenu. A HildonWindow can use it's own GtkMenu with hildon_window_set_menu

Parameters:
menu A GtkMenu to use as common menu for the program.

void Hildon::Program::set_common_toolbar ( Gtk::Toolbar toolbar  ) 

Sets a GtkToolbar that will appear in all the HildonWindow registered to the Hildon::Program.

Only one common GtkToolbar can be set, further call will detach the previous common GtkToolbar. A HildonWindow can use its own GtkToolbar with hildon_window_set_toolbar . Both Hildon::Program and HildonWindow specific toolbars will be shown

Parameters:
toolbar A GtkToolbar to use as common toolbar for the program.


Friends And Related Function Documentation

Glib::RefPtr<Hildon::Program> wrap ( HildonProgram *  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