]> git.saurik.com Git - wxWidgets.git/blob - wxPython/src/_stdpaths.i
9c5d94733fcb16d61a059028e64b73a370d4192d
[wxWidgets.git] / wxPython / src / _stdpaths.i
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: _stdpaths.i
3 // Purpose: SWIG interface for wxStandardPaths
4 //
5 // Author: Robin Dunn
6 //
7 // Created: 10-Nov-2004
8 // RCS-ID: $Id$
9 // Copyright: (c) 2004 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
12
13 // Not a %module
14
15
16 //---------------------------------------------------------------------------
17
18 %{
19 #include <wx/stdpaths.h>
20 %}
21
22
23 //---------------------------------------------------------------------------
24 %newgroup
25
26 DocStr(wxStandardPaths,
27 "wx.StandardPaths returns the standard locations in the file system and
28 should be used by the programs to find their data files in a portable
29 way.
30
31 In the description of the methods below, the example return values are
32 given for the Unix, Windows and Mac OS X systems, however please note
33 that these are just the examples and the actual values may differ. For
34 example, under Windows: the system administrator may change the
35 standard directories locations, i.e. the Windows directory may be
36 named W:\Win2003 instead of the default C:\Windows.
37
38 The strings appname and username should be replaced with the value
39 returned by `wx.App.GetAppName` and the name of the currently logged
40 in user, respectively. The string prefix is only used under Unix and
41 is /usr/local by default but may be changed using `SetInstallPrefix`.
42
43 The directories returned by the methods of this class may or may not
44 exist. If they don't exist, it's up to the caller to create them,
45 wxStandardPaths doesn't do it.
46
47 Finally note that these functions only work with standardly packaged
48 applications. I.e. under Unix you should follow the standard
49 installation conventions and under Mac you should create your
50 application bundle according to the Apple guidelines. Again, this
51 class doesn't help you to do it.", "");
52
53 class wxStandardPaths
54 {
55 public:
56
57 DocDeclStr(
58 static wxStandardPaths& , Get(),
59 "Return the global standard paths object", "");
60
61 DocDeclStr(
62 virtual wxString , GetConfigDir() const,
63 "Return the directory with system config files: /etc under Unix,
64 c:\Documents and Settings\All Users\Application Data under Windows,
65 /Library/Preferences for Mac", "");
66
67
68 DocDeclStr(
69 virtual wxString , GetUserConfigDir() const,
70 "Return the directory for the user config files: $HOME under Unix,
71 c:\Documents and Settings\username under Windows,
72 ~/Library/Preferences under Mac
73
74 Only use this if you have a single file to put there, otherwise
75 `GetUserDataDir` is more appropriate", "");
76
77
78 DocDeclStr(
79 virtual wxString , GetDataDir() const,
80 "Return the location of the application's global, (i.e. not
81 user-specific,) data files: prefix/share/appname under Unix,
82 c:\Program Files\appname under Windows,
83 appname.app/Contents/SharedSupport app bundle directory under Mac.", "");
84
85
86 DocDeclStr(
87 virtual wxString , GetLocalDataDir() const,
88 "Return the location for application data files which are
89 host-specific. Same as `GetDataDir` except under Unix where it is
90 /etc/appname", "");
91
92
93 DocDeclStr(
94 virtual wxString , GetUserDataDir() const,
95 "Return the directory for the user-dependent application data files:
96 $HOME/.appname under Unix, c:\Documents and
97 Settings\username\Application Data\appname under Windows and
98 ~/Library/Application Support/appname under Mac", "");
99
100
101 DocDeclStr(
102 virtual wxString , GetUserLocalDataDir() const,
103 "Return the directory for user data files which shouldn't be shared
104 with the other machines
105
106 Same as `GetUserDataDir` for all platforms except Windows where it is
107 the 'Local Settings\Application Data\appname' directory.", "");
108
109
110 DocDeclStr(
111 virtual wxString , GetPluginsDir() const,
112 "Return the directory where the loadable modules (plugins) live:
113 prefix/lib/appname under Unix, program directory under Windows and
114 Contents/Plugins app bundle subdirectory under Mac", "");
115
116
117 #ifdef __WXGTK__
118 DocDeclStr(
119 void , SetInstallPrefix(const wxString& prefix),
120 "Set the program installation directory which is /usr/local by default.
121 This value will be used by other methods such as `GetDataDir` and
122 `GetPluginsDir` as the prefix for what they return. (Unix only.)", "");
123
124
125 DocDeclStr(
126 wxString , GetInstallPrefix() const,
127 "Get the program installation prefix. (Unix only.)", "");
128 #else
129 %extend {
130 void SetInstallPrefix(const wxString& prefix) {}
131 wxString GetInstallPrefix() { return wxEmptyString; }
132 }
133 #endif
134 };
135
136
137 //---------------------------------------------------------------------------