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 Lesser General Public
13
* License as published by the Free Software Foundation; either
14
* version 2.1 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
* Lesser General Public License for more details.
21
* You should have received a copy of the GNU Lesser 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.
28
#include <glibmm/interface.h>
29
#include <gtkmm/recentinfo.h>
30
#include <gtkmm/recentfilter.h>
31
#include <gtkmm/recentmanager.h>
34
#ifndef DOXYGEN_SHOULD_SKIP_THIS
37
typedef struct _GtkRecentChooserIface GtkRecentChooserIface;
39
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
41
#ifndef DOXYGEN_SHOULD_SKIP_THIS
42
typedef struct _GtkRecentChooser GtkRecentChooser;
43
typedef struct _GtkRecentChooserClass GtkRecentChooserClass;
44
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
48
{ class RecentChooser_Class; } // namespace Gtk
52
/** @addtogroup gtkmmEnums gtkmm Enums and Flags */
68
#ifndef DOXYGEN_SHOULD_SKIP_THIS
73
class Value<Gtk::RecentSortType> : public Glib::Value_Enum<Gtk::RecentSortType>
76
static GType value_type() G_GNUC_CONST;
80
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
87
/** Exception class for Gtk::RecentChooser errors.
89
class RecentChooserError : public Glib::Error
98
RecentChooserError(Code error_code, const Glib::ustring& error_message);
99
explicit RecentChooserError(GError* gobject);
102
#ifndef DOXYGEN_SHOULD_SKIP_THIS
105
static void throw_func(GError* gobject);
107
friend void wrap_init(); // uses throw_func()
109
#endif //DOXYGEN_SHOULD_SKIP_THIS
114
#ifndef DOXYGEN_SHOULD_SKIP_THIS
119
class Value<Gtk::RecentChooserError::Code> : public Glib::Value_Enum<Gtk::RecentChooserError::Code>
122
static GType value_type() G_GNUC_CONST;
126
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
133
/** RecentChooser is an interface that can be implemented by widgets
134
* displaying the list of recently used files. In GTK+, the main objects
135
* that implement this interface are RecentChooserWidget, RecentChooserDialog
136
* and RecentChooserMenu.
140
* @ingroup RecentFiles
143
class RecentChooser : public Glib::Interface
146
#ifndef DOXYGEN_SHOULD_SKIP_THIS
149
typedef RecentChooser CppObjectType;
150
typedef RecentChooser_Class CppClassType;
151
typedef GtkRecentChooser BaseObjectType;
152
typedef GtkRecentChooserIface BaseClassType;
155
friend class RecentChooser_Class;
156
static CppClassType recentchooser_class_;
159
RecentChooser(const RecentChooser&);
160
RecentChooser& operator=(const RecentChooser&);
163
RecentChooser(); // you must derive from this class
165
/** Called by constructors of derived classes. Provide the result of
166
* the Class init() function to ensure that it is properly
169
* @param interface_class The Class object for the derived type.
171
explicit RecentChooser(const Glib::Interface_Class& interface_class);
174
// This is public so that C++ wrapper instances can be
175
// created for C instances of unwrapped types.
176
// For instance, if an unexpected C type implements the C interface.
177
explicit RecentChooser(GtkRecentChooser* castitem);
180
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
183
virtual ~RecentChooser();
185
static void add_interface(GType gtype_implementer);
187
#ifndef DOXYGEN_SHOULD_SKIP_THIS
188
static GType get_type() G_GNUC_CONST;
189
static GType get_base_type() G_GNUC_CONST;
192
///Provides access to the underlying C GObject.
193
GtkRecentChooser* gobj() { return reinterpret_cast<GtkRecentChooser*>(gobject_); }
195
///Provides access to the underlying C GObject.
196
const GtkRecentChooser* gobj() const { return reinterpret_cast<GtkRecentChooser*>(gobject_); }
203
/** Whether to show recently used resources marked registered as private.
206
* @param show_private <tt>true</tt> to show private items, <tt>false</tt> otherwise.
208
void set_show_private(bool show_private = true);
210
/** Returns whether @a chooser should display recently used resources
211
* registered as private.
214
* @return <tt>true</tt> if the recent chooser should show private items,
215
* <tt>false</tt> otherwise.
217
bool get_show_private() const;
219
/** Sets whether @a chooser should display the recently used resources that
220
* it didn't find. This only applies to local resources.
223
* @param show_not_found Whether to show the local items we didn't find.
225
void set_show_not_found(bool show_not_found = true);
227
/** Retrieves whether @a chooser should show the recently used resources that
231
* @return <tt>true</tt> if the resources not found should be displayed, and
232
* <tt>false</tt> otheriwse.
234
bool get_show_not_found() const;
236
/** Sets whether @a chooser can select multiple items.
239
* @param select_multiple <tt>true</tt> if @a chooser can select more than one item.
241
void set_select_multiple(bool select_multiple = true);
243
/** Gets whether @a chooser can select multiple items.
246
* @return <tt>true</tt> if @a chooser can select more than one item.
248
bool get_select_multiple() const;
250
/** Sets the number of items that should be returned by
251
* get_items() and get_uris().
254
* @param limit A positive integer, or -1 for all items.
256
void set_limit(int limit);
259
/** Gets the number of items returned by get_items()
263
* @return A positive integer, or -1 meaning that all items are
266
int get_limit() const;
268
/** Sets whether only local resources, that is resources using the file:// URI
269
* scheme, should be shown in the recently used resources selector. If
270
* @a local_only is <tt>true</tt> (the default) then the shown resources are guaranteed
271
* to be accessible through the operating system native file system.
274
* @param local_only <tt>true</tt> if only local files can be shown.
276
void set_local_only(bool local_only = true);
278
/** Gets whether only local resources should be shown in the recently used
279
* resources selector. See set_local_only()
282
* @return <tt>true</tt> if only local resources should be shown.
284
bool get_local_only() const;
286
/** Sets whether to show a tooltips containing the full path of each
287
* recently used resource in a Gtk::RecentChooser widget.
290
* @param show_tips <tt>true</tt> if tooltips should be shown.
292
void set_show_tips(bool show_tips = true);
294
/** Gets whether @a chooser should display tooltips containing the full path
295
* of a recently user resource.
298
* @return <tt>true</tt> if the recent chooser should show tooltips,
299
* <tt>false</tt> otherwise.
301
bool get_show_tips() const;
303
// Deprecated in GTK+ 2.12. murrayc:
306
/** Sets whether @a chooser should show an icon near the resource when
310
* @param show_icons Whether to show an icon near the resource.
312
void set_show_icons(bool show_icons = true);
314
/** Retrieves whether @a chooser should show an icon near the resource.
317
* @return <tt>true</tt> if the icons should be displayed, <tt>false</tt> otherwise.
319
bool get_show_icons() const;
321
/** Changes the sorting order of the recently used resources list displayed by
325
* @param sort_type Sort order that the chooser should use.
327
void set_sort_type(RecentSortType sort_type);
329
/** Gets the value set by set_sort_type().
332
* @return The sorting order of the @a chooser.
334
RecentSortType get_sort_type() const;
337
/** This callback should return -1 if b compares before a, 0 if they compare
338
* equal and 1 if a compares after b.
339
* For instance, int on_sort_compare(const Glib::RefPtr<Gtk::RecentInfo>& a, const Gtk::RecentInfo& b);
341
typedef sigc::slot<int, const Glib::RefPtr<RecentInfo>&, const Glib::RefPtr<RecentInfo>&> SlotCompare;
344
/** Sets the comparison function used when sorting the list of recently
345
* used resources and the sort type is #RECENT_SORT_CUSTOM.
347
void set_sort_func(const SlotCompare& slot);
349
// TODO: Return type should be void since it will never return false but
350
// throwing RecentChooserError instead
352
/** Sets @a uri as the current URI for @a chooser.
356
* @return <tt>true</tt> if the URI was found.
358
bool set_current_uri(const Glib::ustring& uri);
360
/** Gets the URI currently selected by @a chooser.
363
* @return A newly allocated string holding a URI.
365
Glib::ustring get_current_uri() const;
367
/** Gets the Gtk::RecentInfo currently selected by @a chooser.
370
* @return A Gtk::RecentInfo. Use Gtk::RecentInfo::unref() when
371
* when you have finished using it.
373
Glib::RefPtr<RecentInfo> get_current_item();
375
/** Gets the Gtk::RecentInfo currently selected by @a chooser.
378
* @return A Gtk::RecentInfo. Use Gtk::RecentInfo::unref() when
379
* when you have finished using it.
381
Glib::RefPtr<const RecentInfo> get_current_item() const;
384
/** Selects @a uri inside @a chooser.
388
* @return <tt>true</tt> if @a uri was found.
390
bool select_uri(const Glib::ustring& uri);
392
/** Unselects @a uri inside @a chooser.
397
void unselect_uri(const Glib::ustring& uri);
399
/** Selects all the items inside @a chooser, if the @a chooser supports
400
* multiple selection.
406
/** Unselects all the items inside @a chooser.
412
//typedef Glib::ListHandle<RecentInfo, RecentInfoTraits> ListHandle_RecentInfos;
415
/** Gets the list of recently used resources in form of Gtk::RecentInfo objects.
417
* The return value of this function is affected by the "sort-type" and
418
* "limit" properties of @a chooser.
421
* @return A newly allocated
422
* list of Gtk::RecentInfo objects. You should
423
* use Gtk::RecentInfo::unref() on every item of the list, and then free
424
* the list itself using Glib::list_free().
426
std::vector<Glib::RefPtr<RecentInfo> > get_items() const;
428
/** Gets the URI of the recently used resources.
430
* The return value of this function is affected by the "sort-type" and
431
* "limit" properties of the recent chooser.
433
std::vector<Glib::ustring> get_uris() const;
436
/** Adds @a filter to the list of Gtk::RecentFilter objects held by @a chooser.
438
* If no previous filter objects were defined, this function will call
442
* @param filter A Gtk::RecentFilter.
444
void add_filter(const Glib::RefPtr<RecentFilter>& filter);
446
/** Removes @a filter from the list of Gtk::RecentFilter objects held by @a chooser.
449
* @param filter A Gtk::RecentFilter.
451
void remove_filter(const Glib::RefPtr<RecentFilter>& filter);
454
/** Gets the Gtk::RecentFilter objects held by @a chooser.
457
* @return A singly linked list
458
* of Gtk::RecentFilter objects. You
459
* should just free the returned list using Glib::slist_free().
461
std::vector< Glib::RefPtr<RecentFilter> > list_filters();
464
/** Gets the Gtk::RecentFilter objects held by @a chooser.
467
* @return A singly linked list
468
* of Gtk::RecentFilter objects. You
469
* should just free the returned list using Glib::slist_free().
471
std::vector< Glib::RefPtr<const RecentFilter> > list_filters() const;
474
/** Sets @a filter as the current Gtk::RecentFilter object used by @a chooser
475
* to affect the displayed recently used resources.
478
* @param filter A Gtk::RecentFilter.
480
void set_filter(const Glib::RefPtr<RecentFilter>& filter);
482
/** Gets the Gtk::RecentFilter object currently used by @a chooser to affect
483
* the display of the recently used resources.
486
* @return A Gtk::RecentFilter object.
488
Glib::RefPtr<RecentFilter> get_filter();
490
/** Gets the Gtk::RecentFilter object currently used by @a chooser to affect
491
* the display of the recently used resources.
494
* @return A Gtk::RecentFilter object.
496
Glib::RefPtr<const RecentFilter> get_filter() const;
498
/** This signal is emitted when there is a change in the set of
499
* selected recently used resources. This can happen when a user
500
* modifies the selection with the mouse or the keyboard, or when
501
* explicitely calling functions to change the selection.
504
* <tt>void on_my_%selection_changed()</tt>
507
Glib::SignalProxy0< void > signal_selection_changed();
510
/** This signal is emitted when the user "activates" a recent item
511
* in the recent chooser. This can happen by double-clicking on an item
512
* in the recently used resources list, or by pressing
513
* <keycap>Enter</keycap>.
516
* <tt>void on_my_%item_activated()</tt>
519
Glib::SignalProxy0< void > signal_item_activated();
522
//Not wrapped because it's write-only and construct-only: _WRAP_PROPERTY("recent-manager", Glib::RefPtr<RecentManager>)
523
#ifdef GLIBMM_PROPERTIES_ENABLED
524
/** Whether the private items should be displayed.
526
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
527
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
528
* the value of the property changes.
530
Glib::PropertyProxy<bool> property_show_private() ;
531
#endif //#GLIBMM_PROPERTIES_ENABLED
533
#ifdef GLIBMM_PROPERTIES_ENABLED
534
/** Whether the private items should be displayed.
536
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
537
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
538
* the value of the property changes.
540
Glib::PropertyProxy_ReadOnly<bool> property_show_private() const;
541
#endif //#GLIBMM_PROPERTIES_ENABLED
543
#ifdef GLIBMM_PROPERTIES_ENABLED
544
/** Whether there should be a tooltip on the item.
546
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
547
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
548
* the value of the property changes.
550
Glib::PropertyProxy<bool> property_show_tips() ;
551
#endif //#GLIBMM_PROPERTIES_ENABLED
553
#ifdef GLIBMM_PROPERTIES_ENABLED
554
/** Whether there should be a tooltip on the item.
556
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
557
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
558
* the value of the property changes.
560
Glib::PropertyProxy_ReadOnly<bool> property_show_tips() const;
561
#endif //#GLIBMM_PROPERTIES_ENABLED
563
#ifdef GLIBMM_PROPERTIES_ENABLED
564
/** Whether there should be an icon near the item.
566
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
567
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
568
* the value of the property changes.
570
Glib::PropertyProxy<bool> property_show_icons() ;
571
#endif //#GLIBMM_PROPERTIES_ENABLED
573
#ifdef GLIBMM_PROPERTIES_ENABLED
574
/** Whether there should be an icon near the item.
576
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
577
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
578
* the value of the property changes.
580
Glib::PropertyProxy_ReadOnly<bool> property_show_icons() const;
581
#endif //#GLIBMM_PROPERTIES_ENABLED
583
#ifdef GLIBMM_PROPERTIES_ENABLED
584
/** Whether the items pointing to unavailable resources should be displayed.
586
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
587
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
588
* the value of the property changes.
590
Glib::PropertyProxy<bool> property_show_not_found() ;
591
#endif //#GLIBMM_PROPERTIES_ENABLED
593
#ifdef GLIBMM_PROPERTIES_ENABLED
594
/** Whether the items pointing to unavailable resources should be displayed.
596
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
597
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
598
* the value of the property changes.
600
Glib::PropertyProxy_ReadOnly<bool> property_show_not_found() const;
601
#endif //#GLIBMM_PROPERTIES_ENABLED
603
#ifdef GLIBMM_PROPERTIES_ENABLED
604
/** Whether to allow multiple items to be selected.
606
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
607
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
608
* the value of the property changes.
610
Glib::PropertyProxy<bool> property_select_multiple() ;
611
#endif //#GLIBMM_PROPERTIES_ENABLED
613
#ifdef GLIBMM_PROPERTIES_ENABLED
614
/** Whether to allow multiple items to be selected.
616
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
617
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
618
* the value of the property changes.
620
Glib::PropertyProxy_ReadOnly<bool> property_select_multiple() const;
621
#endif //#GLIBMM_PROPERTIES_ENABLED
623
#ifdef GLIBMM_PROPERTIES_ENABLED
624
/** Whether the selected resource(s) should be limited to local file: URIs.
626
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
627
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
628
* the value of the property changes.
630
Glib::PropertyProxy<bool> property_local_only() ;
631
#endif //#GLIBMM_PROPERTIES_ENABLED
633
#ifdef GLIBMM_PROPERTIES_ENABLED
634
/** Whether the selected resource(s) should be limited to local file: URIs.
636
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
637
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
638
* the value of the property changes.
640
Glib::PropertyProxy_ReadOnly<bool> property_local_only() const;
641
#endif //#GLIBMM_PROPERTIES_ENABLED
643
#ifdef GLIBMM_PROPERTIES_ENABLED
644
/** The maximum number of items to be displayed.
646
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
647
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
648
* the value of the property changes.
650
Glib::PropertyProxy<int> property_limit() ;
651
#endif //#GLIBMM_PROPERTIES_ENABLED
653
#ifdef GLIBMM_PROPERTIES_ENABLED
654
/** The maximum number of items to be displayed.
656
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
657
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
658
* the value of the property changes.
660
Glib::PropertyProxy_ReadOnly<int> property_limit() const;
661
#endif //#GLIBMM_PROPERTIES_ENABLED
663
#ifdef GLIBMM_PROPERTIES_ENABLED
664
/** The sorting order of the items displayed.
666
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
667
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
668
* the value of the property changes.
670
Glib::PropertyProxy<RecentSortType> property_sort_type() ;
671
#endif //#GLIBMM_PROPERTIES_ENABLED
673
#ifdef GLIBMM_PROPERTIES_ENABLED
674
/** The sorting order of the items displayed.
676
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
677
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
678
* the value of the property changes.
680
Glib::PropertyProxy_ReadOnly<RecentSortType> property_sort_type() const;
681
#endif //#GLIBMM_PROPERTIES_ENABLED
683
#ifdef GLIBMM_PROPERTIES_ENABLED
684
/** The current filter for selecting which resources are displayed.
686
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
687
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
688
* the value of the property changes.
690
Glib::PropertyProxy< Glib::RefPtr<RecentFilter> > property_filter() ;
691
#endif //#GLIBMM_PROPERTIES_ENABLED
693
#ifdef GLIBMM_PROPERTIES_ENABLED
694
/** The current filter for selecting which resources are displayed.
696
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
697
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
698
* the value of the property changes.
700
Glib::PropertyProxy_ReadOnly< Glib::RefPtr<RecentFilter> > property_filter() const;
701
#endif //#GLIBMM_PROPERTIES_ENABLED
707
// TODO: How to wrap those vfuncs?
708
// TODO: Also: use vectorutils.
710
//__CONVERSION(`ListHandle_RecentInfos', `GList*', `($3).data()')
711
//__CONVERSION(`Glib::SListHandle<RecentFilter*>', `GSList*', `($3).data()')
713
//_WRAP_VFUNC(bool set_current_uri(const Glib::ustring& uri), "set_current_uri", errthrow)
714
virtual Glib::ustring get_current_uri_vfunc() const;
717
//_WRAP_VFUNC(bool select_uri(const Glib::ustring& uri), "select_uri", errthrow)
718
virtual void unselect_uri_vfunc(const Glib::ustring& uri);
720
virtual void select_all_vfunc();
722
virtual void unselect_all_vfunc();
724
//_WRAP_VFUNC(ArrayHandle_RecentInfos get_items() const, "get_items")
725
virtual Glib::RefPtr<RecentManager> get_recent_manager_vfunc();
728
virtual void add_filter_vfunc(const Glib::RefPtr<RecentFilter>& filter);
730
virtual void remove_filter_vfunc(const Glib::RefPtr<RecentFilter>& filter);
732
//_WRAP_VFUNC(Glib::SListHandle<RecentFilter*> list_filters(), "list_filters")
733
//_WRAP_VFUNC(void set_sort_func(const SlotCompare& slot), "set_sort_func")
739
//C++ methods used to invoke GTK+ virtual functions:
742
//GTK+ Virtual Functions (override these to change behaviour):
744
//Default Signal Handlers::
745
virtual void on_selection_changed();
746
virtual void on_item_activated();
756
/** A Glib::wrap() method for this object.
758
* @param object The C instance.
759
* @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
760
* @result A C++ instance that wraps this C instance.
762
* @relates Gtk::RecentChooser
764
Glib::RefPtr<Gtk::RecentChooser> wrap(GtkRecentChooser* object, bool take_copy = false);
769
#endif /* _GTKMM_RECENTCHOOSER_H */