Maeomm Reference Documentation: hildonmm
Main Page   Namespaces   Book  

Hildon::Program Class Reference

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

Inheritance diagram for Hildon::Program:

Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual ~Program ()
HildonProgram* gobj ()
 Provides access to the underlying C GObject.
const HildonProgram* gobj () const
 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 add_window (Window& window)
 Registers a Hildon::Window as belonging to a given Hildon::Program.
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.
bool get_can_hibernate () const
 Return value: true if the program can hibernate, false otherwise.
void set_common_menu (Gtk::Menu& menu)
 Sets a Gtk::Menu that will appear in all Hildon::Windows registered with the Hildon::Program.
Gtk::Menuget_common_menu ()
 Return value: the Gtk::Menu or 0 of no common menu was set.
const Gtk::Menuget_common_menu () const
 Return value: the Gtk::Menu or 0 of no common menu was set.
void set_common_app_menu (AppMenu& menu)
 Sets a Hildon::AppMenu that will appear in all Hildon::Windows registered with the Hildon::Program.
AppMenuget_common_app_menu ()
 Return value: the Hildon::AppMenu or 0 of no common app menu was.
const AppMenuget_common_app_menu () const
 Return value: the Hildon::AppMenu or 0 of no common app menu was.
void set_common_toolbar (Gtk::Toolbar& toolbar)
 Sets a Gtk::Toolbar that will appear in all the Hildon::Window registered to the Hildon::Program.
Gtk::Toolbarget_common_toolbar ()
 Return value: the Gtk::Toolbar or 0 of no common toolbar was.
const Gtk::Toolbarget_common_toolbar () const
 Return value: the Gtk::Toolbar or 0 of no common toolbar was.
bool get_is_topmost () const
 Return value: true if a window or dialog is topmost, false.

Static Public Member Functions

static Glib::RefPtr<Programget_instance ()
 Return value: the Hildon::Program.

Related Functions

(Note that these are not member functions.)

Glib::RefPtr<Hildon::Programwrap (HildonProgram* object, bool take_copy=false)
 A Glib::wrap() method for this object.


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

A Hildon::AppMenu 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 Hildon::AppMenuu in a Hildon::Window. In this way, every application window can have a different menu.

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.

See also:
Hildon::EditToolbar.

Constructor & Destructor Documentation

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


Member Function Documentation

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

Provides access to the underlying C GObject.

Reimplemented from Glib::ObjectBase.

const HildonProgram* Hildon::Program::gobj (  )  const [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.

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

Return value: the Hildon::Program.

Returns:
The Hildon::Program.

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

Registers a Hildon::Window as belonging to a given Hildon::Program.

This allows to apply program-wide settings as all the registered windows, such as set_common_menu(), set_common_app_menu() and set_common_toolbar().

Parameters:
window A Hildon::Window to be added.

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

Used to unregister a window from the program.

Subsequent calls to set_common_menu(), set_common_app_menu() and set_common_toolbar() will not affect the window.

Parameters:
window The Hildon::Window 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.

bool Hildon::Program::get_can_hibernate (  )  const

Return value: true if the program can hibernate, false otherwise.

Returns:
true if the program can hibernate, false otherwise.

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

Sets a Gtk::Menu that will appear in all Hildon::Windows registered with the Hildon::Program.

Only one common Gtk::Menu can be set, further calls will detach the previous common Gtk::Menu. A Hildon::Window can use its own Gtk::Menu with Hildon::Window::set_menu()

This method does not support Hildon::AppMenus. See set_common_app_menu() for that.

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

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

Return value: the Gtk::Menu or 0 of no common menu was set.

Returns:
The Gtk::Menu or 0 of no common menu was set.

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

Return value: the Gtk::Menu or 0 of no common menu was set.

Returns:
The Gtk::Menu or 0 of no common menu was set.

void Hildon::Program::set_common_app_menu ( AppMenu menu  ) 

Sets a Hildon::AppMenu that will appear in all Hildon::Windows registered with the Hildon::Program.

Only one common Hildon::AppMenu can be set, further calls will detach the previous common Hildon::AppMenu. A Hildon::Window can use its own Hildon::AppMenu with Hildon::Window::set_app_menu()

This method does not support Gtk::Menus. See set_common_menu() for that.

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

AppMenu* Hildon::Program::get_common_app_menu (  ) 

Return value: the Hildon::AppMenu or 0 of no common app menu was.

Returns:
The Hildon::AppMenu or 0 of no common app menu was set.
.

const AppMenu* Hildon::Program::get_common_app_menu (  )  const

Return value: the Hildon::AppMenu or 0 of no common app menu was.

Returns:
The Hildon::AppMenu or 0 of no common app menu was set.
.

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

Sets a Gtk::Toolbar that will appear in all the Hildon::Window registered to the Hildon::Program.

Only one common Gtk::Toolbar can be set, further call will detach the previous common Gtk::Toolbar. A Hildon::Window can use its own Gtk::Toolbar with Hildon::Window::add_toolbar(). Both Hildon::Program and Hildon::Window specific toolbars will be shown

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

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

Return value: the Gtk::Toolbar or 0 of no common toolbar was.

Returns:
The Gtk::Toolbar or 0 of no common toolbar was set.

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

Return value: the Gtk::Toolbar or 0 of no common toolbar was.

Returns:
The Gtk::Toolbar or 0 of no common toolbar was set.

bool Hildon::Program::get_is_topmost (  )  const

Return value: true if a window or dialog is topmost, false.

Returns:
true if a window or dialog is topmost, false otherwise.


Friends And Related Function Documentation

Glib::RefPtr<Hildon::Program> wrap ( HildonProgram *  object,
bool  take_copy = false 
) [related]

A Glib::wrap() method for this object.

Parameters:
object The C instance.
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.6 © 1997-2001