Back to index

indicator-appmenu  12.10.0
huditem.h
Go to the documentation of this file.
00001 /*
00002  * Copyright © 2012 Canonical Ltd.
00003  *
00004  * This program is free software: you can redistribute it and/or modify it
00005  * under the terms of the GNU General Public License version 3, as
00006  * published by the Free Software Foundation.
00007  *
00008  * This program is distributed in the hope that it will be useful, but
00009  * WITHOUT ANY WARRANTY; without even the implied warranties of
00010  * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
00011  * PURPOSE.  See the GNU General Public License for more details.
00012  *
00013  * You should have received a copy of the GNU General Public License along
00014  * with this program.  If not, see <http://www.gnu.org/licenses/>.
00015  *
00016  * Author: Ryan Lortie <desrt@desrt.ca>
00017  */
00018 
00019 #ifndef __HUD_ITEM_H__
00020 #define __HUD_ITEM_H__
00021 
00022 #include <glib-object.h>
00023 
00024 #include "hudtoken.h"
00025 
00026 #define HUD_TYPE_ITEM                                       (hud_item_get_type ())
00027 #define HUD_ITEM(inst)                                      (G_TYPE_CHECK_INSTANCE_CAST ((inst),                     \
00028                                                              HUD_TYPE_ITEM, HudItem))
00029 #define HUD_ITEM_CLASS(class)                               (G_TYPE_CHECK_CLASS_CAST ((class),                       \
00030                                                              HUD_TYPE_ITEM, HudItemClass))
00031 #define HUD_IS_ITEM(inst)                                   (G_TYPE_CHECK_INSTANCE_TYPE ((inst), HUD_TYPE_ITEM))
00032 #define HUD_IS_ITEM_CLASS(class)                            (G_TYPE_CHECK_CLASS_TYPE ((class), HUD_TYPE_ITEM))
00033 #define HUD_ITEM_GET_CLASS(inst)                            (G_TYPE_INSTANCE_GET_CLASS ((inst),                      \
00034                                                              HUD_TYPE_ITEM, HudItemClass))
00035 
00036 
00037 typedef struct _HudItemPrivate                              HudItemPrivate;
00038 typedef struct _HudItemClass                                HudItemClass;
00039 typedef struct _HudItem                                     HudItem;
00040 
00041 struct _HudItemClass
00042 {
00043   GObjectClass parent_class;
00044 
00045   void (* activate) (HudItem  *item,
00046                      GVariant *platform_data);
00047 };
00048 
00049 struct _HudItem
00050 {
00051   /*< private >*/
00052   GObject parent_instance;
00053 
00054   HudItemPrivate *priv;
00055 };
00056 
00057 GType                   hud_item_get_type                               (void);
00058 
00059 gpointer                hud_item_construct                              (GType          g_type,
00060                                                                          HudStringList *tokens,
00061                                                                          const gchar   *desktop_file,
00062                                                                          const gchar   *app_icon,
00063                                                                          gboolean       enabled);
00064 HudItem *               hud_item_new                                    (HudStringList *tokens,
00065                                                                          const gchar   *desktop_file,
00066                                                                          const gchar   *app_icon,
00067                                                                          gboolean       enabled);
00068 void                    hud_item_activate                               (HudItem       *item,
00069                                                                          GVariant      *platform_data);
00070 HudStringList *         hud_item_get_tokens                             (HudItem       *item);
00071 const gchar *           hud_item_get_app_icon                           (HudItem       *item);
00072 const gchar *           hud_item_get_item_icon                          (HudItem       *item);
00073 guint                   hud_item_get_usage                              (HudItem       *item);
00074 gboolean                hud_item_get_enabled                            (HudItem       *item);
00075 guint64                 hud_item_get_id                                 (HudItem       *item);
00076 HudItem *               hud_item_lookup                                 (guint64        id);
00077 HudTokenList *          hud_item_get_token_list                         (HudItem       *item);
00078 
00079 #endif /* __HUD_ITEM_H__ */