chxliteprefs.h
上传用户:dangjiwu
上传日期:2013-07-19
资源大小:42019k
文件大小:2k
源码类别:

Symbian

开发平台:

Visual C++

  1. #ifndef __chxliteprefs_h
  2. #define __chxliteprefs_h
  3. #include "hxtypes.h"
  4. #include "hxmap.h"
  5. #include "unkimp.h"
  6. #include "hxstring.h"
  7. #include "hxprefs.h"
  8. #include "hxengin.h"
  9. class CHXStringList;
  10. class CHXDataFile;
  11. struct IHXCommonClassFactory;
  12. class HXMutex;
  13. enum ParseState
  14. {
  15.     eParsingWhiteSpace,
  16.     eParsingName,
  17.     eParsingValue,
  18.     eParsingShadow,
  19.     eParsingComment
  20. };
  21. class CHXLitePrefs : public IHXPreferences,
  22.      public IHXPreferences3,
  23. #if !defined(HELIX_CONFIG_LITEPREFS_SLUGGISH_OUT)
  24.      public IHXCallback,
  25. #endif
  26.      public CUnknownIMP
  27. {
  28. public:
  29.     CHXLitePrefs(const char* pRootPath = NULL);
  30.     virtual ~CHXLitePrefs();
  31.     DECLARE_UNKNOWN(CHXLitePrefs);
  32.     // CHXLitePrefs
  33.     STDMETHOD(SetContext)         (THIS_ IUnknown* pContext);
  34.     STDMETHOD(Commit)         (THIS);
  35.     STDMETHOD(SetAutoCommit)            (THIS_ bool bAutoCommit);
  36.     STDMETHOD(ResetPrefs)               (THIS);
  37.     // IHXPreferences
  38.     STDMETHOD(ReadPref) (THIS_ const char* pName,
  39. REF(IHXBuffer*) pValue);
  40.     STDMETHOD(WritePref) (THIS_ const char* pName,
  41. IHXBuffer* pValue);
  42.     // IHXPreferences3
  43.     STDMETHOD(Open) (THIS_ const char* pCompanyName,
  44. const char* pProductName,
  45. ULONG32 nProdMajorVer,
  46. ULONG32 nProdMinorVer);
  47.     STDMETHOD(OpenShared) (THIS_ const char* pCompanyName);
  48.     STDMETHOD(DeletePref) (THIS_ const char* pPrekKey);
  49. #if !defined(HELIX_CONFIG_LITEPREFS_SLUGGISH_OUT)
  50.     // IHXCallback
  51.     STDMETHOD(Func) (THIS);
  52. #endif // (HELIX_CONFIG_LITEPREFS_SLUGGISH_OUT)
  53.     void                        Close(void);
  54. private:
  55.     CHXString GetFullPath(const CHXString& strFileName);
  56.     void PossiblyCommitPrefChange();
  57.     
  58.     CHXMapStringToOb m_prefs;
  59.     HXMutex* m_pMutex;
  60.     IHXCommonClassFactory* m_pFactory;
  61.     IHXScheduler* m_pScheduler;
  62.     CallbackHandle m_hCallback;
  63.     CHXString                   m_strRootPath;
  64.     CHXString                   m_strFileName;
  65.     bool                        m_bAutoCommit;
  66. };
  67. #endif /* #ifndef __chxliteprefs_h */