Fawkes API Fawkes Development Version
|
00001 00002 /*************************************************************************** 00003 * config_editor_plugin.h - Base class for config editor plugins 00004 * 00005 * Created: Sun Mar 29 11:52:30 2009 00006 * Copyright 2009 Daniel Beck 00007 * 00008 ****************************************************************************/ 00009 00010 /* This program is free software; you can redistribute it and/or modify 00011 * it under the terms of the GNU General Public License as published by 00012 * the Free Software Foundation; either version 2 of the License, or 00013 * (at your option) any later version. 00014 * 00015 * This program is distributed in the hope that it will be useful, 00016 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00018 * GNU Library General Public License for more details. 00019 * 00020 * Read the full text in the LICENSE.GPL file in the doc directory. 00021 */ 00022 00023 #ifndef __TOOLS_CONFIG_EDITOR_CONFIG_EDITOR_PLUGIN_H_ 00024 #define __TOOLS_CONFIG_EDITOR_CONFIG_EDITOR_PLUGIN_H_ 00025 00026 #include <string> 00027 00028 #include <gtkmm.h> 00029 #include <libglademm/xml.h> 00030 00031 namespace fawkes { 00032 class Configuration; 00033 } 00034 00035 class ConfigEditorPlugin 00036 { 00037 public: 00038 ConfigEditorPlugin( std::string config_path, 00039 std::string glade_file ); 00040 virtual ~ConfigEditorPlugin(); 00041 00042 void initialize(); 00043 void run(); 00044 00045 std::string get_config_path() const; 00046 void set_config( fawkes::Configuration* config ); 00047 00048 00049 protected: 00050 virtual void pre_run() =0; 00051 virtual void post_run( int response ) =0; 00052 00053 virtual Gtk::Dialog* load_dialog() =0; 00054 00055 Gtk::Dialog* m_dialog; 00056 Glib::RefPtr< Gnome::Glade::Xml > m_ref_xml; 00057 00058 std::string m_config_path; 00059 fawkes::Configuration* m_config; 00060 00061 }; 00062 00063 #endif /* __TOOLS_CONFIG_EDITOR_CONFIG_EDITOR_PLUGIN_H_ */