00001 #ifndef IGUANA_FRAMEWORK_IG_BROWSER_CONFIG_SET_H
00002 # define IGUANA_FRAMEWORK_IG_BROWSER_CONFIG_SET_H
00003
00004
00005
00006 # include "Iguana/Framework/interface/config.h"
00007 # include <string>
00008 # include <map>
00009
00010
00011
00012
00013
00014 class IgBrowserConfigSet;
00015
00016 class IgBrowserPropertySetManager;
00017 class IgBrowserPropertyNameSet;
00018 class IgBrowserPropertyName;
00019 class IgBrowserPropertyValue;
00020
00021 class IgBrowserConfigItem;
00022 class IgBrowserConfigItemFactory;
00023
00024 class IgBrowserConfigBus;
00025 class IgBrowserConfigSiteSet;
00026 class IgBrowserConfigSite;
00027 class IgBrowserConfigBrowserSet;
00028 class IgBrowserConfigBrowser;
00029
00030
00031
00032
00033
00035 class IGUANA_FRAMEWORK_API IgBrowserPropertySetManager
00036 {
00037 public:
00038 virtual ~IgBrowserPropertySetManager (void);
00039
00040
00041
00042
00043 virtual IgBrowserPropertyNameSet property_names (void) const = 0;
00044 virtual std::string get_property (const IgBrowserPropertyName &key) = 0;
00045 virtual void set_property (const IgBrowserPropertyName &key,
00046 const IgBrowserPropertyValue &value) = 0;
00047 virtual void clear_property (const IgBrowserPropertyName &key) = 0;
00048 virtual void clear_properties (void) = 0;
00049 virtual void reset_properties (void) = 0;
00050 };
00051
00053 class IGUANA_FRAMEWORK_API IgBrowserConfigSet
00054 {
00055 typedef std::vector<IgBrowserConfigItem *> item_set;
00056 typedef item_set::const_iterator item_iterator;
00057 typedef item_set::size_type size_type;
00058
00059 public:
00060 IgBrowserConfigSet (void);
00061 ~IgBrowserConfigSet (void);
00062
00063
00064 static void associate_factory (const std::string &element_type,
00065 IgBrowserConfigItemFactory *factory);
00066 static IgBrowserConfigSet * instantiate (const Filename &file);
00067 void read (const Filename &file);
00068 void write (const Filename &file);
00069
00070
00071 void name (const std::string &value);
00072 std::string name (void) const;
00073
00074
00075 item_iterator begin_items (void) const;
00076 item_iterator end_items (void) const;
00077 size_type items (void) const;
00078 void add_item (IgBrowserConfigItem *item);
00079 void remove_item (IgBrowserConfigItem *item);
00080 IgBrowserConfigItem * lookup_item (const std::string &name);
00081
00082 private:
00083 std::string m_name;
00084 item_set m_items;
00085 };
00086
00088 class IGUANA_FRAMEWORK_API IgBrowserConfigItem : public IgBrowserPropertySetManager
00089 {
00090 public:
00091
00092
00093 virtual std::string name (void) const = 0;
00094
00095
00096 virtual IgBrowserConfigItem *lookup_item (const std::string &name) = 0;
00097 };
00098
00099
00100
00101
00102 #endif // IGUANA_FRAMEWORK_IG_BROWSER_CONFIG_SET_H