add new sigc++2 directory
[ardour.git] / libs / gtkmm2 / gtk / src / recentinfo.hg
1 /* Copyright (C) 2006 The gtkmm Development Team
2  *
3  * This library is free software; you can redistribute it and/or
4  * modify it under the terms of the GNU Library General Public
5  * License as published by the Free Software Foundation; either
6  * version 2 of the License, or (at your option) any later version.
7  *
8  * This library is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11  * Library General Public License for more details.
12  *
13  * You should have received a copy of the GNU Library General Public
14  * License along with this library; if not, write to the Free
15  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
16  */
17
18 #include <gdkmm/pixbuf.h>
19
20 #include <time.h>
21
22 _DEFS(gtkmm,gtk)
23
24 #ifndef DOXYGEN_SHOULD_SKIP_THIS
25 typedef struct _GtkRecentInfo GtkRecentInfo;
26 #endif //DOXYGEN_SHOULD_SKIP_THIS
27
28 namespace Gtk
29 {
30
31
32 /** Contains informations found when looking up an entry of the
33  * recently used files list.
34  *
35  * @newin2p10
36  *
37  * @ingroup RecentFiles
38  */
39 class RecentInfo
40 {
41   _CLASS_OPAQUE_REFCOUNTED(RecentInfo, GtkRecentInfo, NONE, gtk_recent_info_ref, gtk_recent_info_unref)
42   _IGNORE(gtk_recent_info_ref, gtk_recent_info_unref)
43 public:
44
45   bool equal(const RecentInfo& other) const;
46   /// Tests whether the RecentInfo is valid.
47   operator bool() const;
48
49   _WRAP_METHOD(Glib::ustring get_uri() const, gtk_recent_info_get_uri)
50   _WRAP_METHOD(Glib::ustring get_display_name() const, gtk_recent_info_get_display_name)
51   _WRAP_METHOD(Glib::ustring get_description() const, gtk_recent_info_get_description)
52   _WRAP_METHOD(Glib::ustring get_mime_type() const, gtk_recent_info_get_mime_type)
53   
54   _WRAP_METHOD(time_t get_added() const, gtk_recent_info_get_added)
55   _WRAP_METHOD(time_t get_modified() const, gtk_recent_info_get_modified)
56   _WRAP_METHOD(time_t get_visited() const, gtk_recent_info_get_visited)
57   
58   _WRAP_METHOD(bool get_private_hint() const, gtk_recent_info_get_private_hint)
59
60   _WRAP_METHOD(bool get_application_info(const Glib::ustring& app_name, Glib::StringArrayHandle& app_exec, guint& count, time_t& time) const, gtk_recent_info_get_application_info)
61   Glib::StringArrayHandle get_applications() const;
62   _IGNORE(gtk_recent_info_get_applications)
63   //_WRAP_METHOD(Glib::StringArrayHandle get_applications(unsigned& length) const, gtk_recent_info_get_applications)
64   _WRAP_METHOD(Glib::ustring last_application() const, gtk_recent_info_last_application)
65   _WRAP_METHOD(bool has_application(const Glib::ustring& app_name) const, gtk_recent_info_has_application)
66   
67   Glib::StringArrayHandle get_groups() const;
68   _IGNORE(gtk_recent_info_get_groups)
69   //_WRAP_METHOD(Glib::StringArrayHandle get_groups(unsigned& length) const, gtk_recent_info_get_groups)
70   _WRAP_METHOD(bool has_group(const Glib::ustring& group) const, gtk_recent_info_has_group)
71   
72   _WRAP_METHOD(Glib::RefPtr<Gdk::Pixbuf> get_icon(int size), gtk_recent_info_get_icon, refreturn)
73   _WRAP_METHOD(Glib::RefPtr<const Gdk::Pixbuf> get_icon(int size) const, gtk_recent_info_get_icon, refreturn)
74   
75   _WRAP_METHOD(Glib::ustring get_short_name() const, gtk_recent_info_get_short_name)
76   _WRAP_METHOD(Glib::ustring get_uri_display() const, gtk_recent_info_get_uri_display)
77   
78   _WRAP_METHOD(int get_age() const, gtk_recent_info_get_age)
79   _WRAP_METHOD(bool is_local() const, gtk_recent_info_is_local)
80   _WRAP_METHOD(bool exists() const, gtk_recent_info_exists)
81
82   _IGNORE(gtk_recent_info_match)
83   //_WRAP_METHOD(bool match(const RecentInfo& b) const, gtk_recent_info_match)
84 };
85
86
87 #ifndef DOXYGEN_SHOULD_SKIP_THIS
88
89 struct RecentInfoTraits
90 {
91   typedef Glib::RefPtr<RecentInfo> CppType;
92   typedef const GtkRecentInfo* CType;
93   typedef GtkRecentInfo* CTypeNonConst;
94
95   static CType to_c_type(const CppType& obj) { return Glib::unwrap(obj); }
96   static CType to_c_type(const CType& obj) { return obj; }
97   static CppType to_cpp_type(const CType& obj); //Implemented in the .cpp file
98   static void release_c_type(const CType& /* obj */) { /* gtk_recent_info_unref(const_cast<CTypeNonConst>(obj)); */}
99 };
100 #endif
101
102 //TODO: We normally put these inside the class:
103
104 /** @relates Gtk::RecentInfo */
105 inline bool operator==(const RecentInfo& lhs, const RecentInfo& rhs)
106   { return lhs.equal(rhs); }
107
108 /** @relates Gtk::RecentInfo */
109 inline bool operator!=(const RecentInfo& lhs, const RecentInfo& rhs)
110   { return !lhs.equal(rhs); }
111
112 } // namespace Gtk