Back to index

bamf  0.2.120
bamf-view.h
Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2010-2011 Canonical Ltd
00003  *
00004  * This program is free software: you can redistribute it and/or modify
00005  * it 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,
00009  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00010  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00011  * GNU General Public License for more details.
00012  *
00013  * You should have received a copy of the GNU General Public License
00014  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00015  *
00016  * Authored by: Jason Smith <jason.smith@canonical.com>
00017  *              Marco Trevisan (TreviƱo) <3v1n0@ubuntu.com>
00018  *
00019  */
00020 
00021 #ifndef __BAMFVIEW_H__
00022 #define __BAMFVIEW_H__
00023 
00024 #include "bamf.h"
00025 #include <glib.h>
00026 #include <glib-object.h>
00027 
00028 #define BAMF_TYPE_VIEW                    (bamf_view_get_type ())
00029 #define BAMF_VIEW(obj)                    (G_TYPE_CHECK_INSTANCE_CAST ((obj), BAMF_TYPE_VIEW, BamfView))
00030 #define BAMF_IS_VIEW(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BAMF_TYPE_VIEW))
00031 #define BAMF_VIEW_CLASS(klass)            (G_TYPE_CHECK_CLASS_CAST ((klass), BAMF_TYPE_VIEW, BamfViewClass))
00032 #define BAMF_IS_VIEW_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), BAMF_TYPE_VIEW))
00033 #define BAMF_VIEW_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), BAMF_TYPE_VIEW, BamfViewClass))
00034 
00035 typedef struct _BamfView BamfView;
00036 typedef struct _BamfViewClass BamfViewClass;
00037 typedef struct _BamfViewPrivate BamfViewPrivate;
00038 
00039 struct _BamfViewClass
00040 {
00041   BamfDBusItemObjectSkeletonClass parent;
00042   GList *names;
00043 
00044   /*< methods >*/
00045   const char * (*view_type)                 (BamfView *view);
00046   char *       (*stable_bus_name)           (BamfView *view);
00047   const char * (*get_name)                  (BamfView *view);
00048   const char * (*get_icon)                  (BamfView *view);
00049 
00050   /*< random stuff >*/
00051   gboolean (* urgent_changed)       (BamfView *view, gboolean urgent);
00052   gboolean (* running_changed)      (BamfView *view, gboolean running);
00053   gboolean (* active_changed)       (BamfView *view, gboolean active);
00054   gboolean (* user_visible_changed) (BamfView *view, gboolean visible);
00055   gboolean (* closed)               (BamfView *view);
00056 
00057   /*< signals >*/
00058   void   (*child_added)   (BamfView *view, BamfView *child);
00059   void   (*child_removed) (BamfView *view, BamfView *child);
00060   void   (*exported)      (BamfView *view);
00061   void   (*name_changed)  (BamfView *view, const gchar* old_name, const gchar* new_name);
00062 };
00063 
00064 struct _BamfView
00065 {
00066   BamfDBusItemObjectSkeleton parent;
00067 
00068   /* private */
00069   BamfViewPrivate *priv;
00070 };
00071 
00072 GType         bamf_view_get_type           (void) G_GNUC_CONST;
00073 
00074 void          bamf_view_close              (BamfView *view);
00075 
00076 GVariant    * bamf_view_get_children_paths (BamfView *view);
00077 
00078 GList       * bamf_view_get_children       (BamfView *view);
00079 
00080 GVariant    * bamf_view_get_parent_paths   (BamfView *view);
00081 
00082 GList       * bamf_view_get_parents        (BamfView *view);
00083 
00084 const char  * bamf_view_get_path           (BamfView *view);
00085 
00086 void          bamf_view_add_child          (BamfView *view, BamfView *child);
00087 void          bamf_view_remove_child       (BamfView *view, BamfView *child);
00088 
00089 gboolean      bamf_view_is_active          (BamfView *view);
00090 void          bamf_view_set_active         (BamfView *view, gboolean active);
00091 
00092 gboolean      bamf_view_is_running         (BamfView *view);
00093 void          bamf_view_set_running        (BamfView *view, gboolean running);
00094 
00095 gboolean      bamf_view_user_visible       (BamfView *view);
00096 void          bamf_view_set_user_visible   (BamfView *view, gboolean user_visible);
00097 
00098 gboolean      bamf_view_is_urgent          (BamfView *view);
00099 void          bamf_view_set_urgent         (BamfView *view, gboolean urgent);
00100 
00101 const char  * bamf_view_get_icon           (BamfView *view);
00102 
00103 const char  * bamf_view_get_name           (BamfView *view);
00104 void          bamf_view_set_name           (BamfView *view, const char * name);
00105 
00106 const char  * bamf_view_get_parent_path    (BamfView *view);
00107 
00108 BamfView    * bamf_view_get_parent         (BamfView *view);
00109 void          bamf_view_set_parent         (BamfView *view, BamfView *parent);
00110 
00111 const char  * bamf_view_get_view_type      (BamfView *view);
00112 
00113 gboolean      bamf_view_is_on_bus          (BamfView *view);
00114 const char  * bamf_view_export_on_bus      (BamfView *view,
00115                                             GDBusConnection *connection);
00116 
00117 #endif