CGridListCtrlEx
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
CViewConfigSection Class Referenceabstract

Abstract interface for persisting view configuration. More...

Inheritance diagram for CViewConfigSection:
CViewConfigSectionDefault CViewConfigSectionDefault::CViewConfigSectionLocal CViewConfigSectionProfiles CViewConfigSectionWinApp

Public Member Functions

 CViewConfigSection (const CString &strViewName)
 CViewConfigSection - Constructor. More...
 
virtual ~CViewConfigSection ()
 CViewConfigSection - Destructor.
 
virtual CString GetSetting (const CString &strName, const CString &strDefval=_T("")) const
 Retrieves a setting value for the view. More...
 
virtual bool GetBoolSetting (const CString &strName, bool bDefval=false) const
 Retrieves a bool setting value for the view. More...
 
virtual int GetIntSetting (const CString &strName, int nDefval=0) const
 Retrieves an integer setting value for the view. More...
 
virtual double GetFloatSetting (const CString &strName, double nDefval=0.0) const
 Retrieves a float setting value for the view. More...
 
virtual LOGFONT GetLogFontSetting (const CString &strName) const
 Retrieves a font setting value for the view. More...
 
virtual CRect GetRectSetting (const CString &strName, const CRect &rectDefval=CRect(0, 0, 0, 0)) const
 Retrieves a rectangle setting value for the view. More...
 
virtual COLORREF GetColorSetting (const CString &strName, const COLORREF colorDefval=RGB(0, 0, 0)) const
 Retrieves a color setting value for the view. More...
 
virtual void GetArraySetting (const CString &strName, CSimpleArray< CString > &values, const CString &strDelimiter=_T(", ")) const
 Retrieves a string-array setting value for the view. More...
 
virtual void GetArraySetting (const CString &strName, CSimpleArray< int > &values, const CString &strDelimiter=_T(", ")) const
 Retrieves a integer-array setting value for the view. More...
 
virtual void SetSetting (const CString &strName, const CString &strValue)
 Updates a setting value for the view. More...
 
virtual void SetBoolSetting (const CString &strName, bool bValue)
 Updates the value of a bool setting. More...
 
virtual void SetIntSetting (const CString &strName, int nValue)
 Updates the value of an integer setting. More...
 
virtual void SetFloatSetting (const CString &strName, double nValue, int nDecimals=6)
 Updates the value of a float setting. More...
 
virtual void SetArraySetting (const CString &strName, const CSimpleArray< CString > &values, const CString &strDelimiter=_T(", "))
 Updates the value of a string-array setting. More...
 
virtual void SetArraySetting (const CString &strName, const CSimpleArray< int > &values, const CString &strDelimiter=_T(", "))
 Updates the value of an integer-array setting. More...
 
virtual void SetLogFontSetting (const CString &strName, const LOGFONT &font)
 Updates the value of a font setting. More...
 
virtual void SetRectSetting (const CString &strName, const RECT &rect)
 Updates the value of a rectangle setting. More...
 
virtual void SetColorSetting (const CString &strName, COLORREF color)
 Updates the value of a color setting. More...
 
virtual void RemoveCurrentConfig ()
 Removes the current configuration.
 

Protected Member Functions

virtual CString ReadSetting (const CString &strSection, const CString &strSetting, const CString &strDefval) const =0
 Pure virtual interface for reading setting from persisting layer.
 
virtual void WriteSetting (const CString &strSection, const CString &strSetting, const CString &strValue)=0
 Pure virtual interface for writing setting to persisting layer.
 
virtual void RemoveSection (const CString &strSection)=0
 Pure virtual interface for removing setting section from persisting layer.
 
virtual CString ConvertBoolSetting (bool bValue) const
 Converts a bool setting to a string value. More...
 
virtual CString ConvertIntSetting (int nValue) const
 Converts an integer setting to a string value. More...
 
virtual CString ConvertFloatSetting (double nValue, int nDecimals=6) const
 Converts a float setting to a string value. More...
 
virtual CString ConvertArraySetting (const CSimpleArray< CString > &values, const CString &strDelimiter=_T(", ")) const
 Converts a string-array setting value into a delimited string. More...
 
