Debian Codegraph @

gtk/src/recentaction.hg

raw
1 /* Copyright (C) 2003 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 Lesser General Public
5 * License as published by the Free Software Foundation; either
6 * version 2.1 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 * Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public
14 * License along with this library; if not, see <https://www.gnu.org/licenses/>.
15 */
16
17 // To exclude this file from the documentation when build-deprecated-api=false.
18 _CONFIGINCLUDE(gtkmmconfig.h)
19
20 #include <gtkmm/action.h>
21 #include <gtkmm/recentchooser.h>
22 #include <gtkmm/recentmanager.h>
23
24 _DEFS(gtkmm,gtk)
25 _PINCLUDE(gtkmm/private/action_p.h)
26
27 #m4 _PUSH(SECTION_CC_PRE_INCLUDES)
28 #undef GTK_DISABLE_DEPRECATED
29 #define GDK_DISABLE_DEPRECATION_WARNINGS 1
30 #m4 _POP()
31
32 _IS_DEPRECATED // This whole file is deprecated.
33
34 namespace Gtk
35 {
36
37 class GTKMM_API StockID; //Deprecated.
38
39 /** A deprecated action of which represents a list of recently used files.
40 *
41 * A Gtk::RecentAction represents a list of recently used files,
42 * which can be shown by widgets such as Gtk::RecentChooserDialog or
43 * Gtk::RecentChooserMenu.
44 * To construct a submenu showing recently used files, use a
45 * Gtk::RecentAction as the action for a \<menuitem\>. To construct a menu
46 * toolbutton showing the recently used files in the popup menu, use a
47 * Gtk::RecentAction as the action for a \<toolitem\> element.
48 *
49 * @newin{2,12}
50 *
51 * @deprecated Use Gio::Action and Gio::SimpleAction instead, and associate actions
52 * with Gtk::Actionable widgets. Use Gio::MenuModel for creating menus with
53 * Gtk::Menu(const Glib::RefPtr<Gio::MenuModel>& model).
54 * See the Gtk::Action base class for more information about the deprecation.
55 *
56 * @ingroup RecentFiles
57 */
58 class GTKMM_API RecentAction
59 : public Gtk::Action,
60 public Gtk::RecentChooser
61 {
62 _CLASS_GOBJECT(RecentAction, GtkRecentAction, GTK_RECENT_ACTION, Gtk::Action, GtkAction, , , GTKMM_API)
63 _IMPLEMENTS_INTERFACE(RecentChooser)
64
65 protected:
66 _CTOR_DEFAULT
67
68 //Make sure that we use NULL instead of empty strings for the constructors:
69 #m4 _CONVERSION(`const Glib::ustring&',`const char*',`$3.empty() ? 0 : $3.c_str()')
70
71 // _WRAP_CTOR does not take a 'deprecated' parameter.
72 // _WRAP_CTOR(RecentAction(const Glib::ustring& name, const StockID& stock_id = StockID(), const Glib::ustring& label = Glib::ustring(), const Glib::ustring& tooltip = Glib::ustring()), gtk_recent_action_new)
73 // _WRAP_CTOR(RecentAction(const Glib::ustring& name, const StockID& stock_id, const Glib::ustring& label, const Glib::ustring& tooltip, const Glib::RefPtr<RecentManager>& recent_manager), gtk_recent_action_new_for_manager )
74 _DEPRECATE_IFDEF_START
75 //Note that the order of the parameters is not the same as gtk_recent_action_new(), because
76 //a) we want to be consistent with Action, ToggleAction, etc.
77 //b) this allows us to use the StockID parameter to distinguish the create() overloads.
78 /**
79 * @deprecated There is no corresponding replacement when using Gio::Action.
80 */
81 explicit RecentAction(const Glib::ustring& name, const StockID& stock_id = StockID(), const Glib::ustring& label = Glib::ustring(), const Glib::ustring& tooltip = Glib::ustring());
82
83 /**
84 * @deprecated There is no corresponding replacement when using Gio::Action.
85 */
86 explicit RecentAction(const Glib::ustring& name, const StockID& stock_id, const Glib::ustring& label, const Glib::ustring& tooltip, const Glib::RefPtr<RecentManager>& recent_manager);
87 _DEPRECATE_IFDEF_END
88
89 public:
90 //Note that gtk_recent_action_new() does not allow name to be NULL, which suggests that we should not have a default constructor,
91 //but it's OK to set the name later:
92 _WRAP_CREATE()
93
94 _DEPRECATE_IFDEF_START
95 /**
96 * @deprecated Use Gtk::RecentChooser::set_show_tips() to control tooltips on a Gtk::RecentChooserMenu.
97 */
98 static Glib::RefPtr<RecentAction> create(const Glib::ustring& name, const Glib::ustring& label = Glib::ustring(), const Glib::ustring& tooltip = Glib::ustring());
99
100 // _WRAP_CREATE does not take a 'deprecated' parameter.
101 // _WRAP_CREATE(const Glib::ustring& name, const Gtk::StockID& stock_id, const Glib::ustring& label = Glib::ustring(), const Glib::ustring& tooltip = Glib::ustring())
102 // _WRAP_CREATE(const Glib::ustring& name, const Gtk::StockID& stock_id, const Glib::ustring& label, const Glib::ustring& tooltip, const Glib::RefPtr<RecentManager>& recent_manager)
103 /**
104 * @deprecated There is no corresponding replacement when using Gio::Action.
105 */
106 static Glib::RefPtr<RecentAction> create(const Glib::ustring& name, const Gtk::StockID& stock_id, const Glib::ustring& label = Glib::ustring(), const Glib::ustring& tooltip = Glib::ustring());
107
108 /**
109 * @deprecated There is no corresponding replacement when using Gio::Action.
110 */
111 static Glib::RefPtr<RecentAction> create(const Glib::ustring& name, const Gtk::StockID& stock_id, const Glib::ustring& label, const Glib::ustring& tooltip, const Glib::RefPtr<RecentManager>& recent_manager);
112 _DEPRECATE_IFDEF_END
113
114 _WRAP_METHOD(bool get_show_numbers(), gtk_recent_action_get_show_numbers,
115 deprecated "Use Gtk::RecentChooserMenu::get_show_numbers() instead.")
116 _WRAP_METHOD(void set_show_numbers(bool show_numbers = true), gtk_recent_action_set_show_numbers,
117 deprecated "Use Gtk::RecentChooserMenu::set_show_numbers() instead.")
118
119 _WRAP_PROPERTY("show-numbers", bool, deprecated "Use Gtk::RecentChooserMenu::property_show_numbers() instead.")
120 };
121
122 } // namespace Gtk