]>
Commit | Line | Data |
---|---|---|
1 | /////////////////////////////////////////////////////////////////////////////// | |
2 | // Name: wx/msw/stdpaths.h | |
3 | // Purpose: wxStandardPaths for Win32 | |
4 | // Author: Vadim Zeitlin | |
5 | // Modified by: | |
6 | // Created: 2004-10-19 | |
7 | // Copyright: (c) 2004 Vadim Zeitlin <vadim@wxwindows.org> | |
8 | // Licence: wxWindows licence | |
9 | /////////////////////////////////////////////////////////////////////////////// | |
10 | ||
11 | #ifndef _WX_MSW_STDPATHS_H_ | |
12 | #define _WX_MSW_STDPATHS_H_ | |
13 | ||
14 | // ---------------------------------------------------------------------------- | |
15 | // wxStandardPaths | |
16 | // ---------------------------------------------------------------------------- | |
17 | ||
18 | class WXDLLIMPEXP_BASE wxStandardPaths : public wxStandardPathsBase | |
19 | { | |
20 | public: | |
21 | // implement base class pure virtuals | |
22 | virtual wxString GetExecutablePath() const; | |
23 | virtual wxString GetConfigDir() const; | |
24 | virtual wxString GetUserConfigDir() const; | |
25 | virtual wxString GetDataDir() const; | |
26 | virtual wxString GetUserDataDir() const; | |
27 | virtual wxString GetUserLocalDataDir() const; | |
28 | virtual wxString GetPluginsDir() const; | |
29 | virtual wxString GetDocumentsDir() const; | |
30 | ||
31 | ||
32 | // MSW-specific methods | |
33 | ||
34 | // This class supposes that data, plugins &c files are located under the | |
35 | // program directory which is the directory containing the application | |
36 | // binary itself. But sometimes this binary may be in a subdirectory of the | |
37 | // main program directory, e.g. this happens in at least the following | |
38 | // common cases: | |
39 | // 1. The program is in "bin" subdirectory of the installation directory. | |
40 | // 2. The program is in "debug" subdirectory of the directory containing | |
41 | // sources and data files during development | |
42 | // | |
43 | // By calling this function you instruct the class to remove the last | |
44 | // component of the path if it matches its argument. Notice that it may be | |
45 | // called more than once, e.g. you can call both IgnoreAppSubDir("bin") and | |
46 | // IgnoreAppSubDir("debug") to take care of both production and development | |
47 | // cases above but that each call will only remove the last path component. | |
48 | // Finally note that the argument can contain wild cards so you can also | |
49 | // call IgnoreAppSubDir("vc*msw*") to ignore all build directories at once | |
50 | // when using wxWidgets-inspired output directories names. | |
51 | void IgnoreAppSubDir(const wxString& subdirPattern); | |
52 | ||
53 | // This function is used to ignore all common build directories and is | |
54 | // called from the ctor -- use DontIgnoreAppSubDir() to undo this. | |
55 | void IgnoreAppBuildSubDirs(); | |
56 | ||
57 | // Undo the effects of all preceding IgnoreAppSubDir() calls. | |
58 | void DontIgnoreAppSubDir(); | |
59 | ||
60 | ||
61 | // Returns the directory corresponding to the specified Windows shell CSIDL | |
62 | static wxString MSWGetShellDir(int csidl); | |
63 | ||
64 | protected: | |
65 | // Ctor is protected, use wxStandardPaths::Get() instead of instantiating | |
66 | // objects of this class directly. | |
67 | // | |
68 | // It calls IgnoreAppBuildSubDirs() and also sets up the object to use | |
69 | // both vendor and application name by default. | |
70 | wxStandardPaths(); | |
71 | ||
72 | // get the path corresponding to the given standard CSIDL_XXX constant | |
73 | static wxString DoGetDirectory(int csidl); | |
74 | ||
75 | // return the directory of the application itself | |
76 | wxString GetAppDir() const; | |
77 | ||
78 | // directory returned by GetAppDir() | |
79 | mutable wxString m_appDir; | |
80 | }; | |
81 | ||
82 | // ---------------------------------------------------------------------------- | |
83 | // wxStandardPathsWin16: this class is for internal use only | |
84 | // ---------------------------------------------------------------------------- | |
85 | ||
86 | // override config file locations to be compatible with the values used by | |
87 | // wxFileConfig (dating from Win16 days which explains the class name) | |
88 | class WXDLLIMPEXP_BASE wxStandardPathsWin16 : public wxStandardPaths | |
89 | { | |
90 | public: | |
91 | virtual wxString GetConfigDir() const; | |
92 | virtual wxString GetUserConfigDir() const; | |
93 | }; | |
94 | ||
95 | #endif // _WX_MSW_STDPATHS_H_ |