SECEditLangConfig Class
class SECEditLangConfig: public CObject, public ISECEditLangConfig
The SECEditLangConfig provides access to settings that make up what is what is referred to as a language configuration. A language configuration constitutes the information to provide the proper syntax coloring for a given programming language (e.g., C++, J++, VBScript, etc.). This includes a list of keywords, operators, delimiters, and what colors and fonts they should be rendered with.This object derives from teh ISECEditLangConfig interface, through which most other other objects will interact with the object. SECEditLangConfig objects are observed by the SECEdit model object (using the subject-observer design pattern) . The model is in turn observed by the viewport, which must reflect changes in the model (including language configuration changes) to the user.
Defined in: SECEditLangConfig.h
See Also
SECEditLangConfig SECEdit SECEditViewport
virtual ULONG STDMETHODCALLTYPE AddRef()
Add a reference to this object.
virtual ULONG STDMETHODCALLTYPE Release()
Release a reference to this object.
virtual ULONG STDMETHODCALLTYPE AddRef()
Add a reference to this object.
virtual ULONG STDMETHODCALLTYPE Release()
Release a reference to this object.
Class Members
Construction / initialization
Constructor.
ISECEditLangConfig interface
inline virtual BOOL GetAutoIndent() const
Queries the enablement of auto-indent.
inline SECEditColorInfo* GetColorInfo(int nIndex)
Retrieves color group information.
inline int GetColorInfoCount()
todo Add your Intellisense compatible description here
virtual SECEditColorInfo* GetDefaultColorInfo(unsigned short nDefGroupID)
Retrieves the number of color groups defined.
virtual unsigned short GetDefaultIndex(unsigned short nDefGroupID)
todo Add your Intellisense compatible description here
inline SECEditColorInfoArray* GetEditFontArrayPtr()
public accessor to protected m_arrColorInfo
inline CMap<CString, LPCTSTR, unsigned short, unsigned short>* GetKeywordList()
public accessor to protected m_KeywordList
inline virtual BOOL GetFontBold()
Queries the enablement of bold font.
inline virtual CString GetFontFaceName()
Retrieves the current font.
inline virtual BOOL GetFontItalic()
Queries the enablement of italic font.
inline virtual int GetFontSize()
Retrieves the current font size.
inline virtual CString GetLangId()
Retrieves the identifier for this language configuration.
inline virtual BOOL GetMatchCase()
todo Add your Intellisense compatible description here
inline virtual BOOL GetReplaceTabs()
Queries the enablement of tab replacment with spaces.
inline virtual BOOL GetShowWhitespace()
todo Add your Intellisense compatible description here
virtual SECEditKeywordInfo* GetSpecialKeyword(LPCTSTR lpszStartChars, int nLength, int nTokenLength, SECEditKeywordType keytype = secKT_All)
Examines a string for keywords.
virtual void GetSpecialKeywords(SECEditKeywordInfoList& keylist, SECEditKeywordType keytype = secKT_All)
Retrieves a list of keywords.
inline virtual int GetTabSize() const
todo Add your Intellisense compatible description here
inline virtual BOOL GetVirtualWhitespace()
Queries the enablement of virtual whitespace.
virtual int IsKeyword(LPCTSTR lpszKeyword, int nLength, unsigned short& nOffset)
Compares a string against the list of keywords.
virtual BOOL IsKWCharacter(unsigned int nChar, SECEditKWChars kwchars)
Queries whether a character is a token keyword character.
inline virtual void SetAutoIndent(const BOOL bAutoIndent)
Enables auto-indent.
inline virtual void SetFontBold(BOOL bFontBold)
Enables bold font.
virtual void SetFontFaceName(LPCTSTR lpszFaceName)
Sets the current font.
inline virtual void SetFontItalic(BOOL bFontItalic)
Enables italic font.
inline virtual void SetFontSize(int nFontSize)
Sets the current font size.
virtual void SetKWCharacters(LPCTSTR lpszChars, SECEditKWChars kwchars, BOOL bReplaceAll = FALSE )
Sets token based keyword characters.
inline virtual void SetLangId(LPCTSTR lpszLangId)
Sets the identifier of this language configuraion.
inline virtual void SetMatchCase(BOOL bMatchCase)
Enables keyword case matching.
inline virtual void SetReplaceTabs(BOOL v)
Enables replacing tab keys with spaces.
inline virtual void SetShowWhitespace(BOOL v)
Enables the display of white space using visible characters.
virtual int SetTabSize(const int nTabSize)
Sets the number of columns the tab key advances the cursor.
inline virtual void SetVirtualWhitespace(BOOL v)
Enables virtual whitespace in the editor.
virtual ULONG STDMETHODCALLTYPE AddRef()
Add a reference to this object.
virtual ULONG STDMETHODCALLTYPE Release()
Release a reference to this object.
ISubject interface
virtual void AddObserver(sfl::IObserver* pObserver)
Adds a observer to the list of dependents on this object. When a change in state occurs, all observers are notified.
virtual void RemoveObserver(sfl::IObserver* pObserver)
The dependent identified by the argument is removed from this objects list of dependents
virtual void UpdateAllObservers(sfl::IObserver* pObserver = NULL, sfl::IMessage* pMsg = NULL)
All objects dependent on this object are sent a notification indicating what aspect of this object has changed
Persistence
virtual void Serialize(CArchive& ar)
todo Add your Intellisense compatible description here
Language registration
static BOOL RegisterLanguage(LPCTSTR lpszLanguage, Reader* pReader, Writer* pWriter)
Associates reader and writer object to a language identifier.
static void GetLanguageList(CStringList& strList)
Retrieves a list of language identifiers.
static SECEditLangConfig* GetLanguage(LPCTSTR lpszLanguage)
Retrieves an language configuration associated with an identifier.
static void SetLanguage(LPCTSTR lpszLanguage, SECEditLangConfig* pLangConfig)
Sets the language configuration for a given identifier.
static BOOL ReadLanguage(LPCTSTR lpszLanguage)
Reads a language configuarion.
static BOOL WriteLanguage(LPCTSTR lpszLanguage)
Persists a language configuration.
Protected data members
static Manager m_manager
The singleton language configuration manager.
CString m_strLangId
The identifier for this language configuration.
ULONG m_ulRefCount
Reference count value.
Editor Settings
BOOL m_bShowWhitespace
Indicates whether white space is displayed as visible characters.
BOOL m_bReplaceTabs
Indicates whether tab characters are replaced with spaces.
BOOL m_bVirtualWhitespace
Indicates whether virtual whitespace is enabled.
int m_nTabSize
The number of space characters that equals one tab character.
BOOL m_bAutoIndent
Indicates whether auto-indent is enabled.
BOOL m_bMatchCase
Indicates whether keyword case matching is enabled.
Font Settings
CString m_strFontFaceName
The current font face name.
int m_nFontSize
The current font size in points.
BOOL m_bFontItalic
The font italic state.
BOOL m_bFontBold
The font bold state.
Language Defitnion
CMap<CString, LPCTSTR, unsigned short, unsigned short> m_KeywordList
A map of simple keywords.
SECEditCharacterFlags m_KWStartChars
Special characters that can begin a keyword.
SECEditCharacterFlags m_KWEndChars
Special characters that can end a keyword.
SECEditCharacterFlags m_KWMiddleChars
Special characters that can be present within a keyword.
SECEditCharacterFlags m_KWDelimiters
Delimiter characters.
SECEditCharacterFlags m_KWOperators
Operators
SECEditKeywordInfoMap m_TokenKeyList
A map of special (token based) keywords.
SECEditColorGroupMap m_GroupColor
A map of types to colors.
SECEditColorInfoArray m_arrColorInfo
Array of color info.
unsigned short m_arrDefColors [4]
Array of default color indices.
CMapStringToString m_KeywordCaseList
Map of case insensitive keywords.
int m_KWOffset
Offset for special characters.