virtual CString ConvertArraySetting (const CSimpleArray< int > &values, const CString &strDelimiter=_T(", ")) const
 Converts an integer-array setting value into a delimited string. More...
 
virtual CString ConvertLogFontSetting (const LOGFONT &font) const
 Converts a font setting value into a delimited string. More...
 
virtual CString ConvertRectSetting (const RECT &rect) const
 Converts a rectangle setting value into a delimited string. More...
 
virtual CString ConvertColorSetting (COLORREF color) const
 Converts a color setting value into a delimited string. More...
 
virtual void SplitArraySetting (const CString &strArray, CSimpleArray< CString > &values, const CString &strDelimiter=_T(", ")) const
 Splits a delimited string into a string-array. More...
 
virtual const CString & GetSectionName () const
 Retrieves the current section name to store the settings. More...
 

Protected Attributes

CString m_ViewName
 Configuration name used when persisting the state (Translates into a section name)
 

Detailed Description

Abstract interface for persisting view configuration.

Constructor & Destructor Documentation

CViewConfigSection::CViewConfigSection ( const CString &  strViewName)
explicit

CViewConfigSection - Constructor.

Parameters
strViewNameName to identify and persist the configuration

Member Function Documentation

CString CViewConfigSection::ConvertArraySetting ( const CSimpleArray< CString > &  values,
const CString &  strDelimiter = _T(", ") 
) const
protectedvirtual

Converts a string-array setting value into a delimited string.

Parameters
valuesString-array
strDelimiterThe delimiter for combining the values of an array to a string
Returns
The string-array combined into a single string
CString CViewConfigSection::ConvertArraySetting ( const CSimpleArray< int > &  values,
const CString &  strDelimiter = _T(", ") 
) const
protectedvirtual

Converts an integer-array setting value into a delimited string.

Parameters
valuesInteger-array
strDelimiterThe delimiter for combining the values of an array to a string
Returns
The string-array combined into a single string
CString CViewConfigSection::ConvertBoolSetting ( bool  bValue) const
protectedvirtual

Converts a bool setting to a string value.

Parameters
bValueThe setting value
Returns
The setting value as string
CString CViewConfigSection::ConvertColorSetting ( COLORREF  color) const
protectedvirtual

Converts a color setting value into a delimited string.

Parameters
colorThe setting value
Returns
The delimited string
CString CViewConfigSection::ConvertFloatSetting ( double  nValue,
int  nDecimals = 6 
) const
protectedvirtual

Converts a float setting to a string value.

Parameters
nValueThe setting value
nDecimalsThe number of decimals to persist
Returns
The setting value as string
CString CViewConfigSection::ConvertIntSetting ( int  nValue) const
protectedvirtual

Converts an integer setting to a string value.

Parameters
nValueThe setting value
Returns
The setting value as string
CString CViewConfigSection::ConvertLogFontSetting ( const LOGFONT &  font) const
protectedvirtual

Converts a font setting value into a delimited string.

Parameters
fontThe setting value
Returns
The delimited string
CString CViewConfigSection::ConvertRectSetting ( const RECT &  rect) const
protectedvirtual

Converts a rectangle setting value into a delimited string.

Parameters
rectThe setting value
Returns
The delimited string
void CViewConfigSection::GetArraySetting ( const CString &  strName,
CSimpleArray< CString > &  values,
const CString &  strDelimiter = _T(", ") 
) const
virtual

Retrieves a string-array setting value for the view.

Parameters
strNameName of setting
valuesString-array
strDelimiterThe delimiter for splitting a single string into an array
void CViewConfigSection::GetArraySetting ( const CString &  strName,
CSimpleArray< int > &  values,
const CString &  strDelimiter = _T(", ") 
) const
virtual

Retrieves a integer-array setting value for the view.

Parameters
strNameName of setting
valuesinteger-array
strDelimiterThe delimiter for splitting a single string into an array
bool CViewConfigSection::GetBoolSetting ( const CString &  strName,
bool  bDefval = false 
) const
virtual

Retrieves a bool setting value for the view.

Parameters
strNameName of setting
bDefvalDefault value to return if no value was found
Returns
Value of the setting
COLORREF CViewConfigSection::GetColorSetting ( const CString &  strName,
const COLORREF  colorDefval = RGB(0, 0, 0) 
) const
virtual

