sysopt.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/sysopt.h
  3. // Purpose: wxSystemOptions
  4. // Author: Julian Smart
  5. // Modified by:
  6. // Created: 2001-07-10
  7. // Copyright: (c) Julian Smart
  8. // Licence: wxWindows licence
  9. /////////////////////////////////////////////////////////////////////////////
  10. #ifndef _WX_SYSOPT_H_
  11. #define _WX_SYSOPT_H_
  12. #include "wx/object.h"
  13. // ----------------------------------------------------------------------------
  14. // Enables an application to influence the wxWidgets implementation
  15. // ----------------------------------------------------------------------------
  16. class
  17. #if wxUSE_SYSTEM_OPTIONS
  18. WXDLLIMPEXP_BASE
  19. #endif
  20. wxSystemOptions : public wxObject
  21. {
  22. public:
  23. wxSystemOptions() { }
  24. // User-customizable hints to wxWidgets or associated libraries
  25. // These could also be used to influence GetSystem... calls, indeed
  26. // to implement SetSystemColour/Font/Metric
  27. #if wxUSE_SYSTEM_OPTIONS
  28. static void SetOption(const wxString& name, const wxString& value);
  29. static void SetOption(const wxString& name, int value);
  30. #endif // wxUSE_SYSTEM_OPTIONS
  31. static wxString GetOption(const wxString& name);
  32. static int GetOptionInt(const wxString& name);
  33. static bool HasOption(const wxString& name);
  34. static bool IsFalse(const wxString& name)
  35. {
  36. return HasOption(name) && GetOptionInt(name) == 0;
  37. }
  38. };
  39. #if !wxUSE_SYSTEM_OPTIONS
  40. // define inline stubs for accessors to make it possible to use wxSystemOptions
  41. // in the library itself without checking for wxUSE_SYSTEM_OPTIONS all the time
  42. /* static */ inline
  43. wxString wxSystemOptions::GetOption(const wxString& WXUNUSED(name))
  44. {
  45. return wxEmptyString;
  46. }
  47. /* static */ inline
  48. int wxSystemOptions::GetOptionInt(const wxString& WXUNUSED(name))
  49. {
  50. return 0;
  51. }
  52. /* static */ inline
  53. bool wxSystemOptions::HasOption(const wxString& WXUNUSED(name))
  54. {
  55. return false;
  56. }
  57. #endif // !wxUSE_SYSTEM_OPTIONS
  58. #endif
  59. // _WX_SYSOPT_H_