26#ifndef CONFIG_PARAMS_H_
27#define CONFIG_PARAMS_H_
33#include <wx/confbase.h>
34#include <wx/fileconf.h>
35#include <boost/ptr_container/ptr_vector.hpp>
83 const wxString& legacy_ident = wxEmptyString );
91 virtual void ReadParam( wxConfigBase* aConfig )
const {};
98 virtual void SaveParam( wxConfigBase* aConfig )
const {};
117 PARAM_CFG_INT(
const wxString& ident,
int* ptparam,
int default_val = 0,
118 int min = std::numeric_limits<int>::min(),
119 int max = std::numeric_limits<int>::max(),
120 const wxChar*
group =
nullptr,
121 const wxString& legacy_ident = wxEmptyString );
122 PARAM_CFG_INT(
bool Insetup,
const wxString& ident,
int* ptparam,
int default_val = 0,
123 int min = std::numeric_limits<int>::min(),
124 int max = std::numeric_limits<int>::max(),
125 const wxChar*
group =
nullptr,
126 const wxString& legacy_ident = wxEmptyString );
128 virtual void ReadParam( wxConfigBase* aConfig )
const override;
129 virtual void SaveParam( wxConfigBase* aConfig )
const override;
146 int min = std::numeric_limits<int>::min(),
147 int max = std::numeric_limits<int>::max(),
148 const wxChar*
group =
nullptr,
double aBiu2cfgunit = 1.0,
149 const wxString& legacy_ident = wxEmptyString );
152 int min = std::numeric_limits<int>::min(),
153 int max = std::numeric_limits<int>::max(),
154 const wxChar*
group =
nullptr,
double aBiu2cfgunit = 1.0,
155 const wxString& legacy_ident = wxEmptyString );
157 virtual void ReadParam( wxConfigBase* aConfig )
const override;
158 virtual void SaveParam( wxConfigBase* aConfig )
const override;
172 double default_val = 0.0,
double min = 0.0,
double max = 10000.0,
173 const wxChar*
group =
nullptr );
175 double default_val = 0.0,
double min = 0.0,
double max = 10000.0,
176 const wxChar*
group =
nullptr );
178 virtual void ReadParam( wxConfigBase* aConfig )
const override;
179 virtual void SaveParam( wxConfigBase* aConfig )
const override;
194 int default_val =
false,
const wxChar*
group =
nullptr,
195 const wxString& legacy_ident = wxEmptyString );
196 PARAM_CFG_BOOL(
bool Insetup,
const wxString& ident,
bool* ptparam,
197 int default_val =
false,
const wxChar*
group =
nullptr,
198 const wxString& legacy_ident = wxEmptyString );
200 virtual void ReadParam( wxConfigBase* aConfig )
const override;
201 virtual void SaveParam( wxConfigBase* aConfig )
const override;
217 const wxString& ident,
219 const wxString& default_val = wxEmptyString,
220 const wxChar*
group =
nullptr );
222 virtual void ReadParam( wxConfigBase* aConfig )
const override;
223 virtual void SaveParam( wxConfigBase* aConfig )
const override;
238 const wxChar*
group =
nullptr );
241 const wxString& ident,
242 std::set<wxString>* ptparam,
243 const wxChar*
group =
nullptr );
245 virtual void ReadParam( wxConfigBase* aConfig )
const override;
246 virtual void SaveParam( wxConfigBase* aConfig )
const override;
261 const wxChar*
group =
nullptr );
262 virtual void ReadParam( wxConfigBase* aConfig )
const override;
263 virtual void SaveParam( wxConfigBase* aConfig )
const override;
276 const wxChar*
group =
nullptr );
278 virtual void ReadParam( wxConfigBase* aConfig )
const override;
279 virtual void SaveParam( wxConfigBase* aConfig )
const override;
304 const wxString& aGroup );
326 const wxString& aGroup );
Configuration object for booleans.
bool * m_Pt_param
Pointer to the parameter value.
int m_Default
The default value of the parameter.
Configuration object for double precision floating point numbers.
double m_Max
Minimum and maximum values of the param type.
double * m_Pt_param
Pointer to the parameter value.
double m_Default
The default value of the parameter.
Configuration object for a file name object.
wxString * m_Pt_param
Pointer to the parameter value.
Configuration for integers with unit conversion.
double m_BIU_to_cfgunit
the factor to convert the saved value in internal value
Configuration object for integers.
int m_Max
Minimum and maximum values of the param type.
int m_Default
The default value of the parameter.
int * m_Pt_param
Pointer to the parameter value.
wxArrayString * m_Pt_param
Pointer to the parameter value.
Configuration object for a set of wxString objects.
std::set< wxString > * m_Pt_param
Pointer to the parameter value.
Configuration object for wxString objects.
wxString * m_Pt_param
Pointer to the parameter value.
wxString m_default
The default value of the parameter.
A base class which establishes the interface functions ReadParam and SaveParam, which are implemented...
virtual void ReadParam(wxConfigBase *aConfig) const
Read the value of the parameter stored in aConfig.
paramcfg_id m_Type
Type of parameter.
wxString m_Ident
Keyword in config data.
wxString m_Group
Group name (this is like a path in the config data)
virtual void SaveParam(wxConfigBase *aConfig) const
Save the value of the parameter stored in aConfig.
bool m_Setup
Install or Project based parameter, true == install.
KICOMMON_API void wxConfigSaveSetups(wxConfigBase *aCfg, const std::vector< PARAM_CFG * > &aList)
Writes aList of PARAM_CFG objects to aCfg.
KICOMMON_API void wxConfigSaveParams(wxConfigBase *aCfg, const std::vector< PARAM_CFG * > &aList, const wxString &aGroup)
Write aList of PARAM_CFG objects aCfg.
KICOMMON_API void ConfigBaseWriteDouble(wxConfigBase *aConfig, const wxString &aKey, double aValue)
A helper function to write doubles in configuration file.
paramcfg_id
Type of parameter in the configuration file.
@ PARAM_DIFFPAIRDIMENSIONS
KICOMMON_API void wxConfigLoadParams(wxConfigBase *aCfg, const std::vector< PARAM_CFG * > &aList, const wxString &aGroup)
Use aList of PARAM_CFG objects to load configuration values from aCfg.
KICOMMON_API void wxConfigLoadSetups(wxConfigBase *aCfg, const std::vector< PARAM_CFG * > &aList)
Use aList of PARAM_CFG object to load configuration values from aCfg.