Retrieves a color setting value for the view.

Parameters
strNameName of setting
colorDefvalDefault value to return if no value was found
Returns
Value of the setting
double CViewConfigSection::GetFloatSetting ( const CString &  strName,
double  nDefval = 0.0 
) const
virtual

Retrieves a float setting value for the view.

Parameters
strNameName of setting
nDefvalDefault value to return if no value was found
Returns
Value of the setting
int CViewConfigSection::GetIntSetting ( const CString &  strName,
int  nDefval = 0 
) const
virtual

Retrieves an integer setting value for the view.

Parameters
strNameName of setting
nDefvalDefault value to return if no value was found
Returns
Value of the setting
LOGFONT CViewConfigSection::GetLogFontSetting ( const CString &  strName) const
virtual

Retrieves a font setting value for the view.

Parameters
strNameName of setting
Returns
Value of the setting
CRect CViewConfigSection::GetRectSetting ( const CString &  strName,
const CRect &  rectDefval = CRect(0, 0, 0, 0) 
) const
virtual

Retrieves a rectangle setting value for the view.

Parameters
strNameName of setting
rectDefvalDefault value to return if no value was found
Returns
Value of the setting
const CString & CViewConfigSection::GetSectionName ( ) const
protectedvirtual

Retrieves the current section name to store the settings.

Returns
Current section name

Reimplemented in CViewConfigSectionProfiles.

CString CViewConfigSection::GetSetting ( const CString &  strName,
const CString &  strDefval = _T("") 
) const
virtual

Retrieves a setting value for the view.

Parameters
strNameName of setting
strDefvalDefault value to return if no value was found
Returns
Value of the setting

Reimplemented in CViewConfigSectionDefault.

void CViewConfigSection::SetArraySetting ( const CString &  strName,
const CSimpleArray< CString > &  values,
const CString &  strDelimiter = _T(", ") 
)
virtual

Updates the value of a string-array setting.

Parameters
strNameThe setting name
valuesThe new string array
strDelimiterThe delimiter for combining the values of an array to a string
void CViewConfigSection::SetArraySetting ( const CString &  strName,
const CSimpleArray< int > &  values,
const CString &  strDelimiter = _T(", ") 
)
virtual

Updates the value of an integer-array setting.

Parameters
strNameThe setting name
valuesThe integer array
strDelimiterThe delimiter for combining the values of an array to a string
void CViewConfigSection::SetBoolSetting ( const CString &  strName,
bool  bValue 
)
virtual

Updates the value of a bool setting.

Parameters
strNameThe setting name
bValueThe new setting value
void CViewConfigSection::SetColorSetting ( const CString &  strName,
COLORREF  color 
)
virtual

Updates the value of a color setting.

Parameters
strNameThe setting name
colorThe new setting value
void CViewConfigSection::SetFloatSetting ( const CString &  strName,
double  nValue,
int  nDecimals = 6 
)
virtual

Updates the value of a float setting.

Parameters
strNameThe setting name
nValueThe new setting value
nDecimalsThe number of decimals to persist
void CViewConfigSection::SetIntSetting ( const CString &  strName,
int  nValue 
)
virtual

Updates the value of an integer setting.

Parameters
strNameThe setting name
nValueThe new setting value
void CViewConfigSection::SetLogFontSetting ( const CString &  strName,
const LOGFONT &  font 
)
virtual

Updates the value of a font setting.

Parameters
strNameThe setting name
fontThe new setting value
void CViewConfigSection::SetRectSetting ( const CString &  strName,
const RECT &  rect 
)
virtual

Updates the value of a rectangle setting.

Parameters
strNameThe setting name
rectThe new setting value
void CViewConfigSection::SetSetting ( const CString &  strName,
const CString &  strValue 
)
virtual

Updates a setting value for the view.

Parameters
strNameName of setting
strValueNew setting value
void CViewConfigSection::SplitArraySetting ( const CString &  strArray,
CSimpleArray< CString > &  values,
const CString &  strDelimiter = _T(", ") 
) const
protectedvirtual

Splits a delimited string into a string-array.

Parameters
strArrayThe delimited string
valuesThe string array
strDelimiterThe delimiter