feat_config.hpp
上传用户:yhdzpy8989
上传日期:2007-06-13
资源大小:13604k
文件大小:6k
- /*
- * ===========================================================================
- * PRODUCTION $Log: feat_config.hpp,v $
- * PRODUCTION Revision 1000.3 2004/06/01 19:46:18 gouriano
- * PRODUCTION PRODUCTION: UPGRADED [GCC34_MSVC7] Dev-tree R1.16
- * PRODUCTION
- * ===========================================================================
- */
- #ifndef GUI_CONFIG___FEAT_CONFIG__HPP
- #define GUI_CONFIG___FEAT_CONFIG__HPP
- /* $Id: feat_config.hpp,v 1000.3 2004/06/01 19:46:18 gouriano Exp $
- * ===========================================================================
- *
- * PUBLIC DOMAIN NOTICE
- * National Center for Biotechnology Information
- *
- * This software/database is a "United States Government Work" under the
- * terms of the United States Copyright Act. It was written as part of
- * the author's official duties as a United States Government employee and
- * thus cannot be copyrighted. This software/database is freely available
- * to the public for use. The National Library of Medicine and the U.S.
- * Government have not placed any restriction on its use or reproduction.
- *
- * Although all reasonable efforts have been taken to ensure the accuracy
- * and reliability of the software and data, the NLM and the U.S.
- * Government do not and cannot warrant the performance or results that
- * may be obtained by using this software or data. The NLM and the U.S.
- * Government disclaim all warranties, express or implied, including
- * warranties of performance, merchantability or fitness for any particular
- * purpose.
- *
- * Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- * Authors: Robert Smith
- *
- */
- /// @file feat_config.hpp
- /// Declarations for a list of "features" that can be configured.
- #include <corelib/ncbistd.hpp>
- #include <gui/config/feat_config_inherited.hpp>
- #include <gui/config/feat_config_list.hpp>
- #include <gui/config/settings_set.hpp>
- #include <gui/opengl/glcolor.hpp>
- /** @addtogroup GUI_CONFIG
- *
- * @{
- */
- BEGIN_NCBI_SCOPE
- ///
- /// CFeatConfig - class to hold all configuration settings for features
- /// which can be saved as key value pairs.
- ///
- class NCBI_GUICONFIG_EXPORT CFeatConfig : public CSettingsSet {
- public:
- CFeatConfig(objects::CPluginConfigCache* config_cache);
- /// use the following cstr when inheriting from this class.
- CFeatConfig(objects::CPluginConfigCache* config_cache,
- const string& type,
- const AutoPtr<IFactoryDefaultSettings>& fds);
-
- // Iteratable list of key values (type/subtype).
- // can iterate through all values including defaults.
- // Dereferencing these iterators gives you a CFeatConfigItem object.
-
- typedef CFeatConfigList::const_iterator const_iterator;
- size_t size() const;
- const_iterator begin() const;
- const_iterator end() const;
- /// Must define
- virtual bool LoadCurrentSettings(ELoadValueSource src);
- virtual bool SaveCurrentSettings(void);
-
- void GetFeatureDescs(vector<string>& names) const;
- bool GetTypeSubType(const string& desc, int& type, int& subtype) const;
-
- bool GetShow(int type, int subtype) const;
- void SetShow(int type, int subtype, bool show);
- void SetShowInherited(int type, int subtype, bool inherited);
- void SetShows(const CFeatConfigValues<bool>& o);
- const CFeatConfigValues<bool>& GetShows() const;
- void ClearShows();
-
- CGlColor GetColor(int type, int subtype) const;
- void SetColor(int type, int subtype, CGlColor color);
- void SetColorInherited(int type, int subtype, bool inherited);
- void SetColors(const CFeatConfigValues<CGlColor>& o);
- const CFeatConfigValues<CGlColor>& GetColors() const;
- void ClearColors();
-
- private:
- const CFeatConfigList& m_FeatList;
- CFeatConfigValues<bool> m_FeatShows;
- CFeatConfigValues<CGlColor> m_FeatColors;
- };
- class NCBI_GUICONFIG_EXPORT CFeatConfigFactoryDefaults : public IFactoryDefaultSettings {
- public:
- virtual string Get(const string& key) const;
-
- static const string kNotDefined;
- static const string kTrueStr;
- static const string kFalseStr;
- };
- END_NCBI_SCOPE
- /* @} */
- /*
- * ===========================================================================
- *
- * $Log: feat_config.hpp,v $
- * Revision 1000.3 2004/06/01 19:46:18 gouriano
- * PRODUCTION: UPGRADED [GCC34_MSVC7] Dev-tree R1.16
- *
- * Revision 1.16 2004/05/11 18:55:53 dicuccio
- * Changed doxygen modules - use GUI_CONFIG instead of PluginConfiguration
- *
- * Revision 1.15 2003/12/29 14:43:19 rsmith
- * Get returns string not string&. Take out stuff now in separate files.
- *
- * Revision 1.14 2003/11/21 12:48:32 rsmith
- * Add ability to delete entries by key.
- *
- * Revision 1.13 2003/11/18 20:20:21 rsmith
- * Sort subtypes properly. Interfaces to get/set whole groups of values.
- *
- * Revision 1.12 2003/11/18 17:34:16 dicuccio
- * Added typename where required
- *
- * Revision 1.11 2003/10/31 14:01:23 ivanov
- * Added export specifier for CFeatConfigFactoryDefaults class
- *
- * Revision 1.10 2003/10/30 14:23:13 rsmith
- * Added cstr for use as a base class.
- *
- * Revision 1.9 2003/10/28 19:02:55 dicuccio
- * Added export specifiers. Changed ctor param from CRef<> to raw pointer
- *
- * Revision 1.8 2003/10/28 13:43:31 rsmith
- * Expose feature list's size().
- *
- * Revision 1.7 2003/10/27 19:29:07 rsmith
- * Expose iterators on CFeatConfigItem in CFeatConfig
- *
- * Revision 1.6 2003/10/25 02:40:15 ucko
- * Avoid make_pair due to broken WorkShop support for covariance.
- *
- * Revision 1.5 2003/10/24 18:52:12 ucko
- * CSeqFeatData still needs objects::....
- *
- * Revision 1.4 2003/10/24 14:50:03 rsmith
- * CFeatConfig -> CFeatConfigList, CFeatConfig now contains a CFeatConfigList, several methods added.
- *
- * Revision 1.3 2003/10/21 12:24:58 dicuccio
- * Minor code reformatting. Made CFeatConfigItem a class, not a struct
- *
- * Revision 1.2 2003/10/20 23:38:54 ucko
- * Properly scope CSeqFeatData under objects::, and fold some long lines.
- *
- * Revision 1.1 2003/10/17 19:45:24 rsmith
- * configuration information for SeqFeats. Replaces config_items.hpp
- *
- * ===========================================================================
- */
- #endif /* GUI_CONFIG___FEAT_CONFIG__HPP */