]> git.saurik.com Git - wxWidgets.git/blob - interface/stdpaths.h
6f4940266d5ad3685bf01e0bd810d262bbde2992
[wxWidgets.git] / interface / stdpaths.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: stdpaths.h
3 // Purpose: documentation for wxStandardPaths class
4 // Author: wxWidgets team
5 // RCS-ID: $Id$
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
8
9 /**
10 @class wxStandardPaths
11 @wxheader{stdpaths.h}
12
13 wxStandardPaths returns the standard locations in the file system and should be
14 used by applications to find their data files in a portable way.
15
16 In the description of the methods below, the example return values are given
17 for the Unix, Windows and Mac OS X systems, however please note that these are
18 just the examples and the actual values may differ. For example, under Windows:
19 the system administrator may change the standard directories locations, i.e.
20 the Windows directory may be named @c W:\Win2003 instead of
21 the default @c C:\Windows.
22
23 The strings @c @e appname and @c @e username should be
24 replaced with the value returned by wxApp::GetAppName
25 and the name of the currently logged in user, respectively. The string
26 @c @e prefix is only used under Unix and is @c /usr/local by
27 default but may be changed using wxStandardPaths::SetInstallPrefix.
28
29 The directories returned by the methods of this class may or may not exist. If
30 they don't exist, it's up to the caller to create them, wxStandardPaths doesn't
31 do it.
32
33 Finally note that these functions only work with standardly packaged
34 applications. I.e. under Unix you should follow the standard installation
35 conventions and under Mac you should create your application bundle according
36 to the Apple guidelines. Again, this class doesn't help you to do it.
37
38 This class is MT-safe: its methods may be called concurrently from different
39 threads without additional locking.
40
41 @library{wxbase}
42 @category{file}
43
44 @seealso
45 wxFileConfig
46 */
47 class wxStandardPaths
48 {
49 public:
50 /**
51 Returns reference to the unique global standard paths object.
52 */
53 static wxStandardPathsBase Get();
54
55 /**
56 Return the directory containing the system config files.
57 Example return values:
58 Unix: @c /etc
59 Windows: @c C:\Documents and Settings\All Users\Application Data
60 Mac: @c /Library/Preferences
61
62 @see wxFileConfig
63 */
64 wxString GetConfigDir();
65
66 /**
67 Return the location of the applications global, i.e. not user-specific,
68 data files.
69 Example return values:
70 Unix: @c @e prefix/share/@e appname
71 Windows: the directory where the executable file is located
72 Mac: @c @e appname.app/Contents/SharedSupport bundle subdirectory
73
74 @see GetLocalDataDir()
75 */
76 wxString GetDataDir();
77
78 /**
79 Return the directory containing the current user's documents.
80 Example return values:
81 Unix: @c ~ (the home directory)
82 Windows: @c C:\Documents and Settings\@e username\Documents
83 Mac: @c ~/Documents
84 This function is new since wxWidgets version 2.7.0
85 */
86 wxString GetDocumentsDir();
87
88 /**
89 Return the directory and the filename for the current executable.
90 Example return values:
91 Unix: @c /usr/local/bin/exename
92 Windows: @c C:\Programs\AppFolder\exename.exe
93 Mac: @c /Programs/exename
94 */
95 wxString GetExecutablePath();
96
97 /**
98 @b Note: This function is only available under Unix.
99 Return the program installation prefix, e.g. @c /usr, @c /opt or
100 @c /home/zeitlin.
101 If the prefix had been previously by
102 SetInstallPrefix(), returns that
103 value, otherwise tries to determine it automatically (Linux only right
104 now) and finally returns the default @c /usr/local value if it failed.
105 */
106 wxString GetInstallPrefix();
107
108 /**
109 Return the location for application data files which are host-specific and
110 can't, or shouldn't, be shared with the other machines.
111 This is the same as GetDataDir() except
112 under Unix where it returns @c /etc/@e appname.
113 */
114 wxString GetLocalDataDir();
115
116 /**
117 Return the localized resources directory containing the resource files of the
118 specified category for the given language.
119 In general this is just the same as @a lang subdirectory of
120 GetResourcesDir() (or
121 @c @e lang.lproj under Mac OS X) but is something quite
122 different for message catalog category under Unix where it returns the standard
123 @c @e prefix/share/locale/@e lang/LC_MESSAGES directory.
124 This function is new since wxWidgets version 2.7.0
125 */
126 wxString GetLocalizedResourcesDir(const wxString& lang,
127 ResourceCat category = ResourceCat_None);
128
129 /**
130 Return the directory where the loadable modules (plugins) live.
131 Example return values:
132 Unix: @c @e prefix/lib/@e appname
133 Windows: the directory of the executable file
134 Mac: @c @e appname.app/Contents/PlugIns bundle subdirectory
135
136 @see wxDynamicLibrary
137 */
138 wxString GetPluginsDir();
139
140 /**
141 Return the directory where the application resource files are located. The
142 resources are the auxiliary data files needed for the application to run and
143 include, for example, image and sound files it might use.
144 This function is the same as GetDataDir() for
145 all platforms except Mac OS X.
146 Example return values:
147 Unix: @c @e prefix/share/@e appname
148 Windows: the directory where the executable file is located
149 Mac: @c @e appname.app/Contents/Resources bundle subdirectory
150 This function is new since wxWidgets version 2.7.0
151
152 @see GetLocalizedResourcesDir()
153 */
154 wxString GetResourcesDir();
155
156 /**
157 Return the directory for storing temporary files. To create unique temporary
158 files,
159 it is best to use wxFileName::CreateTempFileName for correct behaviour when
160 multiple processes are attempting to create temporary files.
161 This function is new since wxWidgets version 2.7.2
162 */
163 wxString GetTempDir();
164
165 /**
166 Return the directory for the user config files:
167 Unix: @c ~ (the home directory)
168 Windows: @c C:\Documents and Settings\@e username\Application Data
169 Mac: @c ~/Library/Preferences
170 Only use this method if you have a single configuration file to put in this
171 directory, otherwise GetUserDataDir() is
172 more appropriate.
173 */
174 wxString GetUserConfigDir();
175
176 /**
177 Return the directory for the user-dependent application data files:
178 Unix: @c ~/.@e appname
179 Windows: @c C:\Documents and Settings\@e username\Application Data\@e
180 appname
181 Mac: @c ~/Library/Application Support/@e appname
182 */
183 wxString GetUserDataDir();
184
185 /**
186 Return the directory for user data files which shouldn't be shared with
187 the other machines.
188 This is the same as GetUserDataDir() for
189 all platforms except Windows where it returns
190 @c C:\Documents and Settings\@e username\Local Settings\Application Data\@e
191 appname
192 */
193 wxString GetUserLocalDataDir();
194
195 /**
196 @b Note: This function is only available under Unix.
197 Lets wxStandardPaths know about the real program installation prefix on a Unix
198 system. By default, the value returned by
199 GetInstallPrefix() is used.
200 Although under Linux systems the program prefix may usually be determined
201 automatically, portable programs should call this function. Usually the prefix
202 is set during program configuration if using GNU autotools and so it is enough
203 to pass its value defined in @c config.h to this function.
204 */
205 void SetInstallPrefix(const wxString& prefix);
206
207 /**
208 Controls what application information is used when constructing paths that
209 should be unique to this program, such as the application data directory, the
210 plugins directory on Unix, etc.
211 Valid values for @a info are @c AppInfo_None and either one or
212 combination of @c AppInfo_AppName and @c AppInfo_VendorName. The
213 first one tells this class to not use neither application nor vendor name in
214 the paths.
215 By default, only the application name is used under Unix systems but both
216 application and vendor names are used under Windows and Mac.
217 */
218 void UseAppInfo(int info);
219 };