ResizableState.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // This file is part of ResizableLib
  4. // https://github.com/ppescher/resizablelib
  5. //
  6. // Copyright (C) 2000-2015 by Paolo Messina
  7. // mailto:ppescher@hotmail.com
  8. //
  9. // The contents of this file are subject to the Artistic License 2.0
  10. // http://opensource.org/licenses/Artistic-2.0
  11. //
  12. // If you find this code useful, credits would be nice!
  13. //
  14. /////////////////////////////////////////////////////////////////////////////
  15. /*!
  16. * @file
  17. * @brief Interface for the CResizableState class.
  18. */
  19. #if !defined(AFX_RESIZABLESTATE_H__INCLUDED_)
  20. #define AFX_RESIZABLESTATE_H__INCLUDED_
  21. #if _MSC_VER > 1000
  22. #pragma once
  23. #endif // _MSC_VER > 1000
  24. /*! @addtogroup CoreComponents
  25. * @{
  26. */
  27. //! @brief Provides basic persisting capabilities
  28. /*!
  29. * Derive from this class to persist user interface settings, or anything
  30. * suitable. The base implementation uses the application profile, which can
  31. * be set to either the Registry or an INI File. Other storing methods
  32. * can be implemented in derived classes.
  33. */
  34. class CResizableState
  35. {
  36. static CString m_sDefaultStorePath;
  37. CString m_sStorePath;
  38. protected:
  39. //! @brief Get default path where state is stored
  40. static LPCTSTR GetDefaultStateStore();
  41. //! @brief Set default path where state is stored
  42. static void SetDefaultStateStore(LPCTSTR szPath);
  43. //! @brief Get current path where state is stored
  44. LPCTSTR GetStateStore();
  45. //! @brief Set current path where state is stored
  46. void SetStateStore(LPCTSTR szPath);
  47. //! @name Overridables
  48. //@{
  49. //! @brief Read state information
  50. virtual BOOL ReadState(LPCTSTR szId, CString& rsState);
  51. //! @brief Write state information
  52. virtual BOOL WriteState(LPCTSTR szId, LPCTSTR szState);
  53. //@}
  54. public:
  55. CResizableState();
  56. virtual ~CResizableState();
  57. };
  58. // @}
  59. #endif // !defined(AFX_RESIZABLESTATE_H__INCLUDED_)