/* $Id$ */ /* * Cantus Tag Editor * Copyright © 2002-2004 by Samuel Abels * Copyright © 2007 by Tim Huetz * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see **/ #ifdef HAVE_CONFIG_H # include #endif #ifndef HAVE_GUI_PREFERENCES_H #define HAVE_GUI_PREFERENCES_H #include #include #include #include #include #include #define _(String) gettext (String) #define gettext_noop(String) (String) #define N_(String) gettext_noop (String) class PreferencesWindow : public sigc::trackable { public: PreferencesWindow(std::string gladefile, std::string gladedomain); ~PreferencesWindow(); /* Triggered whenever the CLOSE button has been clicked. */ SigC::Signal0 signal_button_close_clicked; /* Triggered whenever any preference has been changed. */ /* Emits the preference name, type (e.g. G_TYPE_BOOL) and its value. */ SigC::Signal3 signal_preference_changed; /* Make the window visible. If it does not exist yet, it will be created. */ void show(void); /* Hide the window. */ void hide(void); /* Updates one widget according to the given value. */ bool update_widget(std::string name, int type, void *value); private: /* Builds the complete preferences window and makes it visible. */ void create(void); /* Adds all categories by iterating through the notebook tab labels. */ void fill_tree(void); /* Connects all signals. */ void connect_signals(void); /* Callback handler, triggered whenever another preferences category has been * selected. */ void on_preftree_selection_changed(Gtk::TreeIter iter); /* Callback handler, triggered whenever the "close" button has been clicked. */ void on_button_close_clicked(void); /* Callback handler, triggered whenever any of the preferences has been * edited. */ void on_widget_changed(Gtk::Widget *widget); /* Given a container, this function returns a list of all children. * Other than "Gtk::Object::get_children()", this function works recursive. */ void get_children_recursive( Gtk::Container *container, std::list *children); Glib::RefPtr refXml; // Glade's XML-structure. std::string glade_file; // The .glade filename. std::string glade_domain; // The .glade file domain. Gtk::Window *window; // The toplevel window. Gtk::Notebook *notebook; // The notebook holding prefs. Gtk::Viewport *viewport; // Preftree parent. PreferencesTree preftree; // Preftree. }; #endif