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 00030 namespace fawkes { 00031 class Configuration; 00032 } 00033 00034 class ConfigEditorPlugin 00035 { 00036 public: 00037 ConfigEditorPlugin(std::string config_path, std::string ui_file ); 00038 virtual ~ConfigEditorPlugin(); 00039 00040 void initialize(); 00041 void run(); 00042 00043 std::string get_config_path() const; 00044 void set_config( fawkes::Configuration* config ); 00045 00046 00047 protected: 00048 virtual void pre_run() =0; 00049 virtual void post_run( int response ) =0; 00050 00051 virtual Gtk::Dialog* load_dialog() =0; 00052 00053 Gtk::Dialog* m_dialog; 00054 Glib::RefPtr<Gtk::Builder> m_builder; 00055 00056 std::string m_config_path; 00057 fawkes::Configuration* m_config; 00058 }; 00059 00060 #endif /* __TOOLS_CONFIG_EDITOR_CONFIG_EDITOR_PLUGIN_H_ */