/* Copyright (C) 2003 The gtkmm Development Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, see . */ // To exclude this file from the documentation when build-deprecated-api=false. _CONFIGINCLUDE(gtkmmconfig.h) #include #include #include _DEFS(gtkmm,gtk) _PINCLUDE(gtkmm/private/action_p.h) #m4 _PUSH(SECTION_CC_PRE_INCLUDES) #undef GTK_DISABLE_DEPRECATED #define GDK_DISABLE_DEPRECATION_WARNINGS 1 #m4 _POP() _IS_DEPRECATED // This whole file is deprecated. namespace Gtk { class GTKMM_API StockID; //Deprecated. /** A deprecated action of which represents a list of recently used files. * * A Gtk::RecentAction represents a list of recently used files, * which can be shown by widgets such as Gtk::RecentChooserDialog or * Gtk::RecentChooserMenu. * To construct a submenu showing recently used files, use a * Gtk::RecentAction as the action for a \. To construct a menu * toolbutton showing the recently used files in the popup menu, use a * Gtk::RecentAction as the action for a \ element. * * @newin{2,12} * * @deprecated Use Gio::Action and Gio::SimpleAction instead, and associate actions * with Gtk::Actionable widgets. Use Gio::MenuModel for creating menus with * Gtk::Menu(const Glib::RefPtr& model). * See the Gtk::Action base class for more information about the deprecation. * * @ingroup RecentFiles */ class GTKMM_API RecentAction : public Gtk::Action, public Gtk::RecentChooser { _CLASS_GOBJECT(RecentAction, GtkRecentAction, GTK_RECENT_ACTION, Gtk::Action, GtkAction, , , GTKMM_API) _IMPLEMENTS_INTERFACE(RecentChooser) protected: _CTOR_DEFAULT //Make sure that we use NULL instead of empty strings for the constructors: #m4 _CONVERSION(`const Glib::ustring&',`const char*',`$3.empty() ? 0 : $3.c_str()') // _WRAP_CTOR does not take a 'deprecated' parameter. // _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) // _WRAP_CTOR(RecentAction(const Glib::ustring& name, const StockID& stock_id, const Glib::ustring& label, const Glib::ustring& tooltip, const Glib::RefPtr& recent_manager), gtk_recent_action_new_for_manager ) _DEPRECATE_IFDEF_START //Note that the order of the parameters is not the same as gtk_recent_action_new(), because //a) we want to be consistent with Action, ToggleAction, etc. //b) this allows us to use the StockID parameter to distinguish the create() overloads. /** * @deprecated There is no corresponding replacement when using Gio::Action. */ explicit RecentAction(const Glib::ustring& name, const StockID& stock_id = StockID(), const Glib::ustring& label = Glib::ustring(), const Glib::ustring& tooltip = Glib::ustring()); /** * @deprecated There is no corresponding replacement when using Gio::Action. */ explicit RecentAction(const Glib::ustring& name, const StockID& stock_id, const Glib::ustring& label, const Glib::ustring& tooltip, const Glib::RefPtr& recent_manager); _DEPRECATE_IFDEF_END public: //Note that gtk_recent_action_new() does not allow name to be NULL, which suggests that we should not have a default constructor, //but it's OK to set the name later: _WRAP_CREATE() _DEPRECATE_IFDEF_START /** * @deprecated Use Gtk::RecentChooser::set_show_tips() to control tooltips on a Gtk::RecentChooserMenu. */ static Glib::RefPtr create(const Glib::ustring& name, const Glib::ustring& label = Glib::ustring(), const Glib::ustring& tooltip = Glib::ustring()); // _WRAP_CREATE does not take a 'deprecated' parameter. // _WRAP_CREATE(const Glib::ustring& name, const Gtk::StockID& stock_id, const Glib::ustring& label = Glib::ustring(), const Glib::ustring& tooltip = Glib::ustring()) // _WRAP_CREATE(const Glib::ustring& name, const Gtk::StockID& stock_id, const Glib::ustring& label, const Glib::ustring& tooltip, const Glib::RefPtr& recent_manager) /** * @deprecated There is no corresponding replacement when using Gio::Action. */ static Glib::RefPtr create(const Glib::ustring& name, const Gtk::StockID& stock_id, const Glib::ustring& label = Glib::ustring(), const Glib::ustring& tooltip = Glib::ustring()); /** * @deprecated There is no corresponding replacement when using Gio::Action. */ static Glib::RefPtr create(const Glib::ustring& name, const Gtk::StockID& stock_id, const Glib::ustring& label, const Glib::ustring& tooltip, const Glib::RefPtr& recent_manager); _DEPRECATE_IFDEF_END _WRAP_METHOD(bool get_show_numbers(), gtk_recent_action_get_show_numbers, deprecated "Use Gtk::RecentChooserMenu::get_show_numbers() instead.") _WRAP_METHOD(void set_show_numbers(bool show_numbers = true), gtk_recent_action_set_show_numbers, deprecated "Use Gtk::RecentChooserMenu::set_show_numbers() instead.") _WRAP_PROPERTY("show-numbers", bool, deprecated "Use Gtk::RecentChooserMenu::property_show_numbers() instead.") }; } // namespace Gtk