Back to index

indicator-appmenu  12.10.0
window-menu.h
Go to the documentation of this file.
00001 /*
00002 An implementation of indicator object showing menus from applications.
00003 
00004 Copyright 2012 Canonical Ltd.
00005 
00006 Authors:
00007     Ted Gould <ted@canonical.com>
00008 
00009 This program is free software: you can redistribute it and/or modify it 
00010 under the terms of the GNU General Public License version 3, as published 
00011 by the Free Software Foundation.
00012 
00013 This program is distributed in the hope that it will be useful, but 
00014 WITHOUT ANY WARRANTY; without even the implied warranties of 
00015 MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 
00016 PURPOSE.  See the GNU General Public License for more details.
00017 
00018 You should have received a copy of the GNU General Public License along 
00019 with this program.  If not, see <http://www.gnu.org/licenses/>.
00020 */
00021 
00022 #ifndef __WINDOW_MENU_H__
00023 #define __WINDOW_MENU_H__
00024 
00025 #include <glib-object.h>
00026 #include <libindicator/indicator-object.h>
00027 
00028 G_BEGIN_DECLS
00029 
00030 #define WINDOW_MENU_TYPE             (window_menu_get_type ())
00031 #define WINDOW_MENU(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), WINDOW_MENU_TYPE, WindowMenu))
00032 #define WINDOW_MENU_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), WINDOW_MENU_TYPE, WindowMenuClass))
00033 #define IS_WINDOW_MENU(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), WINDOW_MENU_TYPE))
00034 #define IS_WINDOW_MENU_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), WINDOW_MENU_TYPE))
00035 #define WINDOW_MENU_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), WINDOW_MENU_TYPE, WindowMenuClass))
00036 
00037 #define WINDOW_MENU_SIGNAL_ENTRY_ADDED    "entry-added"
00038 #define WINDOW_MENU_SIGNAL_ENTRY_REMOVED  "entry-removed"
00039 #define WINDOW_MENU_SIGNAL_ERROR_STATE    "error-state"
00040 #define WINDOW_MENU_SIGNAL_STATUS_CHANGED "status-changed"
00041 #define WINDOW_MENU_SIGNAL_SHOW_MENU      "show-menu"
00042 #define WINDOW_MENU_SIGNAL_A11Y_UPDATE    "a11y-update"
00043 
00044 typedef enum _WindowMenuStatus WindowMenuStatus;
00045 enum _WindowMenuStatus {
00046        WINDOW_MENU_STATUS_NORMAL,
00047        WINDOW_MENU_STATUS_ACTIVE
00048 };
00049 
00050 typedef struct _WindowMenu      WindowMenu;
00051 typedef struct _WindowMenuClass WindowMenuClass;
00052 
00053 struct _WindowMenuClass {
00054        GObjectClass parent_class;
00055 
00056        /* Virtual Funcs */
00057        GList *          (*get_entries)      (WindowMenu * wm);
00058        guint            (*get_location)     (WindowMenu * wm, IndicatorObjectEntry * entry);
00059 
00060        guint            (*get_xid)          (WindowMenu * wm);
00061 
00062        gboolean         (*get_error_state)  (WindowMenu * wm);
00063        WindowMenuStatus (*get_status)       (WindowMenu * wm);
00064        void             (*entry_restore)    (WindowMenu * wm, IndicatorObjectEntry * entry);
00065 
00066        void             (*entry_activate)   (WindowMenu * wm, IndicatorObjectEntry * entry, guint timestamp);
00067 
00068        /* Signals */
00069        void (*entry_added)    (WindowMenu * wm, IndicatorObjectEntry * entry, gpointer user_data);
00070        void (*entry_removed)  (WindowMenu * wm, IndicatorObjectEntry * entry, gpointer user_data);
00071 
00072        void (*error_state)    (WindowMenu * wm, gboolean state, gpointer user_data);
00073        void (*status_changed) (WindowMenu * wm, WindowMenuStatus status, gpointer user_data);
00074 
00075        void (*show_menu)      (WindowMenu * wm, IndicatorObjectEntry * entry, guint timestamp, gpointer user_data);
00076        void (*a11y_update)    (WindowMenu * wm, IndicatorObjectEntry * entry, gpointer user_data);
00077 };
00078 
00079 struct _WindowMenu {
00080        GObject parent;
00081 };
00082 
00083 GType window_menu_get_type (void);
00084 
00085 GList * window_menu_get_entries (WindowMenu * wm);
00086 guint window_menu_get_location (WindowMenu * wm, IndicatorObjectEntry * entry);
00087 
00088 guint window_menu_get_xid (WindowMenu * wm);
00089 
00090 gboolean window_menu_get_error_state (WindowMenu * wm);
00091 WindowMenuStatus window_menu_get_status (WindowMenu * wm);
00092 void window_menu_entry_restore (WindowMenu * wm, IndicatorObjectEntry * entry);
00093 
00094 void window_menu_entry_activate (WindowMenu * wm, IndicatorObjectEntry * entry, guint timestamp);
00095 
00096 G_END_DECLS
00097 
00098 #endif