Back to index

bamf  0.2.120
bamf-indicator-source.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 __BAMF_INDICATOR_SOURCE_H__
00022 #define __BAMF_INDICATOR_SOURCE_H__
00023 
00024 #include <glib-object.h>
00025 #include "bamf-indicator.h"
00026 #include "bamf-gdbus-indicator-source-generated.h"
00027 
00028 G_BEGIN_DECLS
00029 
00030 #define BAMF_TYPE_INDICATOR_SOURCE               (bamf_indicator_source_get_type ())
00031 #define BAMF_INDICATOR_SOURCE(obj)               (G_TYPE_CHECK_INSTANCE_CAST ((obj), BAMF_TYPE_INDICATOR_SOURCE, BamfIndicatorSource))
00032 #define BAMF_INDICATOR_SOURCE_CONST(obj)         (G_TYPE_CHECK_INSTANCE_CAST ((obj), BAMF_TYPE_INDICATOR_SOURCE, BamfIndicatorSource const))
00033 #define BAMF_INDICATOR_SOURCE_CLASS(klass)              (G_TYPE_CHECK_CLASS_CAST ((klass), BAMF_TYPE_INDICATOR_SOURCE, BamfIndicatorSourceClass))
00034 #define BAMF_IS_INDICATOR_SOURCE(obj)            (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BAMF_TYPE_INDICATOR_SOURCE))
00035 #define BAMF_IS_INDICATOR_SOURCE_CLASS(klass)    (G_TYPE_CHECK_CLASS_TYPE ((klass), BAMF_TYPE_INDICATOR_SOURCE))
00036 #define BAMF_INDICATOR_SOURCE_GET_CLASS(obj)     (G_TYPE_INSTANCE_GET_CLASS ((obj), BAMF_TYPE_INDICATOR_SOURCE, BamfIndicatorSourceClass))
00037 
00038 typedef struct _BamfIndicatorSource       BamfIndicatorSource;
00039 typedef struct _BamfIndicatorSourceClass  BamfIndicatorSourceClass;
00040 typedef struct _BamfIndicatorSourcePrivate       BamfIndicatorSourcePrivate;
00041 
00042 enum
00043 {
00044   BAMF_INDICATOR_SOURCE_APPROVE_NONE,
00045   BAMF_INDICATOR_SOURCE_APPROVE_MATCHED,
00046   BAMF_INDICATOR_SOURCE_APPROVE_ALL
00047 };
00048 
00049 struct _BamfIndicatorSource {
00050   StatusNotifierApproverSkeleton parent;
00051 
00052   BamfIndicatorSourcePrivate *priv;
00053 };
00054 
00055 struct _BamfIndicatorSourceClass {
00056   StatusNotifierApproverSkeletonClass parent_class;
00057   
00058   /*< signals >*/
00059   void (*indicator_opened) (BamfIndicatorSource *approver, BamfIndicator *indicator);
00060   void (*indicator_closed) (BamfIndicatorSource *approver, BamfIndicator *indicator);
00061   void (*revise_judgement) (BamfIndicatorSource *approver, gboolean approve, char *addr, char *path);
00062   
00063   void (*padding1) (void);
00064   void (*padding2) (void);
00065   void (*padding3) (void);
00066   void (*padding4) (void);
00067   void (*padding5) (void);
00068 };
00069 
00070 GType bamf_indicator_source_get_type (void) G_GNUC_CONST;
00071 
00072 GList * bamf_indicator_source_get_indicators (BamfIndicatorSource *self);
00073 
00074 gboolean bamf_indicator_source_approve_item (BamfIndicatorSource *self,
00075                                              const char *id,
00076                                              const char *category,
00077                                              guint32 pid,
00078                                              const char *address,
00079                                              const char *proxy);
00080                                                   
00081 void bamf_indicator_source_set_behavior (BamfIndicatorSource *self,
00082                                          gint32 behavior);
00083 
00084 BamfIndicatorSource *bamf_indicator_source_get_default (void);
00085 
00086 G_END_DECLS
00087 
00088 #endif /* __BAMF_INDICATOR_SOURCE_H__ */