]> git.saurik.com Git - wxWidgets.git/blob - interface/stdpaths.h
Mention Scrolled and wxScrolledWindow
[wxWidgets.git] / interface / stdpaths.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: stdpaths.h
3 // Purpose: interface of wxStandardPaths
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 @see wxFileConfig
45 */
46 class wxStandardPaths
47 {
48 public:
49 /**
50 Returns reference to the unique global standard paths object.
51 */
52 static wxStandardPathsBase Get();
53
54 /**
55 Return the directory containing the system config files.
56 Example return values:
57 @li Unix: @c /etc
58 @li Windows: @c C:\Documents and Settings\All Users\Application Data
59 @li Mac: @c /Library/Preferences
60
61 @see wxFileConfig
62 */
63 wxString GetConfigDir() const;
64
65 /**
66 Return the location of the applications global, i.e. not user-specific,
67 data files.
68 Example return values:
69 @li Unix: @c @e prefix/share/@e appname
70 @li Windows: the directory where the executable file is located
71 @li Mac: @c @e appname.app/Contents/SharedSupport bundle subdirectory
72
73 @see GetLocalDataDir()
74 */
75 wxString GetDataDir() const;
76
77 /**
78 Return the directory containing the current user's documents.
79 Example return values:
80 @li Unix: @c ~ (the home directory)
81 @li Windows: @c C:\Documents and Settings\@e username\Documents
82 @li Mac: @c ~/Documents
83
84 @wxsince{2.7.0}
85 */
86 wxString GetDocumentsDir() const;
87
88 /**
89 Return the directory and the filename for the current executable.
90 Example return values:
91 @li Unix: @c /usr/local/bin/@e exename
92 @li Windows: @c C:\Programs\AppFolder\@e exename.exe
93 @li Mac: @c /Programs/@e exename
94 */
95 wxString GetExecutablePath() const;
96
97 /**
98 @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 SetInstallPrefix(), returns that
102 value, otherwise tries to determine it automatically (Linux only right
103 now) and finally returns the default @c /usr/local value if it failed.
104 */
105 wxString GetInstallPrefix() const;
106
107 /**
108 Return the location for application data files which are host-specific and
109 can't, or shouldn't, be shared with the other machines.
110 This is the same as GetDataDir() except
111 under Unix where it returns @c /etc/@e appname.
112 */
113 wxString GetLocalDataDir() const;
114
115 /**
116 Return the localized resources directory containing the resource files of the
117 specified category for the given language.
118 In general this is just the same as @a lang subdirectory of
119 GetResourcesDir() (or @e lang.lproj under Mac OS X) but is something quite
120 different for message catalog category under Unix where it returns the standard
121 @c @e prefix/share/locale/@e lang/LC_MESSAGES directory.
122
123 @wxsince{2.7.0}
124 */
125 wxString GetLocalizedResourcesDir(const wxString& lang,
126 ResourceCat category = ResourceCat_None) const;
127
128 /**
129 Return the directory where the loadable modules (plugins) live.
130 Example return values:
131 @li Unix: @c @e prefix/lib/@e appname
132 @li Windows: the directory of the executable file
133 @li Mac: @c @e appname.app/Contents/PlugIns bundle subdirectory
134
135 @see wxDynamicLibrary
136 */
137 wxString GetPluginsDir() const;
138
139 /**
140 Return the directory where the application resource files are located. The
141 resources are the auxiliary data files needed for the application to run and
142 include, for example, image and sound files it might use.
143 This function is the same as GetDataDir() for
144 all platforms except Mac OS X.
145 Example return values:
146 @li Unix: @c @e prefix/share/@e appname
147 @li Windows: the directory where the executable file is located
148 @li Mac: @c @e appname.app/Contents/Resources bundle subdirectory
149
150 @wxsince{2.7.0}
151
152 @see GetLocalizedResourcesDir()
153 */
154 wxString GetResourcesDir() const;
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
162 @wxsince{2.7.2}
163 */
164 wxString GetTempDir() const;
165
166 /**
167 Return the directory for the user config files:
168 @li Unix: @c ~ (the home directory)
169 @li Windows: @c C:\Documents and Settings\@e username\Application Data
170 @li Mac: @c ~/Library/Preferences
171 Only use this method if you have a single configuration file to put in this
172 directory, otherwise GetUserDataDir() is
173 more appropriate.
174 */
175 wxString GetUserConfigDir() const;
176
177 /**
178 Return the directory for the user-dependent application data files:
179 @li Unix: @c ~/.@e appname
180 @li Windows: @c C:\Documents and Settings\@e username\Application Data\
181 @e appname
182 @li Mac: @c ~/Library/Application Support/@e appname
183 */
184 wxString GetUserDataDir() const;
185
186 /**
187 Return the directory for user data files which shouldn't be shared with
188 the other machines.
189 This is the same as GetUserDataDir() for
190 all platforms except Windows where it returns
191 @c C:\Documents and Settings\@e username\Local Settings\Application Data\@e
192 appname
193 */
194 wxString GetUserLocalDataDir() const;
195
196 /**
197 @note This function is only available under Unix.
198 Lets wxStandardPaths know about the real program installation prefix on a Unix
199 system. By default, the value returned by
200 GetInstallPrefix() is used.
201 Although under Linux systems the program prefix may usually be determined
202 automatically, portable programs should call this function. Usually the prefix
203 is set during program configuration if using GNU autotools and so it is enough
204 to pass its value defined in @c config.h to this function.
205 */
206 void SetInstallPrefix(const wxString& prefix);
207
208 /**
209 Controls what application information is used when constructing paths that
210 should be unique to this program, such as the application data directory, the
211 plugins directory on Unix, etc.
212 Valid values for @a info are @c AppInfo_None and either one or
213 combination of @c AppInfo_AppName and @c AppInfo_VendorName. The
214 first one tells this class to not use neither application nor vendor name in
215 the paths.
216 By default, only the application name is used under Unix systems but both
217 application and vendor names are used under Windows and Mac.
218 */
219 void UseAppInfo(int info);
220 };
221