HildonDesktopHomeItem

HildonDesktopHomeItem — A widget to be used as base class for the HildonHomeArea children

Synopsis

#define             HILDON_DESKTOP_TYPE_HOME_ITEM_RESIZE_TYPE
enum                HildonDesktopHomeItemResizeType;
                    HildonDesktopHomeItem;
GType               hildon_desktop_home_item_get_type   (void);
GtkWidget*          hildon_desktop_home_item_new        (void);
void                hildon_desktop_home_item_set_resize_type
                                                        (HildonDesktopHomeItem *item,
                                                         HildonDesktopHomeItemResizeType resize_type);
HildonDesktopHomeItemResizeType hildon_desktop_home_item_get_resize_type
                                                        (HildonDesktopHomeItem *item);
GtkWidget*          hildon_desktop_home_item_get_settings_menu_item
                                                        (HildonDesktopHomeItem *item);
void                hildon_desktop_home_item_set_is_background
                                                        (HildonDesktopHomeItem *item,
                                                         gboolean is_background);
void                hildon_desktop_home_item_raise      (HildonDesktopHomeItem *item);
void                hildon_desktop_home_item_lower      (HildonDesktopHomeItem *item);

Object Hierarchy

  GObject
   +----GInitiallyUnowned
         +----GtkObject
               +----GtkWidget
                     +----GtkContainer
                           +----GtkBin
                                 +----HildonDesktopItem
                                       +----HildonDesktopHomeItem

Implemented Interfaces

HildonDesktopHomeItem implements AtkImplementorIface and GtkBuildable.

Properties

  "minimum-height"           gint                  : Read / Write
  "minimum-width"            gint                  : Read / Write
  "resize-type"              HildonDesktopHomeItemResizeType  : Read / Write
  "state"                    gint                  : Read / Write

Style Properties

  "background-borders"       GtkBorder*            : Read

Signals

  "background"                                     : Run First
  "foreground"                                     : Run First
  "settings"                                       : Run Last

Description

The HildonDesktopHomeItem is the base class implemented by Home plugin writers. It implements the dragging and resizing of the item.

It also provides commodities for the plugin writer to know whether the item is in foreground or background, and allows providing a GtkMenuItem, which when activated can open a "settings" dialog for the item.

Details

HILDON_DESKTOP_TYPE_HOME_ITEM_RESIZE_TYPE

#define             HILDON_DESKTOP_TYPE_HOME_ITEM_RESIZE_TYPE


enum HildonDesktopHomeItemResizeType

typedef enum
{
  HILDON_DESKTOP_HOME_ITEM_RESIZE_NONE,
  HILDON_DESKTOP_HOME_ITEM_RESIZE_VERTICAL,
  HILDON_DESKTOP_HOME_ITEM_RESIZE_HORIZONTAL,
  HILDON_DESKTOP_HOME_ITEM_RESIZE_BOTH
} HildonDesktopHomeItemResizeType;

Enum values used to specify how a HildonDesktopHomeItem can be resized.

HILDON_DESKTOP_HOME_ITEM_RESIZE_NONE cannot be resized.
HILDON_DESKTOP_HOME_ITEM_RESIZE_VERTICAL can only be resized vertically
HILDON_DESKTOP_HOME_ITEM_RESIZE_HORIZONTAL can only be resized horizontally
HILDON_DESKTOP_HOME_ITEM_RESIZE_BOTH can be resized both horizontally and vertically

HildonDesktopHomeItem

typedef struct _HildonDesktopHomeItem HildonDesktopHomeItem;


hildon_desktop_home_item_get_type ()

GType               hildon_desktop_home_item_get_type   (void);

Registers and returns the GType for HildonDesktopHomeItem

Returns : the GType for HildonDesktopHomeItem

hildon_desktop_home_item_new ()

GtkWidget*          hildon_desktop_home_item_new        (void);

Creates a new HildonDesktopHomeItem.

Returns : A new HildonDesktopHomeItem.

hildon_desktop_home_item_set_resize_type ()

void                hildon_desktop_home_item_set_resize_type
                                                        (HildonDesktopHomeItem *item,
                                                         HildonDesktopHomeItemResizeType resize_type);

Sets whether the item can be resized horizontally, vertically, both, or if it cannot be resized.


hildon_desktop_home_item_get_resize_type ()

HildonDesktopHomeItemResizeType hildon_desktop_home_item_get_resize_type
                                                        (HildonDesktopHomeItem *item);

Returns whether the item is set to be resized horizontally, vertically, both, or if it cannot be resized.

item : A HildonDesktopHomeItem.
Returns : The resize type for the item.

hildon_desktop_home_item_get_settings_menu_item ()

GtkWidget*          hildon_desktop_home_item_get_settings_menu_item
                                                        (HildonDesktopHomeItem *item);

Returns a menu item which can be used to show a dialog with settings related to this item. If the item has no settings, the function returns NULL.

item : A HildonDesktopHomeItem.
Returns : A GtkMenuItem to use for settings, or NULL

hildon_desktop_home_item_set_is_background ()

void                hildon_desktop_home_item_set_is_background
                                                        (HildonDesktopHomeItem *item,
                                                         gboolean is_background);

Sets whether or not the item is currently in the background. If in the background, the item is expected to reduce its activity, for instance by stopping animations.

item : A HildonDesktopHomeItem.
is_background : Whether or not the item is in the background

hildon_desktop_home_item_raise ()

void                hildon_desktop_home_item_raise      (HildonDesktopHomeItem *item);

Raises the item above all its siblings.


hildon_desktop_home_item_lower ()

void                hildon_desktop_home_item_lower      (HildonDesktopHomeItem *item);

Lowers the item above all its siblings.

Property Details

The "minimum-height" property

  "minimum-height"           gint                  : Read / Write

Minimum height for this applet.

Allowed values: >= -1

Default value: -1


The "minimum-width" property

  "minimum-width"            gint                  : Read / Write

Minimum width for this applet.

Allowed values: >= -1

Default value: -1


The "resize-type" property

  "resize-type"              HildonDesktopHomeItemResizeType  : Read / Write

Whether the applet can be resized vertically, horizontally, or both.

Default value: HILDON_DESKTOP_HOME_ITEM_RESIZE_NONE


The "state" property

  "state"                    gint                  : Read / Write

state of the applet.

Allowed values: [0,2]

Default value: 1

Style Property Details

The "background-borders" style property

  "background-borders"       GtkBorder*            : Read

Background border, which shall not be stretched.

Signal Details

The "background" signal

void                user_function                      (HildonDesktopHomeItem *widget,
                                                        gpointer               user_data)      : Run First

The ::background signal is emitted when the Home View has gone in the background. The widget should reduce its activity to save energy, for instance stop animations.

widget : the widget that received the signal
user_data : user data set when the signal handler was connected.

The "foreground" signal

void                user_function                      (HildonDesktopHomeItem *widget,
                                                        gpointer               user_data)      : Run First

The ::foreground signal is emitted when the Home View has comes back in the foreground.

widget : the widget that received the signal
user_data : user data set when the signal handler was connected.

The "settings" signal

GtkWidget*          user_function                      (HildonDesktopHomeItem *widget,
                                                        GtkWidget             *returns,
                                                        gpointer               user_data)      : Run Last

The ::settings signal is emitted when the desktop requests the item for a "Settings" menu item. The item can provide such a menu item, which when activated shows a settings dialog.

widget : the widget that received the signal
returns : A GtkMenuItem, or NULL.
user_data : user data set when the signal handler was connected.