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