CGridListCtrlEx
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
CViewConfigSectionProfiles Class Reference

Abstract interface for persisting view configuration, that can switch between different view configuration profiles. More...

Inheritance diagram for CViewConfigSectionProfiles:
CViewConfigSectionDefault CViewConfigSection CViewConfigSectionWinApp

Public Member Functions

 CViewConfigSectionProfiles (const CString &strViewName)
 CViewConfigSectionProfiles - Constructor. More...
 
virtual void RemoveCurrentConfig ()
 Removes the current configuration.
 
virtual void GetProfiles (CSimpleArray< CString > &profiles) const
 Retrieves the list of currently available configuration profiles. More...
 
virtual CString GetActiveProfile ()
 Retrieves the currently active profile. More...
 
virtual void SetActiveProfile (const CString &strProfile)
 Switches to a new active configuration profile. More...
 
virtual void AddProfile (const CString &strProfile)
 Adds a profile to the official list of column configuration profiles. More...
 
virtual void DeleteProfile (const CString &strProfile)
 Removes a profile from the official list of column configuration profiles. More...
 
- Public Member Functions inherited from CViewConfigSectionDefault
 CViewConfigSectionDefault (const CString &strViewName)
 CViewConfigSectionDefault - Constructor. More...
 
virtual CViewConfigSectionGetDefaultConfig ()
 Retrieve the in memory default configuration. More...
 
virtual bool HasDefaultConfig () const
 Contains default configuration. More...
 
virtual void ResetConfigDefault ()
 Resets the current configuration by deleting it and restoring it from the in memory default configuration. More...
 
virtual CString GetSetting (const CString &strName, const CString &strDefval=_T("")) const
 Retrieves a setting value for the view. More...
 
- Public Member Functions inherited from CViewConfigSection
 CViewConfigSection (const CString &strViewName)
 CViewConfigSection - Constructor. More...
 
virtual ~CViewConfigSection ()
 CViewConfigSection - Destructor.
 
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...
 

Protected Member Functions

virtual const CString & GetSectionName () const
 Retrieves the section name of the currently active configuration profile. More...
 
virtual void SplitSectionName (const CString &strSection, CString &strViewName, CString &strProfile)
 Splits the section name into a view-name and profile-name. More...
 
virtual CString JoinSectionName (const CString &strViewName, const CString &strProfile) const
 Combines the view-name and the profile-name into a section name. More...
 
- Protected Member Functions inherited from CViewConfigSection
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...
 

Protected Attributes

CString m_CurrentSection
 Section name combined from the viewname and the current profile name.
 
- Protected Attributes inherited from CViewConfigSectionDefault
CViewConfigSectionLocal m_DefaultConfig
 Default configuration stored in memory.
 
- Protected Attributes inherited from CViewConfigSection
CString m_ViewName
 Configuration name used when persisting the state (Translates into a section name)
 

Detailed Description

Abstract interface for persisting view configuration, that can switch between different view configuration profiles.

Constructor & Destructor Documentation

CViewConfigSectionProfiles::CViewConfigSectionProfiles ( const CString &  strViewName)
explicit

CViewConfigSectionProfiles - Constructor.

Parameters
strViewNameName to identify and persist the configuration

Member Function Documentation

void CViewConfigSectionProfiles::AddProfile ( const CString &  strProfile)
virtual

Adds a profile to the official list of column configuration profiles.

Parameters
strProfileName of the profile
void CViewConfigSectionProfiles::DeleteProfile ( const CString &  strProfile)
virtual

Removes a profile from the official list of column configuration profiles.

Parameters
strProfileName of the profile
CString CViewConfigSectionProfiles::GetActiveProfile ( )
virtual

Retrieves the currently active profile.

Returns
Name of the profile
void CViewConfigSectionProfiles::GetProfiles ( CSimpleArray< CString > &  profiles) const
virtual

Retrieves the list of currently available configuration profiles.

Parameters
profilesList of profile names
const CString & CViewConfigSectionProfiles::GetSectionName ( ) const
protectedvirtual

Retrieves the section name of the currently active configuration profile.

Returns
Current section name

Reimplemented from CViewConfigSection.

CString CViewConfigSectionProfiles::JoinSectionName ( const CString &  strViewName,
const CString &  strProfile 
) const
protectedvirtual

Combines the view-name and the profile-name into a section name.

Parameters
strViewNameName of the configuration
strProfileName of a profile in the configuration
Returns
The section name
void CViewConfigSectionProfiles::SetActiveProfile ( const CString &  strProfile)
virtual

Switches to a new active configuration profile.

Parameters
strProfileName of the new profile
void CViewConfigSectionProfiles::SplitSectionName ( const CString &  strSection,
CString &  strViewName,
CString &  strProfile 
)
protectedvirtual

Splits the section name into a view-name and profile-name.

Parameters
strSectionName of the section
strViewNameName of the configuration
strProfileName of a profile in the configuration