2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _GTKMM_RECENTCHOOSER_H
4 #define _GTKMM_RECENTCHOOSER_H
9 /* Copyright (C) 2006 The gtkmm Development Team
11 * This library is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Library General Public
13 * License as published by the Free Software Foundation; either
14 * version 2 of the License, or (at your option) any later version.
16 * This library is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Library General Public License for more details.
21 * You should have received a copy of the GNU Library General Public
22 * License along with this library; if not, write to the Free
23 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26 #include <gtk/gtkrecentchooser.h>
27 #include <glibmm/interface.h>
28 #include <gtkmm/recentinfo.h>
29 #include <gtkmm/recentfilter.h>
30 #include <gtkmm/recentmanager.h>
33 #ifndef DOXYGEN_SHOULD_SKIP_THIS
34 typedef struct _GtkRecentChooser GtkRecentChooser;
35 typedef struct _GtkRecentChooserClass GtkRecentChooserClass;
36 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
40 { class RecentChooser_Class; } // namespace Gtk
44 /** @addtogroup gtkmmEnums Enums and Flags */
60 #ifndef DOXYGEN_SHOULD_SKIP_THIS
65 class Value<Gtk::RecentSortType> : public Glib::Value_Enum<Gtk::RecentSortType>
68 static GType value_type() G_GNUC_CONST;
72 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
79 /** Exception class for Gtk::RecentChooser errors.
81 class RecentChooserError : public Glib::Error
90 RecentChooserError(Code error_code, const Glib::ustring& error_message);
91 explicit RecentChooserError(GError* gobject);
94 #ifndef DOXYGEN_SHOULD_SKIP_THIS
97 #ifdef GLIBMM_EXCEPTIONS_ENABLED
98 static void throw_func(GError* gobject);
100 //When not using exceptions, we just pass the Exception object around without throwing it:
101 static std::auto_ptr<Glib::Error> throw_func(GError* gobject);
102 #endif //GLIBMM_EXCEPTIONS_ENABLED
104 friend void wrap_init(); // uses throw_func()
110 #ifndef DOXYGEN_SHOULD_SKIP_THIS
115 class Value<Gtk::RecentChooserError::Code> : public Glib::Value_Enum<Gtk::RecentChooserError::Code>
118 static GType value_type() G_GNUC_CONST;
122 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
129 /** RecentChooser is an interface that can be implemented by widgets
130 * displaying the list of recently used files. In GTK+, the main objects
131 * that implement this interface are RecentChooserWidget, RecentChooserDialog
132 * and RecentChooserMenu.
136 * @ingroup RecentFiles
139 class RecentChooser : public Glib::Interface
142 #ifndef DOXYGEN_SHOULD_SKIP_THIS
145 typedef RecentChooser CppObjectType;
146 typedef RecentChooser_Class CppClassType;
147 typedef GtkRecentChooser BaseObjectType;
148 typedef GtkRecentChooserIface BaseClassType;
151 friend class RecentChooser_Class;
152 static CppClassType recentchooser_class_;
155 RecentChooser(const RecentChooser&);
156 RecentChooser& operator=(const RecentChooser&);
159 RecentChooser(); // you must derive from this class
160 explicit RecentChooser(GtkRecentChooser* castitem);
162 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
165 virtual ~RecentChooser();
167 static void add_interface(GType gtype_implementer);
169 #ifndef DOXYGEN_SHOULD_SKIP_THIS
170 static GType get_type() G_GNUC_CONST;
171 static GType get_base_type() G_GNUC_CONST;
174 ///Provides access to the underlying C GObject.
175 GtkRecentChooser* gobj() { return reinterpret_cast<GtkRecentChooser*>(gobject_); }
177 ///Provides access to the underlying C GObject.
178 const GtkRecentChooser* gobj() const { return reinterpret_cast<GtkRecentChooser*>(gobject_); }
185 void set_show_private(bool show_private = true);
187 bool get_show_private() const;
189 void set_show_not_found(bool show_not_found = true);
191 bool get_show_not_found() const;
193 void set_select_multiple(bool select_multiple = true);
195 bool get_select_multiple() const;
197 void set_limit(int limit);
200 int get_limit() const;
202 void set_local_only(bool local_only = true);
204 bool get_local_only() const;
206 void set_show_tips(bool show_tips = true);
208 bool get_show_tips() const;
210 // TODO: These methods are declared in gtkrecentchooser.h but throw errors when
211 // using them on RecentChooserWidget or RecentChooserDialog.
212 // RecentChooserMenu reimplements them.
213 // In an email titled "GtkRecentChooser API glitch", Emmanuele Bassi said that these would be
214 // deprecated in GTK+ 2.12. murrayc.
215 //_WRAP_METHOD(void set_show_numbers(bool show_numbers = true), gtk_recent_chooser_set_show_numbers)
216 //_WRAP_METHOD(bool get_show_numbers() const, gtk_recent_chooser_get_show_numbers)
219 void set_show_icons(bool show_icons = true);
221 bool get_show_icons() const;
223 void set_sort_type(RecentSortType sort_type);
225 RecentSortType get_sort_type() const;
228 /** This callback should return -1 if b compares before a, 0 if they compare
229 * equal and 1 if a compares after b.
230 * For instance, int on_sort_compare(const Glib::RefPtr<Gtk::RecentInfo>& a, const Gtk::RecentInfo& b);
232 typedef sigc::slot<int, const Glib::RefPtr<RecentInfo>&, const Glib::RefPtr<RecentInfo>&> SlotCompare;
235 /** Sets the comparison function used when sorting the list of recently
236 * used resources and the sort type is #RECENT_SORT_CUSTOM.
238 void set_sort_func(const SlotCompare& slot);
240 // TODO: Return type should be void since it will never return false but
241 // throwing RecentChooserError instead
243 #ifdef GLIBMM_EXCEPTIONS_ENABLED
244 bool set_current_uri(const Glib::ustring& uri);
246 bool set_current_uri(const Glib::ustring& uri, std::auto_ptr<Glib::Error>& error);
247 #endif //GLIBMM_EXCEPTIONS_ENABLED
250 Glib::ustring get_current_uri() const;
252 Glib::RefPtr<RecentInfo> get_current_item();
254 Glib::RefPtr<const RecentInfo> get_current_item() const;
257 #ifdef GLIBMM_EXCEPTIONS_ENABLED
258 bool select_uri(const Glib::ustring& uri);
260 bool select_uri(const Glib::ustring& uri, std::auto_ptr<Glib::Error>& error);
261 #endif //GLIBMM_EXCEPTIONS_ENABLED
264 void unselect_uri(const Glib::ustring& uri);
270 typedef Glib::ListHandle<RecentInfo, RecentInfoTraits> ListHandle_RecentInfos;
273 ListHandle_RecentInfos get_items() const;
275 /** Gets the URI of the recently used resources.
277 * The return value of this function is affected by the "sort-type" and
278 * "limit" properties of the recent chooser.
280 Glib::StringArrayHandle get_uris() const;
283 void add_filter(const RecentFilter& filter);
285 void remove_filter(const RecentFilter& filter);
287 Glib::SListHandle<RecentFilter*> list_filters();
289 Glib::SListHandle<const RecentFilter*> list_filters() const;
291 void set_filter(const RecentFilter& filter);
293 RecentFilter* get_filter();
295 const RecentFilter* get_filter() const;
297 /** This signal is emitted when there is a change in the set of
298 * selected recently used resources. This can happen when a user
299 * modifies the selection with the mouse or the keyboard, or when
300 * explicitely calling functions to change the selection.
305 * <tt>void %selection_changed()</tt>
308 Glib::SignalProxy0< void > signal_selection_changed();
311 /** This signal is emitted when the user "activates" a recent item
312 * in the recent chooser. This can happen by double-clicking on an item
313 * in the recently used resources list, or by pressing
314 * <keycap>Enter</keycap>.
319 * <tt>void %item_activated()</tt>
322 Glib::SignalProxy0< void > signal_item_activated();
325 #ifdef GLIBMM_PROPERTIES_ENABLED
328 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
329 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
330 * the value of the property changes.
332 Glib::PropertyProxy_ReadOnly< Glib::RefPtr<RecentManager> > property_recent_manager() const;
333 #endif //#GLIBMM_PROPERTIES_ENABLED
336 #ifdef GLIBMM_PROPERTIES_ENABLED
339 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
340 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
341 * the value of the property changes.
343 Glib::PropertyProxy<bool> property_show_private() ;
344 #endif //#GLIBMM_PROPERTIES_ENABLED
346 #ifdef GLIBMM_PROPERTIES_ENABLED
349 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
350 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
351 * the value of the property changes.
353 Glib::PropertyProxy_ReadOnly<bool> property_show_private() const;
354 #endif //#GLIBMM_PROPERTIES_ENABLED
356 #ifdef GLIBMM_PROPERTIES_ENABLED
359 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
360 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
361 * the value of the property changes.
363 Glib::PropertyProxy<bool> property_show_tips() ;
364 #endif //#GLIBMM_PROPERTIES_ENABLED
366 #ifdef GLIBMM_PROPERTIES_ENABLED
369 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
370 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
371 * the value of the property changes.
373 Glib::PropertyProxy_ReadOnly<bool> property_show_tips() const;
374 #endif //#GLIBMM_PROPERTIES_ENABLED
376 #ifdef GLIBMM_PROPERTIES_ENABLED
379 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
380 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
381 * the value of the property changes.
383 Glib::PropertyProxy<bool> property_show_icons() ;
384 #endif //#GLIBMM_PROPERTIES_ENABLED
386 #ifdef GLIBMM_PROPERTIES_ENABLED
389 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
390 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
391 * the value of the property changes.
393 Glib::PropertyProxy_ReadOnly<bool> property_show_icons() const;
394 #endif //#GLIBMM_PROPERTIES_ENABLED
396 #ifdef GLIBMM_PROPERTIES_ENABLED
399 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
400 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
401 * the value of the property changes.
403 Glib::PropertyProxy<bool> property_show_not_found() ;
404 #endif //#GLIBMM_PROPERTIES_ENABLED
406 #ifdef GLIBMM_PROPERTIES_ENABLED
409 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
410 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
411 * the value of the property changes.
413 Glib::PropertyProxy_ReadOnly<bool> property_show_not_found() const;
414 #endif //#GLIBMM_PROPERTIES_ENABLED
416 #ifdef GLIBMM_PROPERTIES_ENABLED
419 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
420 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
421 * the value of the property changes.
423 Glib::PropertyProxy<bool> property_select_multiple() ;
424 #endif //#GLIBMM_PROPERTIES_ENABLED
426 #ifdef GLIBMM_PROPERTIES_ENABLED
429 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
430 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
431 * the value of the property changes.
433 Glib::PropertyProxy_ReadOnly<bool> property_select_multiple() const;
434 #endif //#GLIBMM_PROPERTIES_ENABLED
436 #ifdef GLIBMM_PROPERTIES_ENABLED
439 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
440 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
441 * the value of the property changes.
443 Glib::PropertyProxy<bool> property_local_only() ;
444 #endif //#GLIBMM_PROPERTIES_ENABLED
446 #ifdef GLIBMM_PROPERTIES_ENABLED
449 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
450 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
451 * the value of the property changes.
453 Glib::PropertyProxy_ReadOnly<bool> property_local_only() const;
454 #endif //#GLIBMM_PROPERTIES_ENABLED
456 #ifdef GLIBMM_PROPERTIES_ENABLED
459 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
460 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
461 * the value of the property changes.
463 Glib::PropertyProxy<int> property_limit() ;
464 #endif //#GLIBMM_PROPERTIES_ENABLED
466 #ifdef GLIBMM_PROPERTIES_ENABLED
469 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
470 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
471 * the value of the property changes.
473 Glib::PropertyProxy_ReadOnly<int> property_limit() const;
474 #endif //#GLIBMM_PROPERTIES_ENABLED
476 #ifdef GLIBMM_PROPERTIES_ENABLED
479 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
480 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
481 * the value of the property changes.
483 Glib::PropertyProxy<RecentSortType> property_sort_type() ;
484 #endif //#GLIBMM_PROPERTIES_ENABLED
486 #ifdef GLIBMM_PROPERTIES_ENABLED
489 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
490 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
491 * the value of the property changes.
493 Glib::PropertyProxy_ReadOnly<RecentSortType> property_sort_type() const;
494 #endif //#GLIBMM_PROPERTIES_ENABLED
496 #ifdef GLIBMM_PROPERTIES_ENABLED
499 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
500 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
501 * the value of the property changes.
503 Glib::PropertyProxy<RecentFilter*> property_filter() ;
504 #endif //#GLIBMM_PROPERTIES_ENABLED
506 #ifdef GLIBMM_PROPERTIES_ENABLED
509 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
510 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
511 * the value of the property changes.
513 Glib::PropertyProxy_ReadOnly<RecentFilter*> property_filter() const;
514 #endif //#GLIBMM_PROPERTIES_ENABLED
522 // TODO: How to wrap those vfuncs?
524 //__CONVERSION(`ListHandle_RecentInfos', `GList*', `($3).data()')
525 //__CONVERSION(`Glib::SListHandle<RecentFilter*>', `GSList*', `($3).data()')
527 //_WRAP_VFUNC(bool set_current_uri(const Glib::ustring& uri), "set_current_uri", errthrow)
528 #ifdef GLIBMM_VFUNCS_ENABLED
529 virtual Glib::ustring get_current_uri_vfunc() const;
530 #endif //GLIBMM_VFUNCS_ENABLED
532 //_WRAP_VFUNC(bool select_uri(const Glib::ustring& uri), "select_uri", errthrow)
533 #ifdef GLIBMM_VFUNCS_ENABLED
534 virtual void unselect_uri_vfunc(const Glib::ustring& uri);
535 #endif //GLIBMM_VFUNCS_ENABLED
537 #ifdef GLIBMM_VFUNCS_ENABLED
538 virtual void select_all_vfunc();
539 #endif //GLIBMM_VFUNCS_ENABLED
541 #ifdef GLIBMM_VFUNCS_ENABLED
542 virtual void unselect_all_vfunc();
543 #endif //GLIBMM_VFUNCS_ENABLED
545 //_WRAP_VFUNC(ArrayHandle_RecentInfos get_items() const, "get_items")
546 #ifdef GLIBMM_VFUNCS_ENABLED
547 virtual Glib::RefPtr<RecentManager> get_recent_manager_vfunc();
548 #endif //GLIBMM_VFUNCS_ENABLED
550 #ifdef GLIBMM_VFUNCS_ENABLED
551 virtual void add_filter_vfunc(const RecentFilter& filter);
552 #endif //GLIBMM_VFUNCS_ENABLED
554 #ifdef GLIBMM_VFUNCS_ENABLED
555 virtual void remove_filter_vfunc(const RecentFilter& filter);
556 #endif //GLIBMM_VFUNCS_ENABLED
558 //_WRAP_VFUNC(Glib::SListHandle<RecentFilter*> list_filters(), "list_filters")
559 //_WRAP_VFUNC(void set_sort_func(const SlotCompare& slot), "set_sort_func")
565 //C++ methods used to invoke GTK+ virtual functions:
566 #ifdef GLIBMM_VFUNCS_ENABLED
567 #endif //GLIBMM_VFUNCS_ENABLED
570 //GTK+ Virtual Functions (override these to change behaviour):
571 #ifdef GLIBMM_VFUNCS_ENABLED
572 #endif //GLIBMM_VFUNCS_ENABLED
574 //Default Signal Handlers::
575 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
576 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
586 /** @relates Gtk::RecentChooser
587 * @param object The C instance
588 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
589 * @result A C++ instance that wraps this C instance.
591 Glib::RefPtr<Gtk::RecentChooser> wrap(GtkRecentChooser* object, bool take_copy = false);
596 #endif /* _GTKMM_RECENTCHOOSER_H */