Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

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

Generated on Fri Aug 13 10:23:50 2004 for libgnomeuimm by doxygen 1.3.7