thumbnail.h

Go to the documentation of this file.
00001 // -*- c++ -*-
00002 // Generated by gtkmmproc -- DO NOT MODIFY!
00003 #ifndef _LIBGNOMEUIMM_THUMBNAIL_H
00004 #define _LIBGNOMEUIMM_THUMBNAIL_H
00005 
00006 
00007 #include <glibmm.h>
00008 
00009 /* thumbnail.hg
00010  * 
00011  * Copyright (C) 1999 The Gtk-- Development Team
00012  *
00013  * This library is free software; you can redistribute it and/or
00014  * modify it under the terms of the GNU Library General Public
00015  * License as published by the Free Software Foundation; either
00016  * version 2 of the License, or (at your option) any later version.
00017  *
00018  * This library is distributed in the hope that it will be useful,
00019  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00020  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00021  * Library General Public License for more details.
00022  *
00023  * You should have received a copy of the GNU Library General Public
00024  * License along with this library; if not, write to the Free
00025  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00026  */
00027 
00028 #include <glibmm/object.h>
00029 #include <gdkmm/pixbuf.h>
00030 
00031 
00032 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00033 typedef struct _GnomeThumbnailFactory GnomeThumbnailFactory;
00034 typedef struct _GnomeThumbnailFactoryClass GnomeThumbnailFactoryClass;
00035 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00036 
00037 
00038 namespace Gnome
00039 {
00040 
00041 namespace UI
00042 { class ThumbnailFactory_Class; } // namespace UI
00043 
00044 } // namespace Gnome
00045 namespace Gnome
00046 {
00047 
00048 namespace UI
00049 {
00050 
00056 enum ThumbnailSize
00057 {
00058   THUMBNAIL_SIZE_NORMAL,
00059   THUMBNAIL_SIZE_LARGE
00060 };
00061 
00062 
00063 class ThumbnailFactory : public Glib::Object
00064 {
00065   
00066 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00067 
00068 public:
00069   typedef ThumbnailFactory CppObjectType;
00070   typedef ThumbnailFactory_Class CppClassType;
00071   typedef GnomeThumbnailFactory BaseObjectType;
00072   typedef GnomeThumbnailFactoryClass BaseClassType;
00073 
00074 private:  friend class ThumbnailFactory_Class;
00075   static CppClassType thumbnailfactory_class_;
00076 
00077 private:
00078   // noncopyable
00079   ThumbnailFactory(const ThumbnailFactory&);
00080   ThumbnailFactory& operator=(const ThumbnailFactory&);
00081 
00082 protected:
00083   explicit ThumbnailFactory(const Glib::ConstructParams& construct_params);
00084   explicit ThumbnailFactory(GnomeThumbnailFactory* castitem);
00085 
00086 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00087 
00088 public:
00089   virtual ~ThumbnailFactory();
00090 
00091 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00092   static GType get_type()      G_GNUC_CONST;
00093   static GType get_base_type() G_GNUC_CONST;
00094 #endif
00095 
00097   GnomeThumbnailFactory*       gobj()       { return reinterpret_cast<GnomeThumbnailFactory*>(gobject_); }
00098 
00100   const GnomeThumbnailFactory* gobj() const { return reinterpret_cast<GnomeThumbnailFactory*>(gobject_); }
00101 
00103   GnomeThumbnailFactory* gobj_copy();
00104 
00105 private:
00106 
00107 public:
00108   static Glib::RefPtr<ThumbnailFactory> create(ThumbnailSize size);
00109 
00110   
00111   Glib::ustring lookup(const Glib::ustring& uri, time_t mtime) const;
00112   
00113   bool has_valid_failed_thumbnail(const Glib::ustring& uri, time_t mtime) const;
00114   
00115   bool can_thumbnail(const Glib::ustring& uri, const Glib::ustring& mime_type, time_t mtime) const;
00116   
00117   Glib::RefPtr<Gdk::Pixbuf> generate_thumbnail(const Glib::ustring& uri, const Glib::ustring& mime_type) const;
00118   
00119   void save_thumbnail(const Glib::RefPtr<Gdk::Pixbuf>& thumbnail, const Glib::ustring& uri, time_t original_mtime);
00120   
00121   void create_failed_thumbnail(const Glib::ustring& uri, time_t mtime) const;
00122 
00123 
00124 public:
00125 
00126 public:
00127   //C++ methods used to invoke GTK+ virtual functions:
00128 #ifdef GLIBMM_VFUNCS_ENABLED
00129 #endif //GLIBMM_VFUNCS_ENABLED
00130 
00131 protected:
00132   //GTK+ Virtual Functions (override these to change behaviour):
00133 #ifdef GLIBMM_VFUNCS_ENABLED
00134 #endif //GLIBMM_VFUNCS_ENABLED
00135 
00136   //Default Signal Handlers::
00137 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00138 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00139 
00140 
00141 };
00142 
00143 /* Thumbnailing utils: */
00144 bool thumbnail_has_uri(const Glib::RefPtr<Gdk::Pixbuf>& pixbuf, const Glib::ustring& uri);
00145 bool thumbnail_is_valid(const Glib::RefPtr<Gdk::Pixbuf>& pixbuf, const Glib::ustring& uri, time_t mtime);
00146 
00147 Glib::ustring thumbnail_md5(const Glib::ustring& uri);
00148 Glib::ustring thumbnail_path_for_uri(const Glib::ustring& uri, ThumbnailSize size);
00149 
00150 /* Pixbuf utils: */
00151 Glib::RefPtr<Gdk::Pixbuf> thumbnail_scale_down_pixbuf(const Glib::RefPtr<Gdk::Pixbuf>& pixbuf, int dest_width, int dest_height);
00152 
00153 } /* namespace UI */
00154 } /* namespace Gnome */
00155 
00156 
00157 namespace Glib
00158 {
00167   Glib::RefPtr<Gnome::UI::ThumbnailFactory> wrap(GnomeThumbnailFactory* object, bool take_copy = false);
00168 }
00169 
00170 
00171 #endif /* _LIBGNOMEUIMM_THUMBNAIL_H */
00172 

Generated on Mon Sep 17 20:32:52 2007 for libgnomeuimm by  doxygen 1.5.3