Main Page | Directories | File List | File Members

background-manager.h

00001 /* -*- mode:C; c-file-style:"gnu"; -*- */
00002 /*
00003  * This file is part of maemo-af-desktop
00004  *
00005  * Copyright (C) 2006 Nokia Corporation.
00006  *
00007  * Contact: Karoliina Salminen <karoliina.t.salminen@nokia.com>
00008  *
00009  * This library is free software; you can redistribute it and/or
00010  * modify it under the terms of the GNU Lesser General Public License
00011  * version 2.1 as published by the Free Software Foundation.
00012  *
00013  * This library is distributed in the hope that it will be useful, but
00014  * WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00016  * Lesser General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU Lesser General Public
00019  * License along with this library; if not, write to the Free Software
00020  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
00021  * 02110-1301 USA
00022  *
00023  */
00024 
00025 #ifndef __BACKGROUND_MANAGER_H__
00026 #define __BACKGROUND_MANAGER_H__
00027 
00028 #include <glib-object.h>
00029 #include <gdk/gdkcolor.h>
00030 #include <gdk/gdkwindow.h>
00031 
00032 #define TYPE_BACKGROUND_MODE            (background_mode_get_type ())
00033 #define TYPE_BACKGROUND_MANAGER         (background_manager_get_type ())
00034 #define BACKGROUND_MANAGER_ERROR        (background_manager_error_quark ())
00035 
00036 #define BACKGROUND_MANAGER(obj)         (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_BACKGROUND_MANAGER, BackgroundManager))
00037 #define IS_BACKGROUND_MANAGER(obj)      (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_BACKGROUND_MANAGER))
00038 #define BACKGROUND_MANAGER_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_BACKGROUND_MANAGER, BackgroundManagerClass))
00039 #define IS_BACKGROUND_MANAGER_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_BACKGROUND_MANAGER))
00040 #define BACKGROUND_MANAGER_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_BACKGROUND_MANAGER, BackgroundManagerClass))
00041 
00042 #define HILDON_HOME_BACKGROUND_NO_IMAGE     "no_image"
00043 
00044 G_BEGIN_DECLS
00045 
00046 typedef struct _BackgroundManager       BackgroundManager;
00047 typedef struct _BackgroundManagerPrivate    BackgroundManagerPrivate;
00048 typedef struct _BackgroundManagerClass      BackgroundManagerClass;
00049 
00050 typedef enum {
00051   BACKGROUND_CENTERED,
00052   BACKGROUND_SCALED,
00053   BACKGROUND_STRETCHED,
00054   BACKGROUND_TILED
00055 } BackgroundMode;
00056 
00057 GType background_mode_get_type (void) G_GNUC_CONST;
00058 
00059 typedef enum {
00060   BACKGROUND_MANAGER_ERROR_MEMORY,
00061   BACKGROUND_MANAGER_ERROR_CONNECTIVITY,
00062   BACKGROUND_MANAGER_ERROR_CORRUPT,
00063   BACKGROUND_MANAGER_ERROR_UNREADABLE,
00064   BACKGROUND_MANAGER_ERROR_MMC_OPEN,
00065   BACKGROUND_MANAGER_ERROR_SYSTEM_RESOURCES,
00066   BACKGROUND_MANAGER_ERROR_FLASH_FULL,
00067   BACKGROUND_MANAGER_ERROR_IO,
00068 
00069   BACKGROUND_MANAGER_ERROR_UNKNOWN
00070 } BackgroundManagerError;
00071 
00072 GQuark background_manager_error_quark (void);
00073 
00074 
00075 struct _BackgroundManager
00076 {
00077   GObject parent_instance;
00078 
00079   BackgroundManagerPrivate *priv;
00080 };
00081 
00082 struct _BackgroundManagerClass
00083 {
00084   GObjectClass parent_class;
00085 
00086   void (*load_begin)    (BackgroundManager *manager);
00087   void (*load_complete) (BackgroundManager *manager);
00088   void (*load_cancel)   (BackgroundManager *manager);
00089   void (*load_error)    (BackgroundManager *manager,
00090                          const GError      *error);
00091   void (*preview)       (BackgroundManager *manager,
00092                  GdkPixbuf         *pixbuf);
00093   void (*changed)       (BackgroundManager *manager,
00094                  GdkPixbuf         *pixbuf);
00095 };
00096 
00097 GType                 background_manager_get_type          (void) G_GNUC_CONST;
00098 
00099 BackgroundManager *   background_manager_get_default       (void);
00100 
00101 GdkWindow *           background_manager_get_desktop       (BackgroundManager *manager);
00102 void                  background_manager_set_desktop       (BackgroundManager *manager,
00103                                                             GdkWindow         *window);
00104 G_CONST_RETURN gchar *background_manager_get_image_uri     (BackgroundManager *manager);
00105 void                  background_manager_set_image_uri     (BackgroundManager *manager,
00106                                     const gchar       *uri);
00107 BackgroundMode        background_manager_get_mode          (BackgroundManager *manager);
00108 void                  background_manager_set_mode          (BackgroundManager *manager,
00109                                 BackgroundMode     mode);
00110 void                  background_manager_get_color         (BackgroundManager *manager,
00111                                     GdkColor          *color);
00112 void                  background_manager_set_color         (BackgroundManager *manager,
00113                                 const GdkColor    *color);
00114 void                  background_manager_get_components    (BackgroundManager *manager,
00115                                 gchar             *titlebar,
00116                                 gchar             *sidebar);
00117 void                  background_manager_set_components    (BackgroundManager *manager,
00118                                 const gchar       *titlebar,
00119                                 const gchar       *sidebar,
00120                                                             gboolean           reload);
00121 G_CONST_RETURN gchar *background_manager_get_cache         (BackgroundManager *manager);
00122 void                  background_manager_set_cache         (BackgroundManager *manager,
00123                                     const gchar       *uri);
00124 
00125 void                  background_manager_push_preview_mode (BackgroundManager *manager);
00126 void                  background_manager_pop_preview_mode  (BackgroundManager *manager);
00127 gboolean              background_manager_apply_preview     (BackgroundManager *manager);
00128 void                  background_manager_update_preview    (BackgroundManager *manager);
00129 void                  background_manager_discard_preview   (BackgroundManager *manager,
00130                                                             gboolean           reload);
00131 
00132 gboolean              background_manager_refresh_from_cache (BackgroundManager *mananger);
00133 
00134 G_END_DECLS
00135 
00136 #endif /* __BACKGROUND_MANAGER_H__ */

Generated on Thu Dec 21 11:26:50 2006 for maemo-af-desktop-documentation by  doxygen 1.4.2