OssoABookMenuExtension

OssoABookMenuExtension — Addressbook Menu Extensions

Synopsis

#define             OSSO_ABOOK_DEFINE_MENU_PLUGIN       (TN, t_n, TP, LC, UC)
#define             OSSO_ABOOK_DEFINE_MENU_PLUGIN_SYMBOLS(t_n, LC, UC)
                    OssoABookMenuEntry;
                    OssoABookMenuExtension;
int                 osso_abook_menu_extension_get_n_menu_entries
                                                        (OssoABookMenuExtension *menu_extension);
const OssoABookMenuEntry* osso_abook_menu_extension_get_menu_entries
                                                        (OssoABookMenuExtension *menu_extension);

Object Hierarchy

  GObject
   +----OssoABookMenuExtension

Properties

  "parent"                   GtkWindow*            : Read / Write

Description

The addressbook provides a way to add protocol-specific menu items to the 'groups' view. For example, in the addressbook, if you select menu item "Groups", and then select a group (e.g. a google talk account), it will show a window with all of the contacts from that account. If you define a menu extension class and set OssoABookMenuExtensionClass::name to be the same value as the account profile name (in this case "google-talk"), then the menu items returned from osso_abook_menu_extension_get_menu_entries() will be added to the menu for that group view.

Details

OSSO_ABOOK_DEFINE_MENU_PLUGIN()

#define             OSSO_ABOOK_DEFINE_MENU_PLUGIN(TN, t_n, TP, LC, UC)

Registers a class as a menu extension. The arguments TN, t_n, and TP correspond directly to the parameters of G_DEFINE_DYNAMIC_TYPE() (which is called internally)

TN : the name of the new type, in Camel case
t_n : the name of hte new type, in lowercase, with words separated by '_'
TP : the GType of the parent type
LC : code to execute when the module is loaded
UC : code to execute when the module is unloaded

OSSO_ABOOK_DEFINE_MENU_PLUGIN_SYMBOLS()

#define             OSSO_ABOOK_DEFINE_MENU_PLUGIN_SYMBOLS(t_n, LC, UC)

OssoABookMenuEntry

typedef struct {
        const char      *label;
        unsigned         accel_key;
        GdkModifierType  accel_mods;
        GCallback        callback;
        const char      *name;
} OssoABookMenuEntry;

const char *label; a label for the menu item
GdkModifierType accel_mods; modifier keys to use for the menu item
GCallback callback; a function to call when the menu item is activated
const char *name; the name of the menu item.

OssoABookMenuExtension

typedef struct _OssoABookMenuExtension OssoABookMenuExtension;

Base class for menu extensions. To implement a menu extension, create a class that derives from OssoABookMenuExtension, implement the virtual methods get_n_menu_entries() and get_menu_entries(), and register the extension with OSSO_ABOOK_DEFINE_MENU_PLUGIN()


osso_abook_menu_extension_get_n_menu_entries ()

int                 osso_abook_menu_extension_get_n_menu_entries
                                                        (OssoABookMenuExtension *menu_extension);

menu_extension : a OssoABookMenuExtension
Returns : The number of menu entries provided by the extension.

osso_abook_menu_extension_get_menu_entries ()

const OssoABookMenuEntry* osso_abook_menu_extension_get_menu_entries
                                                        (OssoABookMenuExtension *menu_extension);

menu_extension : a OssoABookMenuExtension
Returns : An array of menu entries.

Property Details

The "parent" property

  "parent"                   GtkWindow*            : Read / Write

Transient parent for extension widgets.