Back to index

bamf  0.2.120
bamf-factory.h
Go to the documentation of this file.
00001 /*
00002  * Copyright 2010 Canonical Ltd.
00003  *
00004  * This program is free software: you can redistribute it and/or modify it
00005  * under the terms of either or both of the following licenses:
00006  *
00007  * 1) the GNU Lesser General Public License version 3, as published by the
00008  * Free Software Foundation; and/or
00009  * 2) the GNU Lesser General Public License version 2.1, as published by
00010  * the Free Software Foundation.
00011  *
00012  * This program is distributed in the hope that it will be useful, but
00013  * WITHOUT ANY WARRANTY; without even the implied warranties of
00014  * MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
00015  * PURPOSE.  See the applicable version of the GNU Lesser General Public
00016  * License for more details.
00017  *
00018  * You should have received a copy of both the GNU Lesser General Public
00019  * License version 3 and version 2.1 along with this program.  If not, see
00020  * <http://www.gnu.org/licenses/>
00021  *
00022  * Authored by: Jason Smith <jason.smith@canonical.com>
00023  *              Neil Jagdish Patel <neil.patel@canonical.com>
00024  *
00025  */
00026 
00027 #ifndef _BAMF_FACTORY_H_
00028 #define _BAMF_FACTORY_H_
00029 
00030 #include <glib-object.h>
00031 #include <libbamf/bamf-view.h>
00032 #include <libbamf/bamf-application.h>
00033 
00034 G_BEGIN_DECLS
00035 
00036 #define BAMF_TYPE_FACTORY (bamf_factory_get_type ())
00037 
00038 #define BAMF_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj),\
00039         BAMF_TYPE_FACTORY, BamfFactory))
00040 
00041 #define BAMF_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass),\
00042         BAMF_TYPE_FACTORY, BamfFactoryClass))
00043 
00044 #define BAMF_IS_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj),\
00045         BAMF_TYPE_FACTORY))
00046 
00047 #define BAMF_IS_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),\
00048         BAMF_TYPE_FACTORY))
00049 
00050 #define BAMF_FACTORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj),\
00051         BAMF_TYPE_FACTORY, BamfFactoryClass))
00052 
00053 typedef struct _BamfFactory        BamfFactory;
00054 typedef struct _BamfFactoryClass   BamfFactoryClass;
00055 typedef struct _BamfFactoryPrivate BamfFactoryPrivate;
00056 
00057 typedef enum
00058 {
00059   BAMF_FACTORY_VIEW,
00060   BAMF_FACTORY_WINDOW,
00061   BAMF_FACTORY_APPLICATION,
00062   BAMF_FACTORY_INDICATOR,
00063   BAMF_FACTORY_NONE
00064 } BamfFactoryViewType;
00065 
00066 struct _BamfFactory
00067 {
00068   GObject parent;
00069 
00070   BamfFactoryPrivate *priv;
00071 };
00072 
00073 struct _BamfFactoryClass
00074 {
00075   GObjectClass parent_class;
00076 };
00077 
00078 GType             bamf_factory_get_type              (void) G_GNUC_CONST;
00079 
00080 BamfView        * _bamf_factory_view_for_path        (BamfFactory * factory,
00081                                                       const char * path);
00082 
00083 BamfView        * _bamf_factory_view_for_path_type   (BamfFactory * factory,
00084                                                       const char * path,
00085                                                       BamfFactoryViewType type);
00086 
00087 BamfView        * _bamf_factory_view_for_path_type_str (BamfFactory * factory,
00088                                                         const char * path,
00089                                                         const char * type);
00090 
00091 BamfApplication * _bamf_factory_app_for_file         (BamfFactory * factory,
00092                                                      const char * path,
00093                                                      gboolean create);
00094 
00095 BamfFactory     * _bamf_factory_get_default          (void);
00096 
00097 G_END_DECLS
00098 
00099 #endif