2 Copyright (C) 2000-2007 Paul Davis
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #ifndef __libgtkmm2ext_actions_h__
21 #define __libgtkmm2ext_actions_h__
25 #include <gtkmm/action.h>
26 #include <gtkmm/radioaction.h>
27 #include <gtkmm/toggleaction.h>
28 #include <gtkmm/actiongroup.h>
29 #include <gtkmm/accelkey.h>
31 #include "gtkmm2ext/visibility.h"
37 namespace ActionManager {
39 LIBGTKMM2EXT_API extern std::string unbound_string; /* the key string returned if an action is not bound */
40 LIBGTKMM2EXT_API extern Glib::RefPtr<Gtk::UIManager> ui_manager;
42 LIBGTKMM2EXT_API extern void set_sensitive (std::vector<Glib::RefPtr<Gtk::Action> >& actions, bool);
43 LIBGTKMM2EXT_API extern std::string get_key_representation (const std::string& accel_path, Gtk::AccelKey& key);
45 LIBGTKMM2EXT_API extern Gtk::Widget* get_widget (const char * name);
46 LIBGTKMM2EXT_API extern Glib::RefPtr<Gtk::Action> get_action (const char* group, const char* name);
47 LIBGTKMM2EXT_API extern Glib::RefPtr<Gtk::Action> get_action (const char* path);
48 LIBGTKMM2EXT_API extern Glib::RefPtr<Gtk::Action> get_action_from_name (const char* name);
49 LIBGTKMM2EXT_API extern void do_action (const char* group, const char* name);
50 LIBGTKMM2EXT_API extern void set_toggle_action (const char* group, const char* name, bool);
52 LIBGTKMM2EXT_API extern void add_action_group (Glib::RefPtr<Gtk::ActionGroup>);
53 LIBGTKMM2EXT_API extern void enable_accelerators ();
55 LIBGTKMM2EXT_API extern bool lookup_entry (const Glib::ustring accel_path, Gtk::AccelKey& key);
57 LIBGTKMM2EXT_API extern void get_all_actions (std::vector<std::string>& names,
58 std::vector<std::string>& paths,
59 std::vector<std::string>& tooltips,
60 std::vector<std::string>& keys,
61 std::vector<Gtk::AccelKey>& bindings);
63 LIBGTKMM2EXT_API extern void get_all_actions (std::vector<std::string>& groups,
64 std::vector<std::string>& paths,
65 std::vector<std::string>& tooltips,
66 std::vector<Gtk::AccelKey>& bindings);
68 LIBGTKMM2EXT_API extern void check_toggleaction (std::string);
69 LIBGTKMM2EXT_API extern void uncheck_toggleaction (std::string);
70 LIBGTKMM2EXT_API extern void set_toggleaction_state (std::string, bool);
73 LIBGTKMM2EXT_API extern void save_action_states ();
74 LIBGTKMM2EXT_API extern void enable_active_actions ();
75 LIBGTKMM2EXT_API extern void disable_active_actions ();
78 #endif /* __libgtkmm2ext_actions_h__ */