1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
---|
2 | /* ***** BEGIN LICENSE BLOCK *****
|
---|
3 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
---|
4 | *
|
---|
5 | * The contents of this file are subject to the Mozilla Public License Version
|
---|
6 | * 1.1 (the "License"); you may not use this file except in compliance with
|
---|
7 | * the License. You may obtain a copy of the License at
|
---|
8 | * http://www.mozilla.org/MPL/
|
---|
9 | *
|
---|
10 | * Software distributed under the License is distributed on an "AS IS" basis,
|
---|
11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
---|
12 | * for the specific language governing rights and limitations under the
|
---|
13 | * License.
|
---|
14 | *
|
---|
15 | * The Original Code is Mozilla Communicator client code, released
|
---|
16 | * March 31, 1998.
|
---|
17 | *
|
---|
18 | * The Initial Developer of the Original Code is
|
---|
19 | * Netscape Communications Corporation.
|
---|
20 | * Portions created by the Initial Developer are Copyright (C) 1998
|
---|
21 | * the Initial Developer. All Rights Reserved.
|
---|
22 | *
|
---|
23 | * Contributor(s):
|
---|
24 | * Doug Turner <dougt@netscape.com>
|
---|
25 | * IBM Corp.
|
---|
26 | *
|
---|
27 | * Alternatively, the contents of this file may be used under the terms of
|
---|
28 | * either of the GNU General Public License Version 2 or later (the "GPL"),
|
---|
29 | * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
---|
30 | * in which case the provisions of the GPL or the LGPL are applicable instead
|
---|
31 | * of those above. If you wish to allow use of your version of this file only
|
---|
32 | * under the terms of either the GPL or the LGPL, and not to allow others to
|
---|
33 | * use your version of this file under the terms of the MPL, indicate your
|
---|
34 | * decision by deleting the provisions above and replace them with the notice
|
---|
35 | * and other provisions required by the GPL or the LGPL. If you do not delete
|
---|
36 | * the provisions above, a recipient may use your version of this file under
|
---|
37 | * the terms of any one of the MPL, the GPL or the LGPL.
|
---|
38 | *
|
---|
39 | * ***** END LICENSE BLOCK ***** */
|
---|
40 |
|
---|
41 | #ifndef _NSSPECIALSYSTEMDIRECTORY_H_
|
---|
42 | #define _NSSPECIALSYSTEMDIRECTORY_H_
|
---|
43 |
|
---|
44 | #include "xpcomobsolete.h"
|
---|
45 | #include "nsFileSpec.h"
|
---|
46 |
|
---|
47 | #if defined(XP_MAC) || defined(XP_MACOSX)
|
---|
48 | #include <Types.h>
|
---|
49 | #endif
|
---|
50 |
|
---|
51 |
|
---|
52 | extern NS_COM_OBSOLETE void StartupSpecialSystemDirectory();
|
---|
53 | extern NS_COM_OBSOLETE void ShutdownSpecialSystemDirectory();
|
---|
54 |
|
---|
55 |
|
---|
56 | // SEE ALSO:
|
---|
57 | // mozilla/xpfe/appshell/public/nsFileLocations.h
|
---|
58 |
|
---|
59 | class NS_COM_OBSOLETE nsSpecialSystemDirectory : public nsFileSpec
|
---|
60 | {
|
---|
61 |
|
---|
62 | public:
|
---|
63 | enum SystemDirectories
|
---|
64 | {
|
---|
65 | OS_DriveDirectory = 1
|
---|
66 | , OS_TemporaryDirectory = 2
|
---|
67 | , OS_CurrentProcessDirectory= 3
|
---|
68 | , OS_CurrentWorkingDirectory= 4
|
---|
69 |
|
---|
70 | , XPCOM_CurrentProcessComponentDirectory= 5
|
---|
71 | , XPCOM_CurrentProcessComponentRegistry= 6
|
---|
72 |
|
---|
73 | , Moz_BinDirectory = 10
|
---|
74 |
|
---|
75 | , Mac_SystemDirectory = 101
|
---|
76 | , Mac_DesktopDirectory = 102
|
---|
77 | , Mac_TrashDirectory = 103
|
---|
78 | , Mac_StartupDirectory = 104
|
---|
79 | , Mac_ShutdownDirectory = 105
|
---|
80 | , Mac_AppleMenuDirectory = 106
|
---|
81 | , Mac_ControlPanelDirectory = 107
|
---|
82 | , Mac_ExtensionDirectory = 108
|
---|
83 | , Mac_FontsDirectory = 109
|
---|
84 | , Mac_ClassicPreferencesDirectory = 110
|
---|
85 | , Mac_DocumentsDirectory = 111
|
---|
86 | , Mac_InternetSearchDirectory = 112
|
---|
87 | , Mac_DefaultDownloadDirectory = 113
|
---|
88 | , Mac_UserLibDirectory = 114
|
---|
89 | , Mac_PreferencesDirectory = 115
|
---|
90 |
|
---|
91 | , Win_SystemDirectory = 201
|
---|
92 | , Win_WindowsDirectory = 202
|
---|
93 |
|
---|
94 | , Win_HomeDirectory = 203
|
---|
95 | , Win_Desktop = 204
|
---|
96 | , Win_Programs = 205
|
---|
97 | , Win_Controls = 206
|
---|
98 | , Win_Printers = 207
|
---|
99 | , Win_Personal = 208
|
---|
100 | , Win_Favorites = 209
|
---|
101 | , Win_Startup = 210
|
---|
102 | , Win_Recent = 211
|
---|
103 | , Win_Sendto = 212
|
---|
104 | , Win_Bitbucket = 213
|
---|
105 | , Win_Startmenu = 214
|
---|
106 | , Win_Desktopdirectory = 215
|
---|
107 | , Win_Drives = 216
|
---|
108 | , Win_Network = 217
|
---|
109 | , Win_Nethood = 218
|
---|
110 | , Win_Fonts = 219
|
---|
111 | , Win_Templates = 220
|
---|
112 | , Win_Common_Startmenu = 221
|
---|
113 | , Win_Common_Programs = 222
|
---|
114 | , Win_Common_Startup = 223
|
---|
115 | , Win_Common_Desktopdirectory = 224
|
---|
116 | , Win_Appdata = 225
|
---|
117 | , Win_Printhood = 226
|
---|
118 | , Win_Cookies = 227
|
---|
119 |
|
---|
120 | , Unix_LocalDirectory = 301
|
---|
121 | , Unix_LibDirectory = 302
|
---|
122 | , Unix_HomeDirectory = 303
|
---|
123 |
|
---|
124 | , BeOS_SettingsDirectory = 401
|
---|
125 | , BeOS_HomeDirectory = 402
|
---|
126 | , BeOS_DesktopDirectory = 403
|
---|
127 | , BeOS_SystemDirectory = 404
|
---|
128 |
|
---|
129 | , OS2_SystemDirectory = 501
|
---|
130 | , OS2_OS2Directory = 502
|
---|
131 | , OS2_DesktopDirectory = 503
|
---|
132 | , OS2_HomeDirectory = 504
|
---|
133 | };
|
---|
134 |
|
---|
135 | //nsSpecialSystemDirectory();
|
---|
136 | nsSpecialSystemDirectory(SystemDirectories aSystemSystemDirectory);
|
---|
137 |
|
---|
138 | virtual ~nsSpecialSystemDirectory();
|
---|
139 |
|
---|
140 | void operator = (SystemDirectories aSystemSystemDirectory);
|
---|
141 |
|
---|
142 | #if defined(XP_MAC) || defined(XP_MACOSX)
|
---|
143 | void operator = (OSType folderType);
|
---|
144 | nsSpecialSystemDirectory(OSType folderType);
|
---|
145 | enum {
|
---|
146 | kDefaultDownloadFolderType = FOUR_CHAR_CODE('DfDÄ') /* Default Download Folder */
|
---|
147 | };
|
---|
148 | #endif
|
---|
149 |
|
---|
150 | /**
|
---|
151 |
|
---|
152 | * @param: dirToSet, the value to set for this safeLocation
|
---|
153 |
|
---|
154 | * @param: dirSpec, the directory specified as a filespec
|
---|
155 |
|
---|
156 | */
|
---|
157 |
|
---|
158 | static void Set(SystemDirectories dirToSet, nsFileSpec *dirSpec);
|
---|
159 |
|
---|
160 |
|
---|
161 | private:
|
---|
162 | void operator = (const char* inPath) { *(nsFileSpec*)this = inPath; }
|
---|
163 |
|
---|
164 | }; // class NS_COM_OBSOLETE nsSpecialSystemDirectory
|
---|
165 |
|
---|
166 |
|
---|
167 | #endif
|
---|