ccOptions.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #pragma once
  2. //##########################################################################
  3. //# #
  4. //# CLOUDCOMPARE #
  5. //# #
  6. //# This program is free software; you can redistribute it and/or modify #
  7. //# it under the terms of the GNU General Public License as published by #
  8. //# the Free Software Foundation; version 2 or later of the License. #
  9. //# #
  10. //# This program is distributed in the hope that it will be useful, #
  11. //# but WITHOUT ANY WARRANTY; without even the implied warranty of #
  12. //# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
  13. //# GNU General Public License for more details. #
  14. //# #
  15. //# COPYRIGHT: Daniel Girardeau-Montaut #
  16. //# #
  17. //##########################################################################
  18. #include "CCAppCommon.h"
  19. //Qt
  20. #include <QString>
  21. //! Main application options
  22. class CCAPPCOMMON_LIB_API ccOptions
  23. {
  24. public: //parameters
  25. //! Whether to display the normals by default or not
  26. bool normalsDisplayedByDefault;
  27. //! Use native load/save dialogs
  28. bool useNativeDialogs;
  29. //! Should we ask for confirmation when user clicked to quit the app ?
  30. bool confirmQuit;
  31. public: //methods
  32. //! Default constructor
  33. ccOptions();
  34. //! Resets parameters to default values
  35. void reset();
  36. //! Loads from persistent DB
  37. void fromPersistentSettings();
  38. //! Saves to persistent DB
  39. void toPersistentSettings() const;
  40. public: //static methods
  41. //! Returns the stored values of each parameter.
  42. static const ccOptions& Instance() { return InstanceNonConst(); }
  43. //! Release unique instance (if any)
  44. static void ReleaseInstance();
  45. //! Sets parameters
  46. static void Set(const ccOptions& options);
  47. protected: //methods
  48. //! Returns the stored values of each parameter.
  49. static ccOptions& InstanceNonConst();
  50. };