filelist.h
Go to the documentation of this file.
1 /*--------------------------------------------------------------------------------------+
2 |
3 | Supplied under applicable software license agreement.
4 |
5 | Copyright (c) 2018 Bentley Systems, Incorporated. All rights reserved.
6 |
7 +---------------------------------------------------------------------------------------*/
8 #pragma once
9 
10 # include "dlogitem.h"
11 # include "rscdefs.r.h"
12 
13 # include <RmgrTools\Tools\msstrlst.h> // for StringListP
14 
15 // @addtogroup FileLists
16 // @beginGroup
17 
18 /*----------------------------------------------------------------------+
19 | |
20 | Indexes into the file type icon lists |
21 | |
22 +----------------------------------------------------------------------*/
23 #define FILETYPELIST_INDEX_MICROSTION_SMALL 0
24 #define FILETYPELIST_INDEX_MICROSTION_MEDIUM 1
25 #define FILETYPELIST_INDEX_MICROSTION_LARGE 2
26 #define FILETYPELIST_INDEX_MICROSTION_V7_SMALL 3
27 #define FILETYPELIST_INDEX_MICROSTION_V7_MEDIUM 4
28 #define FILETYPELIST_INDEX_MICROSTION_V7_LARGE 5
29 #define FILETYPELIST_INDEX_MICROSTION_DWG_SMALL 6 // includes DXF
30 #define FILETYPELIST_INDEX_MICROSTION_DWG_MEDIUM 7 // includes DXF
31 #define FILETYPELIST_INDEX_MICROSTION_DWG_LARGE 8 // includes DXF
32 #define FILETYPELIST_INDEX_MICROSTION_UNKNOWN_SMALL 9
33 #define FILETYPELIST_INDEX_MICROSTION_UNKNOWN_MEDIUM 10
34 #define FILETYPELIST_INDEX_MICROSTION_UNKNOWN_LARGE 11
35 #define FILETYPELIST_INDEX_MICROSTION_PROTECTED_SMALL 12
36 #define FILETYPELIST_INDEX_MICROSTION_PROTECTED_MEDIUM 13
37 #define FILETYPELIST_INDEX_MICROSTION_PROTECTED_LARGE 14
38 #define FILETYPELIST_INDEX_MICROSTION_SIGNED_SMALL 15
39 #define FILETYPELIST_INDEX_MICROSTION_SIGNED_MEDIUM 16
40 #define FILETYPELIST_INDEX_MICROSTION_SIGNED_LARGE 17
41 #define FILETYPELIST_INDEX_MICROSTION_2D_SMALL 18 // MicroStation design files only
42 #define FILETYPELIST_INDEX_MICROSTION_2D_MEDIUM 19 // MicroStation design files only
43 #define FILETYPELIST_INDEX_MICROSTION_2D_LARGE 20 // MicroStation design files only
44 
45 /*----------------------------------------------------------------------+
46 | |
47 | File List Magic Constant |
48 | |
49 +----------------------------------------------------------------------*/
50 #define FILELIST_VOLUMEMAGIC 0x00535653
51 
52 /*----------------------------------------------------------------------+
53 | |
54 | File User Message Constants |
55 | |
56 +----------------------------------------------------------------------*/
57 #define FILELISTTYPE_UPDATE 1
58 #define FILELISTTYPE_SETFILENAME 2
59 #define FILELISTTYPE_SETFILTER 3
60 #define FILELISTTYPE_CLEARFILENAME 4
61 #define FILELISTTYPE_SETDIRECTORY 5
62 
63 #define FILELISTDATA_DRIVES 1
64 #define FILELISTDATA_DIRECTORIES 2
65 #define FILELISTDATA_FILES 3
66 
67 /*----------------------------------------------------------------------+
68 | |
69 | File List Attributes Constants |
70 | |
71 +----------------------------------------------------------------------*/
72 #define FILELISTATTR_SORT 0x00000001
73 #define FILELISTATTR_UNIQUE 0x00000002
74 #define FILELISTATTR_CASESENSITIVE 0x00000004
75 #define FILELISTATTR_MULTIPLE 0x00000008
76 #define FILELISTATTR_CANSELECTEXISTING 0x00000010
77 #define FILELISTATTR_CANSELECTNEW 0x00000020
78 
79 #define FILELISTATTR_DRIVES 0x00000040
80 #define FILELISTATTR_DIRECTORIES 0x00000080
81 #define FILELISTATTR_FILES 0x00000100
82 
83 /*----------------------------------------------------------------------+
84 | |
85 | FILELISTATTR_REPLACEDIRDOTS will return the names of the current and |
86 | parent directories. It will also replace ".." and "." with the |
87 | actual directory names. Note that this is only valid in |
88 | combination with FILELISTATTR_DIRECTORIES |
89 | |
90 +----------------------------------------------------------------------*/
91 #define FILELISTATTR_REPLACEDIRDOTS 0x00000200
92 
93 /*----------------------------------------------------------------------+
94 | |
95 | If FILELISTATTR_DRIVES is set FILELISTATTR_NODRIVEBRACKETS will |
96 | return a drive list (on DOS & NT) without the enclosing "[]". |
97 | |
98 +----------------------------------------------------------------------*/
99 #define FILELISTATTR_NODRIVEBRACKETS 0x00000400
100 
101 /*----------------------------------------------------------------------+
102 | |
103 | If FILELISTATTR_DIRECTORIES is set FILELISTATTR_NOPARENTDIR |
104 | will keep parent directory out of list. |
105 | |
106 +----------------------------------------------------------------------*/
107 #define FILELISTATTR_NOPARENTDIR 0x00000800
108 
109 /*----------------------------------------------------------------------+
110 | |
111 | If you are doing a create and the file to be created already exists, |
112 | specifying the following attribute will put up an alert asking you |
113 | to confirm that choice. Choosing OK will overwrite the existing file, |
114 | Cancel will allow you to choose another file to create. |
115 | Ignored for FILELISTATTR_MULTIPLE. |
116 | |
117 +----------------------------------------------------------------------*/
118 #define FILELISTATTR_ALERTONCREATEEXIST 0x00001000
119 
120 /*----------------------------------------------------------------------+
121 | |
122 | Part of FILELISTATTR_CREATEFROMSEED. |
123 | |
124 +----------------------------------------------------------------------*/
125 #define FILELISTATTR_SEEDFILESPECIFIED 0x00002000
126 
127 /*----------------------------------------------------------------------+
128 | |
129 | If this is set, put volumes before desktop directories in the list |
130 | (this is Mac-only feature) |
131 | |
132 +----------------------------------------------------------------------*/
133 #define FILELISTATTR_SORTVOLUMESFIRST 0x00004000
134 
135 /*----------------------------------------------------------------------+
136 | |
137 | If this is set in conjunction with FILELISTATRR_DIRECTORIES, |
138 | include a check box that says to include subdirectories |
139 | |
140 +----------------------------------------------------------------------*/
141 #define FILELISTATTR_SUBDIRSCHECKBOX 0x00008000
142 
143 /*----------------------------------------------------------------------+
144 | |
145 | If this is set then allow only normal V8 files, i.e., exlude |
146 | non-V8 files and V8 files that are workfiles or shared files. |
147 | |
148 +----------------------------------------------------------------------*/
149 #define FILELISTATTR_NORMALV8FILES 0x00010000
150 
151 /*----------------------------------------------------------------------+
152 | |
153 | If this is set then allow only shared V8 files |
154 | |
155 +----------------------------------------------------------------------*/
156 #define FILELISTATTR_SHAREDV8FILES 0x00010000
157 
158 /*----------------------------------------------------------------------+
159 | |
160 | If this is set then never use Winopen |
161 | |
162 +----------------------------------------------------------------------*/
163 #define FILELISTATTR_DONTUSEWINOPEN 0x00020000
164 
165 /*----------------------------------------------------------------------+
166 | |
167 | If this is set then do not override the initial directory from |
168 | defFileId.
169 | |
170 +----------------------------------------------------------------------*/
171 #define FILELISTATTR_DONTDEFAULTTODEFFILE 0x00040000
172 
173 /*----------------------------------------------------------------------+
174 | |
175 | If this is set then always use Winopen |
176 | |
177 +----------------------------------------------------------------------*/
178 #define FILELISTATTR_ALWAYSUSEWINOPEN 0x00080000
179 
180 
181 /*----------------------------------------------------------------------+
182 | |
183 | Common attribute sets |
184 | |
185 +----------------------------------------------------------------------*/
186 #define FILELISTATTR_OPEN FILELISTATTR_CANSELECTEXISTING
187 
188 #define FILELISTATTR_CREATE (FILELISTATTR_CANSELECTNEW | \
189  FILELISTATTR_ALERTONCREATEEXIST)
190 
191 #define FILELISTATTR_CREATEFROMSEED (FILELISTATTR_CREATE | \
192  FILELISTATTR_SEEDFILESPECIFIED)
193 
194 #define FILELISTATTR_OPENCREATE (FILELISTATTR_CANSELECTEXISTING | \
195  FILELISTATTR_CANSELECTNEW | \
196  FILELISTATTR_ALERTONCREATEEXIST)
197 
198 #define FILELISTATTR_DEFAULT (FILELISTATTR_SORT | \
199  FILELISTATTR_UNIQUE | \
200  FILELISTATTR_MULTIPLE | \
201  FILELISTATTR_OPEN | \
202  FILELISTATTR_FILES)
203 
205  {
209  } ;
210 
211 /*----------------------------------------------------------------------+
212 | |
213 | Possible attributes for mdlDialog_fileOpenExt |
214 | |
215 +----------------------------------------------------------------------*/
216 #define FILEOPENEXTATTR_CENTERONSCREEN 0x00000001
217 #define FILEOPENEXTATTR_DONTDEFAULTTODEFFILE 0x00000002
218 
219 /*----------------------------------------------------------------------+
220 | |
221 | Structure used with mdlDialog_fileOpenExt |
222 | |
223 +----------------------------------------------------------------------*/
224 /*---------------------------------------------------------------------------------**/
231  {
235 
240 
253 
258 
264 
270 
271 
277 
281 
284 
294 
300 
303 
311 
314 
317 
320 
333 
339 
343 
345  struct
346  {
350  } filterFlags;
351  int winOpenReturnCode; // if winopen is used, the return code from it.
353 
356 
359 
362  };
363 
364 /*----------------------------------------------------------------------+
365 | |
366 | Structure returned by mdlDialog_fileOpenExt |
367 | |
368 +----------------------------------------------------------------------*/
370  {
371  WChar dirCfgVar[MAXNAMELENGTH]; /* name of cfg var used to select dir */
372  WChar seedFileName[MAXFILELENGTH]; /* seed file used to create new file */
373  };
374 
375 /*----------------------------------------------------------------------+
376 | |
377 | Structure used with mdlFileList_edit |
378 | |
379 +----------------------------------------------------------------------*/
381  {
390  };
RscId defSeedFileId
see defSeedFileNameP
Definition: filelist.h:319
UInt32 preIncludeCADFileOpenFilters
Definition: filelist.h:347
WChar dialogTitle[2 *MAXFILELENGTH]
Definition: filelist.h:382
wchar_t * WCharP
Definition: Bentley.h:225
UInt32 RscFileHandle
Definition: DgnPlatform/LineStyle.h:12
wchar_t WChar
Definition: Bentley.h:223
FileOpenParams * fileOpenParamsP
Definition: filelist.h:389
int lastAction
Definition: filelist.h:206
Definition: DgnPlatform.h:608
WChar lastDirectory[MAXFILELENGTH]
Definition: filelist.h:207
struct FileOpenParams::@221 filterFlags
unused; should be set to zero
wchar_t const * WCharCP
Definition: Bentley.h:224
WCharCP workSetNameP
WorkSet for which file and Directory history should be shown.
Definition: filelist.h:358
WCharP defSeedFileNameP
defSeedFileNameP, defSeedDirP, defSeedFilterP and defSeedFileId are identical to suggestedFileNameP, defaultDirP, defaultFilterP and defFileId except that these are used for the seed file Dialog Box.
Definition: filelist.h:310
WCharCP defaultDirP
The directory where the selection process starts.
Definition: filelist.h:276
int winOpenReturnCode
Definition: filelist.h:351
uint32_t UInt32
Definition: Bentley.r.h:128
WCharCP suggestedFileNameP
File name that will be suggested to the user when the Dialog Box is first opened. ...
Definition: filelist.h:257
RscFileHandle defFileRscH
User preference resource file opened by the calling application.
Definition: filelist.h:299
UInt32 postIncludeCADFileOpenFilters
Definition: filelist.h:348
RscId filterStringListId
Id of String list containing file filters and descriptions.
Definition: filelist.h:341
WChar defaultDir[2 *MAXFILELENGTH]
Definition: filelist.h:385
WCharCP defaultFilterP
The filter to use for determining which files to include in the file list.
Definition: filelist.h:263
WChar dirCfgVar[MAXNAMELENGTH]
Definition: filelist.h:371
UInt32 unused
Definition: filelist.h:349
Definition: DgnPlatform.h:612
WChar seedFileName[MAXFILELENGTH]
Definition: filelist.h:372
struct DgnPlatform::DgnFileSupplyRights * DgnFileSupplyRightsP
Definition: DgnPlatform.h:208
Definition: filelist.h:380
DgnFileSupplyRightsP reloadContext
mdlDialog_fileOpenExt will set this to a load context that can be used for future access to the file ...
Definition: filelist.h:338
RscId defFileId
Identifies a resource in the user preference file specified by defFileRscH.
Definition: filelist.h:293
Definition: filelist.h:369
long attributes
Definition: filelist.h:386
Structure used by mdlDialog_fileOpenExt.
Definition: filelist.h:230
UInt32 requiredRights
Specifies the rights that the user must have to allow the application to process the file...
Definition: filelist.h:332
WCharCP filterInfoStrP
String which describes defaultFilterP, specify NULL for the default description.
Definition: filelist.h:269
WCharCP titleP
The title of the Dialog Box.
Definition: filelist.h:283
WCharCP futureUseCharP[4]
unused; should be set to zero
Definition: filelist.h:355
RscId dialogId
ID of a Dialog Box in the resource file specified by dialogRscH.
Definition: filelist.h:239
WChar listLabel[2 *MAXFILELENGTH]
Definition: filelist.h:383
RscFileHandle dialogRscH
Resource file from which to load a user-specified Dialog Box.
Definition: filelist.h:234
RscId dialogId
Definition: filelist.h:388
WCharCP dirCfgVarP
The name of a MicroStation configuration variable which is used to populate the contents of the "Dire...
Definition: filelist.h:280
WCharCP workSpaceNameP
WorkSpace for which file and Directory history should be shown.
Definition: filelist.h:361
RscFileHandle filterStringHandle
Definition: filelist.h:342
WCharCP defSeedFilterP
see defSeedFileNameP
Definition: filelist.h:316
StringListP strListP
Definition: filelist.h:387
int openCreate
Controls the attributes of the Dialog Box.
Definition: filelist.h:252
struct mdlDesc MdlDesc
Definition: DgnTool.h:18
int32_t RscId
Definition: ecimagekey.h:16
Definition: filelist.h:204
int futureUse
Definition: filelist.h:352
WChar defaultFilter[2 *MAXFILELENGTH]
Definition: filelist.h:384
MdlDesc * dialogOwnerMD
Unused, pass NULL.
Definition: filelist.h:302
WCharCP defSeedDirP
see defSeedFileNameP
Definition: filelist.h:313
WChar lastFilter[MAXEXTENSIONLENGTH]
Definition: filelist.h:208
Definition: DgnPlatform.h:611
struct Bentley::StringList * StringListP
Definition: msstrlst.h:13

Copyright © 2017 Bentley Systems, Incorporated. All rights reserved.