]> git.saurik.com Git - wxWidgets.git/blame - include/wx/stdpaths.h
wxLaunchDefaultBrowser() now supports wxBROWSER_NEW_WINDOW flag (and it actually...
[wxWidgets.git] / include / wx / stdpaths.h
CommitLineData
1ee445c7 1///////////////////////////////////////////////////////////////////////////////
96e2aec5
VZ
2// Name: wx/stdpaths.h
3// Purpose: declaration of wxStandardPaths class
1ee445c7
VZ
4// Author: Vadim Zeitlin
5// Modified by:
6// Created: 2004-10-17
7// RCS-ID: $Id$
8// Copyright: (c) 2004 Vadim Zeitlin <vadim@wxwindows.org>
9// Licence: wxWindows licence
10///////////////////////////////////////////////////////////////////////////////
11
0b75a1e0
VZ
12#ifndef _WX_STDPATHS_H_
13#define _WX_STDPATHS_H_
1ee445c7 14
07158944
VZ
15#include "wx/defs.h"
16
17#if wxUSE_STDPATHS
18
6cb5e50b
VZ
19#include "wx/string.h"
20
1ee445c7 21// ----------------------------------------------------------------------------
96e2aec5 22// wxStandardPaths returns the standard locations in the file system
1ee445c7
VZ
23// ----------------------------------------------------------------------------
24
6cb5e50b 25class WXDLLIMPEXP_BASE wxStandardPathsBase
1ee445c7
VZ
26{
27public:
6cb5e50b 28 // return the global standard paths object
fc480dc1 29 static wxStandardPathsBase& Get();
48713afd
VZ
30
31
1ee445c7 32 // return the directory with system config files:
6cb5e50b
VZ
33 // /etc under Unix, c:\Documents and Settings\All Users\Application Data
34 // under Windows, /Library/Preferences for Mac
35 virtual wxString GetConfigDir() const = 0;
1ee445c7
VZ
36
37 // return the directory for the user config files:
38 // $HOME under Unix, c:\Documents and Settings\username under Windows,
39 // ~/Library/Preferences under Mac
40 //
41 // only use this if you have a single file to put there, otherwise
42 // GetUserDataDir() is more appropriate
6cb5e50b 43 virtual wxString GetUserConfigDir() const = 0;
1ee445c7
VZ
44
45 // return the location of the applications global, i.e. not user-specific,
46 // data files
47 //
48713afd
VZ
48 // prefix/share/appname under Unix, c:\Program Files\appname under Windows,
49 // appname.app/Contents/SharedSupport app bundle directory under Mac
6cb5e50b 50 virtual wxString GetDataDir() const = 0;
1ee445c7
VZ
51
52 // return the location for application data files which are host-specific
53 //
54 // same as GetDataDir() except under Unix where it is /etc/appname
6cb5e50b 55 virtual wxString GetLocalDataDir() const;
1ee445c7
VZ
56
57 // return the directory for the user-dependent application data files
58 //
59 // $HOME/.appname under Unix,
60 // c:\Documents and Settings\username\Application Data\appname under Windows
48713afd 61 // and ~/Library/Application Support/appname under Mac
6cb5e50b 62 virtual wxString GetUserDataDir() const = 0;
1ee445c7
VZ
63
64 // return the directory for user data files which shouldn't be shared with
65 // the other machines
66 //
67 // same as GetUserDataDir() for all platforms except Windows where it is
68 // the "Local Settings\Application Data\appname" directory
6cb5e50b 69 virtual wxString GetUserLocalDataDir() const;
1ee445c7
VZ
70
71 // return the directory where the loadable modules (plugins) live
72 //
48713afd 73 // prefix/lib/appname under Unix, program directory under Windows and
1ee445c7 74 // Contents/Plugins app bundle subdirectory under Mac
6cb5e50b
VZ
75 virtual wxString GetPluginsDir() const = 0;
76
77
78 // virtual dtor for the base class
79 virtual ~wxStandardPathsBase();
ce336c6d
VZ
80
81protected:
82 // append "/appname" suffix if the app name is set (doesn't append the
83 // slash if dir already ends with a slash or dot)
84 static wxString AppendAppName(const wxString& dir);
1ee445c7
VZ
85};
86
6cb5e50b
VZ
87#if defined(__WXMSW__)
88 #include "wx/msw/stdpaths.h"
fc480dc1
DE
89// We want CoreFoundation paths on both CarbonLib and Darwin (for all ports)
90#elif defined(__WXMAC__) || defined(__DARWIN__)
726b98e9 91 #include "wx/mac/corefoundation/stdpaths.h"
175bb578
SN
92#elif defined(__OS2__)
93 #include "wx/os2/stdpaths.h"
6cb5e50b
VZ
94#elif defined(__UNIX__)
95 #include "wx/unix/stdpaths.h"
a809b45d
WS
96#elif defined(__PALMOS__)
97 #include "wx/palmos/stdpaths.h"
46a28273
MW
98#else
99
100// ----------------------------------------------------------------------------
d6f42b1b 101// Minimal generic implementation
46a28273
MW
102// ----------------------------------------------------------------------------
103
104class WXDLLIMPEXP_BASE wxStandardPaths : public wxStandardPathsBase
105{
106public:
107 void SetInstallPrefix(const wxString& prefix) { m_prefix = prefix; }
108 wxString GetInstallPrefix() const { return m_prefix; }
109 virtual wxString GetConfigDir() const { return m_prefix; }
110 virtual wxString GetUserConfigDir() const { return m_prefix; }
111 virtual wxString GetDataDir() const { return m_prefix; }
112 virtual wxString GetLocalDataDir() const { return m_prefix; }
113 virtual wxString GetUserDataDir() const { return m_prefix; }
114 virtual wxString GetPluginsDir() const { return m_prefix; }
115
116private:
117 wxString m_prefix;
118};
119
6cb5e50b
VZ
120#endif
121
07158944
VZ
122#endif // wxUSE_STDPATHS
123
0b75a1e0 124#endif // _WX_STDPATHS_H_
1ee445c7 125