libgnomeuimm 2.28.0

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 Lesser General Public
00015  * License as published by the Free Software Foundation; either
00016  * version 2.1 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  * Lesser General Public License for more details.
00022  *
00023  * You should have received a copy of the GNU Lesser 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 
00094 
00095   static GType get_base_type() G_GNUC_CONST;
00096 #endif
00097 
00099   GnomeThumbnailFactory*       gobj()       { return reinterpret_cast<GnomeThumbnailFactory*>(gobject_); }
00100 
00102   const GnomeThumbnailFactory* gobj() const { return reinterpret_cast<GnomeThumbnailFactory*>(gobject_); }
00103 
00105   GnomeThumbnailFactory* gobj_copy();
00106 
00107 private:
00108 
00109 public:
00110   static Glib::RefPtr<ThumbnailFactory> create(ThumbnailSize size);
00111 
00112   
00113   Glib::ustring lookup(const Glib::ustring& uri, time_t mtime) const;
00114   
00115   bool has_valid_failed_thumbnail(const Glib::ustring& uri, time_t mtime) const;
00116   
00117   bool can_thumbnail(const Glib::ustring& uri, const Glib::ustring& mime_type, time_t mtime) const;
00118   
00119   Glib::RefPtr<Gdk::Pixbuf> generate_thumbnail(const Glib::ustring& uri, const Glib::ustring& mime_type) const;
00120   
00121   void save_thumbnail(const Glib::RefPtr<Gdk::Pixbuf>& thumbnail, const Glib::ustring& uri, time_t original_mtime);
00122   
00123   void create_failed_thumbnail(const Glib::ustring& uri, time_t mtime) const;
00124 
00125 
00126 public:
00127 
00128 public:
00129   //C++ methods used to invoke GTK+ virtual functions:
00130 #ifdef GLIBMM_VFUNCS_ENABLED
00131 #endif //GLIBMM_VFUNCS_ENABLED
00132 
00133 protected:
00134   //GTK+ Virtual Functions (override these to change behaviour):
00135 #ifdef GLIBMM_VFUNCS_ENABLED
00136 #endif //GLIBMM_VFUNCS_ENABLED
00137 
00138   //Default Signal Handlers::
00139 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00140 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00141 
00142 
00143 };
00144 
00145 /* Thumbnailing utils: */
00146 bool thumbnail_has_uri(const Glib::RefPtr<Gdk::Pixbuf>& pixbuf, const Glib::ustring& uri);
00147 bool thumbnail_is_valid(const Glib::RefPtr<Gdk::Pixbuf>& pixbuf, const Glib::ustring& uri, time_t mtime);
00148 
00149 Glib::ustring thumbnail_md5(const Glib::ustring& uri);
00150 Glib::ustring thumbnail_path_for_uri(const Glib::ustring& uri, ThumbnailSize size);
00151 
00152 /* Pixbuf utils: */
00153 Glib::RefPtr<Gdk::Pixbuf> thumbnail_scale_down_pixbuf(const Glib::RefPtr<Gdk::Pixbuf>& pixbuf, int dest_width, int dest_height);
00154 
00155 } /* namespace UI */
00156 } /* namespace Gnome */
00157 
00158 
00159 namespace Glib
00160 {
00169   Glib::RefPtr<Gnome::UI::ThumbnailFactory> wrap(GnomeThumbnailFactory* object, bool take_copy = false);
00170 }
00171 
00172 
00173 #endif /* _LIBGNOMEUIMM_THUMBNAIL_H */
00174