source: trunk/include/helpers/prfh.h@ 224

Last change on this file since 224 was 216, checked in by umoeller, 23 years ago

Misc changes

  • Property svn:eol-style set to CRLF
  • Property svn:keywords set to Author Date Id Revision
File size: 10.5 KB
Line 
1
2/*
3 *@@sourcefile prfh.h:
4 * header file for prfh.c. See remarks there.
5 *
6 * This file is new with V0.82.
7 *
8 * Note: Version numbering in this file relates to XWorkplace version
9 * numbering.
10 *
11 *@@include #define INCL_WINWINDOWMGR
12 *@@include #define INCL_WINSHELLDATA
13 *@@include #include <os2.h>
14 *@@include #include <stdio.h>
15 *@@include #include "helpers\prfh.h"
16 */
17
18/* Copyright (C) 1997-2000 Ulrich M”ller.
19 * This file is part of the "XWorkplace helpers" source package.
20 * This is free software; you can redistribute it and/or modify
21 * it under the terms of the GNU General Public License as published
22 * by the Free Software Foundation, in version 2 as it comes in the
23 * "COPYING" file of the XWorkplace main distribution.
24 * This program is distributed in the hope that it will be useful,
25 * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 * GNU General Public License for more details.
28 */
29
30#if __cplusplus
31extern "C" {
32#endif
33
34#ifndef PRFH_HEADER_INCLUDED
35 #define PRFH_HEADER_INCLUDED
36
37 /* ******************************************************************
38 *
39 * Errors
40 *
41 ********************************************************************/
42
43 #define ERROR_PRF_FIRST 42000
44
45 #define PRFERR_DATASIZE (ERROR_PRF_FIRST + 1)
46 // couldn't query data size for key
47 #define PRFERR_READ (ERROR_PRF_FIRST + 2)
48 // couldn't read data from source (PrfQueryProfileData error)
49 #define PRFERR_WRITE (ERROR_PRF_FIRST + 3)
50 // couldn't write data to target (PrfWriteProfileData error)
51 #define PRFERR_APPSLIST (ERROR_PRF_FIRST + 4)
52 // couldn't query apps list
53 #define PRFERR_KEYSLIST (ERROR_PRF_FIRST + 5)
54 // couldn't query keys list
55 #define PRFERR_ABORTED (ERROR_PRF_FIRST + 6)
56 // aborted by user
57 #define PRFERR_QUERY (ERROR_PRF_FIRST + 7)
58 // PrfQueryProfile failed
59 #define PRFERR_INVALID_FILE_NAME (ERROR_PRF_FIRST + 8)
60 // profile names don't contain .INI
61 #define PRFERR_INVALID_KEY (ERROR_PRF_FIRST + 9)
62 #define PRFERR_KEY_EXISTS (ERROR_PRF_FIRST + 10)
63
64 #define PRFERR_RESET (ERROR_PRF_FIRST + 11)
65 // PrfReset failed V0.9.19 (2002-04-02) [umoeller]
66
67 #define ERROR_PRF_LAST (ERROR_PRF_FIRST + 11)
68
69 /* ******************************************************************
70 *
71 * Strings
72 *
73 ********************************************************************/
74
75 // DECLARE_PRFH_STRING is a handy macro which saves us from
76 // keeping two string lists in both the .h and the .c file.
77 // If this include file is included from the .c file, the
78 // string is defined as a global variable. Otherwise
79 // it is only declared as "extern" so other files can
80 // see it.
81
82 #ifdef INCLUDE_PRFH_PRIVATE
83 #define DECLARE_PRFH_STRING(str, def) const char *str = def
84 #else
85 #define DECLARE_PRFH_STRING(str, def) extern const char *str;
86 #endif
87
88 /*
89 * OS2.INI applications
90 *
91 */
92
93 // NLS settings section
94 DECLARE_PRFH_STRING(PMINIAPP_NATIONAL, "PM_National");
95
96 // system font settings section
97 DECLARE_PRFH_STRING(PMINIAPP_SYSTEMFONTS, "PM_SystemFonts");
98 DECLARE_PRFH_STRING(PMINIKEY_DEFAULTFONT, "DefaultFont");
99 DECLARE_PRFH_STRING(PMINIKEY_ICONTEXTFONT, "IconText");
100 DECLARE_PRFH_STRING(PMINIKEY_MENUSFONT, "Menus");
101
102 // installed fonts section
103 DECLARE_PRFH_STRING(PMINIAPP_FONTS, "PM_Fonts");
104
105 // general WPS settings
106 DECLARE_PRFH_STRING(WPINIAPP_WORKPLACE, "PM_Workplace");
107 DECLARE_PRFH_STRING(WPINIKEY_MENUBAR, "FolderMenuBar");
108
109 DECLARE_PRFH_STRING(WPINIKEY_SHORTMENUS, "FolderMenus");
110 // V0.9.19 (2002-04-17) [umoeller]
111
112 // class replacements list V0.9.21 (2002-08-26) [umoeller]
113 DECLARE_PRFH_STRING(WPINIAPP_REPLACEMENTS, "PM_Workplace:ReplaceList");
114
115 // abstract objects per folder handle
116 DECLARE_PRFH_STRING(WPINIAPP_FDRCONTENT, "PM_Abstract:FldrContent");
117 // all defined abstract objects on the system
118 DECLARE_PRFH_STRING(WPINIAPP_OBJECTS, "PM_Abstract:Objects");
119 // their icons, if set individually
120 DECLARE_PRFH_STRING(WPINIAPP_ICONS, "PM_Abstract:Icons");
121
122 // object ID's (<WP_DESKTOP> etc.)
123 DECLARE_PRFH_STRING(WPINIAPP_LOCATION, "PM_Workplace:Location");
124
125 // folder positions
126 DECLARE_PRFH_STRING(WPINIAPP_FOLDERPOS, "PM_Workplace:FolderPos");
127
128 // palette positions
129 DECLARE_PRFH_STRING(WPINIAPP_PALETTEPOS, "PM_Workplace:PalettePos");
130 // ???
131 DECLARE_PRFH_STRING(WPINIAPP_STATUSPOS, "PM_Workplace:StatusPos");
132 // startup folders
133 DECLARE_PRFH_STRING(WPINIAPP_STARTUP, "PM_Workplace:Startup");
134 // all the defined templates on the system
135 DECLARE_PRFH_STRING(WPINIAPP_TEMPLATES, "PM_Workplace:Templates");
136
137 // all work area folders
138 DECLARE_PRFH_STRING(WPINIAPP_WORKAREARUNNING, "FolderWorkareaRunningObjects");
139 // spooler windows ?!?
140 DECLARE_PRFH_STRING(WPINIAPP_JOBCNRPOS, "PM_PrintObject:JobCnrPos");
141
142 // associations by type ("Plain Text")
143 DECLARE_PRFH_STRING(WPINIAPP_ASSOCTYPE, "PMWP_ASSOC_TYPE");
144 // associations by filter ("*.txt")
145 DECLARE_PRFH_STRING(WPINIAPP_ASSOCFILTER, "PMWP_ASSOC_FILTER");
146 // checksums ?!?
147 DECLARE_PRFH_STRING(WPINIAPP_ASSOC_CHECKSUM, "PMWP_ASSOC_CHECKSUM");
148
149 /*
150 * OS2SYS.INI applications
151 *
152 */
153
154 DECLARE_PRFH_STRING(WPINIAPP_ACTIVEHANDLES, "PM_Workplace:ActiveHandles");
155 DECLARE_PRFH_STRING(WPINIAPP_HANDLES, "PM_Workplace:Handles");
156 DECLARE_PRFH_STRING(WPINIAPP_HANDLESAPP, "HandlesAppName");
157
158 /*
159 * some default WPS INI keys:
160 *
161 */
162
163 DECLARE_PRFH_STRING(WPOBJID_DESKTOP, "<WP_DESKTOP>");
164
165 DECLARE_PRFH_STRING(WPOBJID_KEYB, "<WP_KEYB>");
166 DECLARE_PRFH_STRING(WPOBJID_MOUSE, "<WP_MOUSE>");
167 DECLARE_PRFH_STRING(WPOBJID_CNTRY, "<WP_CNTRY>");
168 DECLARE_PRFH_STRING(WPOBJID_SOUND, "<WP_SOUND>");
169 DECLARE_PRFH_STRING(WPOBJID_SYSTEM, "<WP_SYSTEM>"); // V0.9.9
170 DECLARE_PRFH_STRING(WPOBJID_POWER, "<WP_POWER>");
171 DECLARE_PRFH_STRING(WPOBJID_WINCFG, "<WP_WINCFG>");
172
173 DECLARE_PRFH_STRING(WPOBJID_HIRESCLRPAL, "<WP_HIRESCLRPAL>");
174 DECLARE_PRFH_STRING(WPOBJID_LORESCLRPAL, "<WP_LORESCLRPAL>");
175 DECLARE_PRFH_STRING(WPOBJID_FNTPAL, "<WP_FNTPAL>");
176 DECLARE_PRFH_STRING(WPOBJID_SCHPAL96, "<WP_SCHPAL96>");
177
178 DECLARE_PRFH_STRING(WPOBJID_LAUNCHPAD, "<WP_LAUNCHPAD>");
179 DECLARE_PRFH_STRING(WPOBJID_WARPCENTER, "<WP_WARPCENTER>");
180
181 DECLARE_PRFH_STRING(WPOBJID_SPOOL, "<WP_SPOOL>");
182 DECLARE_PRFH_STRING(WPOBJID_VIEWER, "<WP_VIEWER>");
183 DECLARE_PRFH_STRING(WPOBJID_SHRED, "<WP_SHRED>");
184 DECLARE_PRFH_STRING(WPOBJID_CLOCK, "<WP_CLOCK>");
185
186 DECLARE_PRFH_STRING(WPOBJID_START, "<WP_START>");
187 DECLARE_PRFH_STRING(WPOBJID_TEMPS, "<WP_TEMPS>");
188 DECLARE_PRFH_STRING(WPOBJID_DRIVES, "<WP_DRIVES>");
189
190 /* ******************************************************************
191 *
192 * Functions
193 *
194 ********************************************************************/
195
196 APIRET prfhQueryKeysForApp(HINI hIni,
197 const char *pcszApp,
198 PSZ *ppszKeys);
199
200 #ifdef __DEBUG_MALLOC_ENABLED__ // setup.h, helpers\memdebug.c
201 PSZ prfhQueryProfileDataDebug(HINI hIni,
202 const char *pcszApp,
203 const char *pcszKey,
204 PULONG pcbBuf,
205 const char *file,
206 unsigned long line,
207 const char *function);
208 #define prfhQueryProfileData(a, b, c, d) prfhQueryProfileDataDebug((a), (b), (c), (d), __FILE__, __LINE__, __FUNCTION__)
209 #else
210 PSZ prfhQueryProfileData(HINI hIni,
211 const char *pcszApp,
212 const char *pcszKey,
213 PULONG pcbBuf);
214 #endif
215
216 CHAR prfhQueryProfileChar(HINI hini,
217 const char *pcszApp,
218 const char *pcszKey,
219 CHAR cDefault);
220
221 LONG prfhQueryColor(const char *pcszKeyName, const char *pcszDefault);
222
223 APIRET prfhCopyKey(HINI hiniSource,
224 const char *pcszSourceApp,
225 const char *pcszKey,
226 HINI hiniTarget,
227 const char *pcszTargetApp);
228
229 APIRET prfhCopyApp(HINI hiniSource,
230 const char *pcszSourceApp,
231 HINI hiniTarget,
232 const char *pcszTargetApp,
233 PSZ pszErrorKey);
234
235 ULONG prfhRenameKey(HINI hini,
236 const char *pcszOldApp,
237 const char *pcszOldKey,
238 const char *pcszNewApp,
239 const char *pcszNewKey);
240
241 APIRET prfhSetUserProfile(HAB hab,
242 const char *pcszUserProfile);
243
244 ULONG prfhINIError(ULONG ulOptions,
245 FILE* fLog,
246 PFNWP fncbError,
247 PSZ pszErrorString);
248
249 ULONG prfhINIError2(ULONG ulOptions,
250 const char *pcszINI,
251 FILE* fLog,
252 PFNWP fncbError,
253 PSZ pszErrorString);
254
255 BOOL prfhCopyProfile(HAB hab,
256 FILE* fLog,
257 HINI hOld,
258 PSZ pszOld,
259 PSZ pszNew,
260 PFNWP fncbUpdate,
261 HWND hwnd, ULONG msg, ULONG ulCount, ULONG ulMax,
262 PFNWP fncbError);
263
264 APIRET prfhSaveINIs(HAB hab,
265 FILE* fLog,
266 PFNWP fncbUpdate,
267 HWND hwnd, ULONG msg,
268 PFNWP fncbError);
269
270#endif
271
272#if __cplusplus
273}
274#endif
275
Note: See TracBrowser for help on using the repository browser.