00001 /** 00002 * \file mi32/rvcdbase.h 00003 * 00004 * \if NODOC 00005 * $Id: rvcdbase.h_v 1.317 2004/11/05 15:10:29 dwilliss Exp $ 00006 * 00007 * $Log: rvcdbase.h_v $ 00008 * Revision 1.317 2004/11/05 15:10:29 dwilliss 00009 * Deprecate dblist functions that don't take ELEMTYPE. 00010 * Deprecate the write dblist functions that take a "partial" list 00011 * 00012 * Revision 1.316 2004/11/04 23:52:26 scowan 00013 * Added fields to header. 00014 * 00015 * Revision 1.315 2004/10/06 16:05:35 mju 00016 * Define safield_multi. 00017 * 00018 * Revision 1.314 2004/09/22 20:26:15 dwilliss 00019 * Added new proto 00020 * 00021 * Revision 1.313 2004/04/29 19:33:00 scowan 00022 * Add join methops that take a elem type. 00023 * 00024 * Revision 1.312 2004/04/09 17:15:17 dwilliss 00025 * added elemtype parameter to new func 00026 * 00027 * Revision 1.311 2004/04/09 17:02:41 dwilliss 00028 * added new func proto 00029 * 00030 * Revision 1.310 2004/03/24 17:41:31 dwilliss 00031 * Added a SEARCH_StartsWith flag 00032 * 00033 * Revision 1.309 2004/03/12 14:54:14 mju 00034 * Remove unused legacy obj selection dialog inlines. 00035 * 00036 * Revision 1.308 2004/02/16 21:05:54 mju 00037 * Warn on deprecated usages. 00038 * 00039 * Revision 1.307 2004/01/23 16:50:32 scowan 00040 * Removed unused inlines. 00041 * 00042 * Revision 1.306 2003/10/31 23:24:40 mju 00043 * Use unique name for odbcUsernamePassword dialog so can assign to pointer. 00044 * 00045 * Revision 1.305 2003/10/31 22:47:32 mju 00046 * Fix typo. 00047 * 00048 * Revision 1.304 2003/10/31 22:27:26 mju 00049 * Put Modbc dialogs in X/MFC section, but don't deprecate them. 00050 * (Much better to surround EACH deprecated function with #if/#endif. 00051 * 00052 * Revision 1.303 2003/10/31 22:24:15 mju 00053 * Move Modbc prototypes out of deprecated section. 00054 * 00055 * Revision 1.302 2003/10/31 16:21:39 mju 00056 * Move Modbc prototypes here from xdefns. 00057 * 00058 * Revision 1.301 2003/10/16 20:15:50 scowan 00059 * Passed mi string instead of file pointer for log in validate. 00060 * 00061 * Revision 1.300 2003/10/15 17:39:07 mju 00062 * Deprecate groupkey. 00063 * 00064 * Revision 1.299 2003/10/14 21:40:24 dwilliss 00065 * Added prototype. Deprecated old function 00066 * 00067 * Revision 1.298 2003/10/09 14:13:44 dwilliss 00068 * New prototype 00069 * 00070 * Revision 1.297 2003/10/03 22:08:45 dwilliss 00071 * ? 00072 * 00073 * Revision 1.296 2003/09/18 19:14:58 dwilliss 00074 * Added prototype for a new form of MfReadDBList which takes a SIMPLE_ARRAY 00075 * of DBLISTELMT so you don't have to allocate it ahead of time. 00076 * 00077 * Revision 1.295 2003/09/15 13:49:56 fileserver!dwilliss 00078 * Doxygen 00079 * 00080 * Revision 1.294 2003/09/11 15:20:44 scowan 00081 * g++ being stupid. 00082 * 00083 * Revision 1.293 2003/09/10 21:04:25 scowan 00084 * Added more functions. 00085 * 00086 * Revision 1.292 2003/08/15 16:37:28 dwilliss 00087 * Changed MfDatabaseTableGetExernalList() to take an MISTRINGLIST that it 00088 * can return ODBC connection strings into 00089 * 00090 * Revision 1.291 2003/08/11 22:28:34 scowan 00091 * Removed mf copy database "P" do to non-use. 00092 * 00093 * Revision 1.290 2003/06/25 22:11:42 scowan 00094 * Added dbtype oracle. 00095 * 00096 * Revision 1.289 2003/06/25 21:40:10 dwilliss 00097 * never mind... 00098 * 00099 * Revision 1.288 2003/04/10 17:04:53 dwilliss 00100 * Strike previous revision. It's now a field flag that says the field has 00101 * a server-side index 00102 * 00103 * Revision 1.287 2003/04/10 16:48:03 dwilliss 00104 * Added DBCAP_ServerSideIndexes 00105 * 00106 * Revision 1.286 2003/03/13 16:42:44 dwilliss 00107 * Added a new DBCONV constant 00108 * 00109 * Revision 1.285 2003/02/17 18:06:33 dwilliss 00110 * Prototype for MfDatabaseValidate 00111 * 00112 * Revision 1.284 2003/01/06 18:58:07 mju 00113 * nc. 00114 * 00115 * Revision 1.283 2002/12/19 17:33:56 scowan 00116 * Added prototype. 00117 * 00118 * Revision 1.282 2002/12/16 18:11:40 scowan 00119 * *** empty log message *** 00120 * 00121 * Revision 1.281 2002/12/16 17:53:01 scowan 00122 * Added table cap types and changed field type name from image to binary. 00123 * Added exported functions. 00124 * 00125 * Revision 1.280 2002/12/03 17:04:39 scowan 00126 * Added new odbc function exports. 00127 * 00128 * Revision 1.279 2002/09/09 14:19:37 mju 00129 * Change rvcobjname to oldrvcobjname. 00130 * 00131 * Revision 1.278 2002/09/09 14:08:24 mju 00132 * "Remove" deprecated stuff. 00133 * 00134 * Revision 1.277 2002/09/04 19:15:30 scowan 00135 * More const. 00136 * 00137 * Revision 1.276 2002/09/04 17:42:04 dwilliss 00138 * *** empty log message *** 00139 * 00140 * Revision 1.275 2002/08/22 20:46:43 dwilliss 00141 * Never Mind... 00142 * 00143 * Revision 1.274 2002/08/22 17:12:21 scowan 00144 * More stuff. 00145 * 00146 * Revision 1.273 2002/08/22 15:23:18 scowan 00147 * nc. 00148 * 00149 * Revision 1.272 2002/08/21 22:58:00 dwilliss 00150 * never mind 00151 * 00152 * Revision 1.271 2002/08/21 20:38:39 scowan 00153 * Deprecate old object name define. 00154 * 00155 * Revision 1.270 2002/06/24 13:37:27 mju 00156 * Remove inline for dbfieldtostring too. 00157 * 00158 * Revision 1.269 2002/06/24 13:34:12 mju 00159 * Removed mfdbfieldtostring (except for dll build). 00160 * 00161 * Revision 1.268 2002/06/14 16:37:32 mju 00162 * Deprecate DBFieldToString() as does not deal with encoding. 00163 * 00164 * Revision 1.267 2002/06/14 14:48:46 mju 00165 * Remove unsupported DBFieldToMIString inline. 00166 * 00167 * Revision 1.266 2002/06/14 14:26:57 mju 00168 * Remove DBStringToField() fns as don't deal with table encoding. 00169 * 00170 * Revision 1.265 2002/06/04 16:01:34 scowan 00171 * Fixed deprecating field to mistring call. 00172 * 00173 * Revision 1.264 2002/06/04 15:52:07 dwilliss 00174 * Deprecate an evil function. 00175 * 00176 * Revision 1.263 2002/05/22 17:51:49 mju 00177 * Use const in StyleAssignTableMake. 00178 * 00179 * Revision 1.262 2002/05/10 20:43:10 dwilliss 00180 * Various changes for multiple field index lookups 00181 * 00182 * Revision 1.261 2002/05/09 23:07:59 dwilliss 00183 * Some new prototypes 00184 * 00185 * Revision 1.260 2002/04/10 20:48:32 vdronov 00186 * added few TABLETYPEs 00187 * 00188 * Revision 1.259 2002/04/08 15:20:17 scowan 00189 * Changed atuo count name to auto increment. 00190 * 00191 * Revision 1.258 2002/04/04 20:41:21 scowan 00192 * Changed db field to removed unused members and add auto count. 00193 * 00194 * Revision 1.257 2002/03/22 17:36:37 dwilliss 00195 * Created Cursor versions of all the Record access functions. Should clear up 00196 * some confusion about what to pass to what parameters 00197 * 00198 * Revision 1.256 2002/03/22 15:03:40 mju 00199 * Commnets. 00200 * 00201 * Revision 1.255 2002/03/08 20:28:15 scowan 00202 * Added clear methods. 00203 * deprecate mem... for info structs. 00204 * 00205 * Revision 1.254 2002/03/08 17:49:49 dwilliss 00206 * Added TABLETYPES for flight path 00207 * 00208 * Revision 1.253 2002/02/26 15:25:07 dwilliss 00209 * Added JOIN flags for how to deal with attachments 00210 * 00211 * Revision 1.252 2002/02/14 15:01:51 scowan 00212 * Chagned name of new table type. 00213 * 00214 * Revision 1.251 2001/12/20 17:33:20 scowan 00215 * Retired old Ext derived macros. 00216 * 00217 * Revision 1.250 2001/11/01 20:34:00 dwilliss 00218 * Added a TABLE_ flag 00219 * 00220 * Revision 1.249 2001/10/11 17:38:25 scowan 00221 * Added function to report table useage field. 00222 * 00223 * Revision 1.248 2001/09/20 15:26:34 scowan 00224 * Added DateTime field flags. 00225 * 00226 * Revision 1.247 2001/09/14 14:58:13 mju 00227 * No Mdlg in win32native. 00228 * 00229 * Revision 1.246 2001/08/28 20:31:49 scowan 00230 * *** empty log message *** 00231 * 00232 * Revision 1.245 2001/08/20 20:17:24 dwilliss 00233 * Added a DBCAP type 00234 * 00235 * Revision 1.244 2001/07/18 21:03:11 scowan 00236 * Added TAB format link functions. 00237 * 00238 * Revision 1.243 2001/07/09 20:24:51 dwilliss 00239 * Added flags to ignore TNTatlas's read-only policy so databases under 00240 * sketch layers can be edited 00241 * 00242 * Revision 1.242 2001/06/19 17:32:07 scowan 00243 * Added table prompt flag. 00244 * 00245 * Revision 1.241 2001/06/11 15:58:46 scowan 00246 * Changed time field to datetime field. 00247 * 00248 * Revision 1.240 2001/06/06 20:47:33 scowan 00249 * Added new field type and table type (usage). 00250 * 00251 * Revision 1.239 2001/05/23 20:54:49 scowan 00252 * More const. 00253 * 00254 * Revision 1.238 2001/05/23 20:35:32 scowan 00255 * Added mi string versions to field to string functions. 00256 * 00257 * Revision 1.237 2001/05/16 15:08:01 scowan 00258 * Move operator to C++ area. 00259 * 00260 * Revision 1.236 2001/05/15 20:13:37 scowan 00261 * More things const. 00262 * 00263 * Revision 1.235 2001/04/04 22:48:51 scowan 00264 * More const. 00265 * 00266 * Revision 1.230 2001/03/16 16:18:33 dwilliss 00267 * Added new TableType 00268 * 00269 * Revision 1.229 2001/03/14 20:48:07 vdronov 00270 * *** empty log message *** 00271 * 00272 * Revision 1.228 2001/03/14 20:41:53 vdronov 00273 * added cast (UINT32) inMfGetDBMode 00274 * 00275 * Revision 1.226 2001/02/16 17:07:10 msmith 00276 * Genitor documentation. 00277 * 00278 * Revision 1.225 2001/02/02 21:26:53 dwilliss 00279 * never mind... 00280 * 00281 * Revision 1.224 2001/01/29 23:19:20 msmith 00282 * Useless field for GetAttachedRecordList. 00283 * 00284 * Revision 1.223 2001/01/17 23:51:12 dwilliss 00285 * new protos 00286 * 00287 * Revision 1.222 2001/01/17 20:27:43 msmith 00288 * Genitor documentation. 00289 * 00290 * Revision 1.221 2000/12/06 22:59:00 dwilliss 00291 * nothing 00292 * 00293 * Revision 1.220 2000/10/24 17:20:56 mju 00294 * Tell Genitor to not document internal functions. 00295 * 00296 * Revision 1.219 2000/09/08 15:28:16 scowan 00297 * Added copy table filtered ext function. 00298 * 00299 * Revision 1.218 2000/09/08 15:24:54 mju 00300 * *** empty log message *** 00301 * 00302 * Revision 1.217 2000/09/06 15:33:54 scowan 00303 * More const. 00304 * 00305 * Revision 1.216 2000/08/30 16:55:40 scowan 00306 * *** empty log message *** 00307 * 00308 * Revision 1.215 2000/08/29 14:03:40 scowan 00309 * Added database callback. 00310 * 00311 * Revision 1.214 2000/08/25 22:48:04 scowan 00312 * *** empty log message *** 00313 * 00314 * Revision 1.213 2000/08/25 22:42:33 scowan 00315 * *** empty log message *** 00316 * 00317 * Revision 1.212 2000/08/24 21:50:51 scowan 00318 * *** empty log message *** 00319 * 00320 * Revision 1.211 2000/08/17 21:27:05 scowan 00321 * *** empty log message *** 00322 * 00323 * Revision 1.210 2000/08/15 14:49:48 scowan 00324 * Added copy theme table flag. 00325 * 00326 * Revision 1.209 2000/08/08 22:51:53 scowan 00327 * *** empty log message *** 00328 * 00329 * Revision 1.208 2000/08/08 22:45:37 scowan 00330 * *** empty log message *** 00331 * 00332 * Revision 1.207 2000/08/08 22:29:37 scowan 00333 * Move inline operators to c++ specific code. 00334 * 00335 * Revision 1.206 2000/08/08 20:18:34 scowan 00336 * *** empty log message *** 00337 * 00338 * Revision 1.205 2000/08/08 19:24:58 scowan 00339 * A whole gob of ELEMTYPE and const changes. 00340 * 00341 * Revision 1.204 2000/08/02 14:57:25 scowan 00342 * More const again. 00343 * 00344 * Revision 1.203 2000/08/02 14:52:07 scowan 00345 * Make more things const. 00346 * 00347 * Revision 1.202 2000/06/27 22:11:17 mju 00348 * Use const for MfDatabaseJoin translists. 00349 * 00350 * Revision 1.201 2000/06/19 20:26:35 scowan 00351 * *** empty log message *** 00352 * 00353 * Revision 1.200 2000/05/31 17:44:34 dwilliss 00354 * Fixed goof 00355 * 00356 * Revision 1.199 2000/05/24 16:25:29 dwilliss 00357 * Rearranged things so some #defines go with the structure they're 00358 * for. Helps the documentation. 00359 * 00360 * Revision 1.198 2000/04/17 21:02:24 scowan 00361 * Added assignment operators. 00362 * 00363 * Revision 1.197 2000/03/16 16:09:26 scowan 00364 * *** empty log message *** 00365 * 00366 * Revision 1.196 2000/03/15 18:17:29 dwilliss 00367 * Added another flag 00368 * 00369 * Revision 1.195 2000/03/15 18:12:52 dwilliss 00370 * Added TABLETYPE_Internal. How'd we miss that one? 00371 * 00372 * Revision 1.194 1999/12/17 15:21:41 mju 00373 * Use const prompt for MdlgGetDatabase... 00374 * 00375 * Revision 1.193 1999/12/03 22:41:54 dwilliss 00376 * *** empty log message *** 00377 * 00378 * Revision 1.192 1999/12/03 22:00:59 dwilliss 00379 * *** empty log message *** 00380 * 00381 * Revision 1.191 1999/11/17 21:41:33 mju 00382 * Don't declare unused parm in inline. 00383 * 00384 * Revision 1.190 1999/11/12 22:51:52 dwilliss 00385 * Make a bunch of parms const 00386 * 00387 * Revision 1.189 1999/11/10 16:21:46 dwilliss 00388 * *** empty log message *** 00389 * 00390 * Revision 1.188 1999/11/08 21:47:22 dwilliss 00391 * Added JOIN_Flags for Natural and Union 00392 * 00393 * Revision 1.187 1999/10/26 16:27:19 dwilliss 00394 * Changed a bunch of macros to inline functions. 00395 * Added protos for new StringToField/FieldToString functions which 00396 * take UNITCONV parameters 00397 * 00398 * Revision 1.186 1999/10/05 22:46:18 scowan 00399 * *** empty log message *** 00400 * 00401 * Revision 1.185 1999/10/05 22:45:15 scowan 00402 * Changed header to inheritance. 00403 * 00404 * Revision 1.184 1999/09/01 19:34:55 dwilliss 00405 * new proto 00406 * 00407 * Revision 1.183 1999/08/05 22:38:49 dwilliss 00408 * Doh! Forgot to export the functions I just added to rvcapp.dll 00409 * 00410 * Revision 1.182 1999/08/05 21:14:53 dwilliss 00411 * Added bulk modify callback reasons and BulkModifyBegin/End functions 00412 * 00413 * Revision 1.181 1999/07/20 16:32:09 dwilliss 00414 * *** empty log message *** 00415 * 00416 * Revision 1.180 1999/07/20 14:34:35 dwilliss 00417 * *** empty log message *** 00418 * 00419 * Revision 1.179 1999/07/19 22:40:31 dwilliss 00420 * Changed the proto I just added. Needed another parm 00421 * 00422 * Revision 1.178 1999/07/19 19:33:13 dwilliss 00423 * New prototype 00424 * 00425 * Revision 1.177 1999/07/14 19:45:09 dwilliss 00426 * *** empty log message *** 00427 * 00428 * Revision 1.176 1999/06/16 17:06:54 mju 00429 * Add TABLE_TIN_RefAny. 00430 * 00431 * Revision 1.175 1999/06/11 14:45:28 mju 00432 * Obj sel dlg. 00433 * 00434 * Revision 1.174 1999/06/10 22:10:54 mju 00435 * Object selection dialog update. 00436 * 00437 * Revision 1.173 1999/06/09 16:07:35 mju 00438 * Use WIN32 instead of WIn95. 00439 * 00440 * Revision 1.172 1999/05/07 21:22:12 mju 00441 * Header restruct. 00442 * 00443 * \endif 00444 **/ 00445 00446 #ifndef INC_MI32_RVCDBASE_H 00447 #define INC_MI32_RVCDBASE_H 00448 00449 #ifndef INC_MI32_RVCDEFNS_H 00450 #include <mi32/rvcdefns.h> 00451 #endif 00452 00453 #ifndef INC_MI32_MCB_H 00454 #include <mi32/mcb.h> 00455 #endif 00456 00457 #ifndef INC_MI32_ELEMTYPE_H 00458 #include <mi32/elemtype.h> 00459 #endif 00460 00461 #ifndef INC_MI32_UNITCONV_H 00462 #include <mi32/unitconv.h> //! We need sizeof(UNTICONV) in an inline func 00463 #endif 00464 00465 #ifndef INC_MI32_SIMPLEAR_H 00466 #include <mi32/simplear.h> // Used in a prototype, but only for C++ function 00467 #endif 00468 00469 #ifndef INC_MI32_TEXTID_H 00470 #include <mi32/textid.h> 00471 #endif 00472 00473 00474 //! 00475 //! Structure used to maintain list of element to record attachments. 00476 //! @see MfReadDBList 00477 //! @see MfReadDBListExt 00478 //! @see MfAppendDBList 00479 //! 00480 struct DBLISTELMT { 00481 INT32 table; //!< Table 00482 INT32 record; //!< Record 00483 //! Size of this structure must not change 00484 }; 00485 00486 typedef INT32 DBCURSOR; 00487 00488 //! Database field constraints. 00489 //! Need to always add to the end of this structure. Don't reorder fields 00490 //! Adjust dbconst.c when adding new fields 00491 struct DBCONSTRAINT { 00492 DOUBLE min, max; //!< Minimum and maxiumum values 00493 DOUBLE dftnum; //!< Default to use for numeric prompts 00494 00495 UINT32 flags; //!< See "Custom Code in Header After Class" for list of flags 00496 UNICODE *label; //!< Label 00497 UNICODE *desc; //!< Description 00498 UNICODE *dftstr; //!< Default to use for string prompts 00499 UNICODE *InvalidMsg; //!< Message to give for Invalid values 00500 UNICODE *ValidChars; //!< List of valid characters 00501 UNICODE *picture; //!< eg: "###,###,###,###.## 00502 UNICODE *labelafter; //!< Label to go after 00503 UNICODE *EmptyString; //!< Value to set option menu to if "unknown" value selected 00504 UNICODE *ValidStrings; //!< Comma seperated list of valid values 00505 }; 00506 00507 00508 #define DBCONSTRAINT_MinExclusive 0x00000001 //!< Numeric prompt has min value 00509 #define DBCONSTRAINT_MaxExclusive 0x00000002 //!< Numeric prompt has max value 00510 #define DBCONSTRAINT_MinInclusive 0x00000004 //!< Min is inclusive 00511 #define DBCONSTRAINT_MaxInclusive 0x00000008 //!< Max is inclusive 00512 00513 #define DBCONSTRAINT_MINMASK (DBCONSTRAINT_MinInclusive | DBCONSTRAINT_MinExclusive) 00514 #define DBCONSTRAINT_MAXMASK (DBCONSTRAINT_MaxInclusive | DBCONSTRAINT_MaxExclusive) 00515 #define DBCONSTRAINT_MINMAXMASK (DBCONSTRAINT_MINMASK | DBCONSTRAINT_MAXMASK) 00516 00517 /* 00518 * Note: These only apply to numeric fields. String fields either have a 00519 * default or not, and that's controlled by the value of dftstr. At some 00520 * point, we may want other defaults (username, etc), and string defaults 00521 * need their own group of flags 00522 */ 00523 #define DBCONSTRAINT_Default 0x00000010 //!< Has default value 00524 #define DBCONSTRAINT_AutoIncrement 0x00000020 00525 #define DBCONSTRAINT_DefaultBlank 0x00000040 00526 #define DBCONSTRAINT_DEFAULTMASK (DBCONSTRAINT_Default|DBCONSTRAINT_AutoIncrement|DBCONSTRAINT_DefaultBlank) 00527 00528 #define DBCONSTRAINT_ForceUpperCase 0x00000100 //!< STRING MUST BE ALL CAPS 00529 #define DBCONSTRAINT_ForceLowerCase 0x00000200 //!< string must be all lower case 00530 #define DBCONSTRAINT_FirstLetterCap 0x00000400 //!< Capitalize First Letter Of Each Word 00531 #define DBCONSTRAINT_FirstWordCap 0x00000800 //!< Capitalize first letter of first word 00532 #define DBCONSTRAINT_CASEMASK 0x00000F00 00533 00534 #define DBCONSTRAINT_MustExist 0x00008000 //!< Value must exist in PK table 00535 #define DBCONSTRAINT_AutoAdd 0x00010000 //!< If not in PK table, add it 00536 #define DBCONSTRAINT_AutoAddPrompt 0x00020000 //!< If not in PK table, prompt for new values 00537 #define DBCONSTRAINT_FKEYVALIDATEMASK (DBCONSTRAINT_MustExist | DBCONSTRAINT_AutoAdd | DBCONSTRAINT_AutoAddPrompt) 00538 00539 #define DBCONSTRAINT_ComboBox 0x00040000 //!< Show as a combo-box 00540 #define DBCONSTRAINT_OptionMenu 0x00080000 //!< Show as an option-menu 00541 #define DBCONSTRAINT_FKEYSHOWASMASK (DBCONSTRAINT_ComboBox | DBCONSTRAINT_OptionMenu) 00542 00543 #define DBCONSTRAINT_NotNull 0x00100000 //!< Redundant with field flag? 00544 #define DBCONSTRAINT_Unique 0x00200000 //!< Redundant with field flag? 00545 00546 #define DBCONSTRAINT_AutoComplete 0x00400000 //!< fill in based on PK values 00547 #define DBCONSTRAINT_InvertValidSet 0x00800000 //!< List of ValidChars is really invalid 00548 00549 //! Database info structure. 00550 struct RVCDBASEINFO : public RVCGENINFO { 00551 INT16 NumTables; //!< Number of tables 00552 INT16 MaxLinkSize; //!< Size of largest link item (in records) 00553 UINT16 height, width; //!< Size of window. If width==0, ignore these 00554 INT16 x, y; //!< Location of window. If width==0, ignore these 00555 UINT16 iheight, iwidth; //!< Size of window. If width==0, ignore these 00556 INT16 ix, iy; //!< Location of window. If width==0, ignore these 00557 INT32 NumLinks; //!< Number of links in DBList 00558 UINT32 m_flags; 00559 UINT8 spare[4]; 00560 00561 RVCDBASEINFO ( 00562 ) {Clear();} 00563 00564 RVCDBASEINFO ( 00565 const RVCGENINFO& ginfo 00566 ) {Clear();*static_cast<RVCGENINFO*>(this) = ginfo;} 00567 00568 RVCDBASEINFO& operator= ( 00569 const RVCGENINFO& ginfo //!< RVCGENINFO structure to copy from 00570 ) {*static_cast<RVCGENINFO*>(this) = ginfo; return (*this);} 00571 00572 void Clear ( 00573 ) {memset(static_cast<void*>(this), 0, sizeof(*this));} 00574 00575 }; 00576 00577 00578 #define DBFLAG_IsValidated 0x00000001 00579 00580 //! Table info structure. 00581 struct RVCTABLEINFO : public RVCGENINFO { 00582 INT32 OldNumRecords; //!< Number of records in table 00583 INT16 NumFields; //!< Number of fields 00584 INT16 NumKeys; //!< Number of fields with keys 00585 INT16 TableNumber; //!< Internal table number (could be implied) 00586 INT16 DataType; //!< See "Custom Code in Header After Class" for list of types 00587 UINT16 FileRecSize; //!< Size of record in file (maximum) 00588 UINT16 MemRecSize; //!< Size of record in memory (for programs) 00589 INT16 rbtable; //!< R:BASE table number (if it's R:BASE) 00590 INT16 FieldInfoSize; //!< sizeof(DBFIELDINFO), if 0, assume 64 00591 INT32 InitOffset; //!< offset to actual data (for dBase, etc) 00592 UINT32 flags; //!< See "Custom Code in Header After Class" for list of flags 00593 RVC::OBJECTNAME password; //!< Optional password required to edit data 00594 UINT8 AttachmentType; //!< See "Custom Code in Header After Class" for list of flags 00595 UINT8 TableVersion; //!< For internal use only 00596 UINT8 delim; //!< For CSV tables only. normally ',' 00597 UINT8 TableType; //!< See "Custom Code in Header After Class" for list of values 00598 UINT16 height, width; //!< height/width of window when last shown 00599 INT16 x, y; //!< coord of wind. Ignore if widht==0 or FormInode != 0 00600 UINT16 iheight, iwidth; //!< height/width of window when last shown 00601 INT16 ix, iy; //!< coord of wind. Ignore if widht==0 or FormInode != 0 00602 FIXEDSTRING<256> filename; //!< name of file (for dBase, R:BASE, etc) 00603 RVC::OBJECTNAME objname; //!< Name of style object or form object 00604 RVC::OBJECTNAME encoding; //!< Encoding used for strings (Default: Latin-1) 00605 INT32 NumDeletedRecords; //!< Number of deleted records 00606 00607 RVCTABLEINFO ( 00608 ) {Clear();} 00609 00610 RVCTABLEINFO ( 00611 const RVCGENINFO& ginfo 00612 ) {Clear();*static_cast<RVCGENINFO*>(this) = ginfo;} 00613 00614 RVCTABLEINFO& operator= ( 00615 const RVCGENINFO& ginfo //!< RVCGENINFO structure to copy from 00616 ) {*static_cast<RVCGENINFO*>(this) = ginfo; return (*this);} 00617 00618 void Clear ( 00619 ) {memset(static_cast<void*>(this), 0, sizeof(*this));} 00620 00621 }; 00622 00623 //! Flags for RVCTABLEINFO.flags 00624 #define TABLE_StyleTable 0x00000001 //!< Style-assignment table 00625 #define TABLE_StdStats 0x00000002 //!< Standard attributes table 00626 #define TABLE_Open 0x00000004 //!< Window open by default 00627 #define TABLE_ScaleSelect 0x00000008 //!< Scale selection table 00628 #define TABLE_TIN_RefNode 0x00000010 //!< Table can be referenced by TIN node elements 00629 #define TABLE_TIN_RefEdge 0x00000020 //!< Table can be referenced by TIN edge elements 00630 #define TABLE_TIN_RefTriangle 0x00000040 //!< Table can be referenced by TIN triangle elements 00631 #define TABLE_TIN_RefHull 0x00000080 //!< Table can be referenced by TIN hull elements 00632 #define TABLE_TIN_RefAny (TABLE_TIN_RefNode | TABLE_TIN_RefEdge | TABLE_TIN_RefTriangle | TABLE_TIN_RefHull) 00633 #define TABLE_TabularView 0x00000100 //!< Default to viewing in Tabular View 00634 #define TABLE_SingleRecView 0x00000200 //!< Default to viewing in Single Record View 00635 #define TABLE_ViewModeMask (TABLE_TabularView | TABLE_SingleRecView) 00636 #define TABLE_SystemHidden 0x00000400 //!< Table is for internal use only 00637 #define TABLE_UserHidden 0x00000800 //!< Table is hidden by user 00638 #define TABLE_Hidden (TABLE_SystemHidden | TABLE_UserHidden) 00639 #define TABLE_ReadOnly 0x00001000 //!< Table is read-only (and may or may not be made writable) 00640 #define TABLE_NoUserWrite 0x00002000 //!< System writable, but not in editor (eg StdStats should set this) 00641 #define TABLE_NoWriteAccess 0x00004000 //!< Read only and we couln't make it writable if we wanted to 00642 #define TABLE_FieldNamesLine1 0x00008000 //!< For CSV only. First line is field names 00643 #define TABLE_Prompt 0x00010000 //!< Table is selected as a prompt table 00644 //! other TABLE_Xxxx values defined below... 00645 00646 00647 /* 00648 ** Flags for MfReadFieldPtrExt(), MfReadTableExt(), etc... 00649 ** Note that these are arranged so that the FIELD_ flags for 00650 ** MfReadField...Ext() can be or'd in with them 00651 ** 00652 ** Note that although these are named like the ones above, they can 00653 ** overlap. 00654 */ 00655 #define TABLE_LockBuffer 0x00010000 00656 #define TABLE_Absolute 0x00020000 //!< Record # is absolute, not bookmark 00657 #define TABLE_NoComputed 0x00040000 //!< Don't bother reading computed fields 00658 #define TABLE_RecNumIsCursor 0x00080000 //!< Record # is a DBCURSOR 00659 #define TABLE_Cursor 0x00080000 //!< Record # is a DBCURSOR 00660 #define TABLE_Bookmark 0x00100000 //!< Record # is a bookmark 00661 #define TABLE_NoUpdateIndex 0x00200000 //!< Do not update the index for this table 00662 #define TABLE_DeleteIndex 0x00400000 //!< Do not update the index for this table 00663 #define TABLE_KeepPassword 0x00800000 //!< For MfLinkTable with ODBC, Keep password in link 00664 #define TABLE_NoCache 0x01000000 //!< _MfGetDBTempRecBuf will ignore any copy already in the cache 00665 #define TABLE_NoUpdateDBList 0x02000000 //!< Do not update the dblist. (flag to MfDeleteRecord) 00666 00667 /* 00668 ** Flags for AttachmentType 00669 */ 00670 #define ATTACH_NoRestrictions 0 //!< Your standard free-for-all 00671 #define ATTACH_OneRecordPerElement 1 //!< But may use record for multiple elements 00672 #define ATTACH_OneElementPerRecord 2 //!< But element may have multiple records 00673 #define ATTACH_OneToOne 3 00674 #define ATTACH_RelatedOnly 4 //!< No attachments at all, only related 00675 #define ATTACH_Identity 5 //!< Record number is element number 00676 #define ATTACH_Count 6 //!< Number of attachment types 00677 00678 //! Possible Values for RVCTABLEINFO.TableType 00679 #define TABLETYPE_UserDefined 0 00680 #define TABLETYPE_Style 1 //!< Obsolete code. Use one below... 00681 #define TABLETYPE_StdStats 2 00682 #define TABLETYPE_ElementID 3 00683 #define TABLETYPE_NodeTurn 4 00684 #define TABLETYPE_ScaleSelect 5 00685 #define TABLETYPE_Section 6 00686 #define TABLETYPE_Internal 7 //!< Data pulled from elements of parent object 00687 #define TABLETYPE_PointStyle 8 //!< For extruded things. 00688 #define TABLETYPE_LineStyle 9 //!< For extruded things. 00689 #define TABLETYPE_PolyStyle 10 //!< For extruded things. 00690 #define TABLETYPE_TextStyle 11 //!< For extruded things. 00691 #define TABLETYPE_CADStyle 12 //!< For extruded things. 00692 #define TABLETYPE_EditLog 13 //!< For TNTserver editor log 00693 #define TABLETYPE_Selection 14 //!< Attribute selection table 00694 #define TABLETYPE_FlightPath 15 //!< Flight path 00695 #define TABLETYPE_PointOfInterest 16 //!< Point of Interest 00696 #define TABLETYPE_LegendElement 17 00697 #define TABLETYPE_StyleParameters 18 00698 #define TABLETYPE_SelectParameters 19 00699 #define TABLETYPE_ExtrudedPoints 20 00700 #define TABLETYPE_Count 21 //!< Number of table types 00701 00702 //! Possible values for RVCTABLEINFO.DataType 00703 #define DBTYPE_BUILTIN -2 //!< MIPS built in tables 00704 #define DBTYPE_NSINTERNAL -1 //!< MIPS Internal format (non-sparse) (obsolete) 00705 #define DBTYPE_SPARSE 0 //!< MIPS Internal format (sparse) ("normal") 00706 #define DBTYPE_MIPS 1 //!< MIPS external format (old RVF style) 00707 #define DBTYPE_DBASE3 2 //!< dBase III+ format (external only) 00708 #define DBTYPE_INFO 3 //!< INFO format (external only) 00709 #define DBTYPE_DBASE4 4 //!< dBase IV (external only) 00710 #define DBTYPE_RBASE 5 //!< R:BASE (external only) 00711 #define DBTYPE_DBASE2 6 //!< Dbase 2 (external only) 00712 #define DBTYPE_ODBC 7 //!< Link to ODBC server (external only) 00713 #define DBTYPE_CSV 8 //!< Comma Seperated values (export only) 00714 #define DBTYPE_MAPINFOTAB 9 //!< MapInfo TAB (internal) format 00715 #define DBTYPE_ORACLE 10 //!< Link to Oracle server (external only) 00716 #define DBTYPE_MAXTYPE 10 00717 00718 //! Define field parameters.. 00719 struct DBFIELDINFO { 00720 RVC::OBJECTNAME name; //!< Field name, for searching, headings, etc... 00721 UINT8 type; //!< See "Custom Code in Header After Class" for list of types 00722 UINT8 decplaces; //!< Number of decimal places in file (dBaseIII) 00723 UINT16 size; //!< Field size in bytes (in memory) 00724 00725 UINT16 disksize; //!< Field size in bytes (in disk file) 00726 UINT16 offset; //!< Offset of field in memory record 00727 00728 UINT16 diskoffset; //!< Offset of field in disk record 00729 UINT16 oldflags; //!< Flags (autocopied into flags) 00730 00731 UINT8 specialconv; //!< See "Custom Code in Header After Class" for list of values 00732 INT8 exttype; //!< External database storage type 00733 UINT8 dispwidth; //!< Default field width on the display 00734 INT8 packed; //!< how packed (including byte order?) 00735 00736 UINT8 unittype; //!< unit type, length, area, etc... 00737 UINT8 unitstored; //!< unit value is stored in 00738 UINT8 unitshown; //!< units to show in (if 255, use stored) 00739 INT8 sql_type; //!< Type flag for ODBC (needs internal and external types) 00740 00741 UINT32 AutoIncrement; //!< Store the number to assign to the field for new records. 00742 INT32 key_table; //!< Table with primary key (iff key_field != 0) 00743 UINT16 key_field; //!< Field in key_table for primary field (+ 1) 00744 UINT16 next_field; //!< Next field in _this_ table for secondary key (+ 1) 00745 UINT32 flags; //!< Expanded flags field. Lower 16bits are from "oldflags". See "Custom Code in Header After Class" for list of flags 00746 UINT8 usage; //!< Does this field have an internal usage? 00747 UINT8 format; //!< usage dependant, for future expansion 00748 UINT16 spare; 00749 RVC::OBJECTNAME domid; //!< For special database linking if next_field==FIELDNUM_DomID 00750 }; 00751 00752 #define DBFIELDTYPE_String 1 //!< ASCII character string, null-terminated 00753 #define DBFIELDTYPE_Char 2 //!< Single ASCII character 00754 #define DBFIELDTYPE_UByte 3 //!< Unsigned 1-byte integer (0-255) 00755 #define DBFIELDTYPE_Byte 4 //!< Signed 1-byte integer (-128-128) 00756 #define DBFIELDTYPE_UWord 5 //!< Unsigned 2-byte integer (0-65535) 00757 #define DBFIELDTYPE_Word 6 //!< Signed 2-byte integer (-32768-32767) 00758 #define DBFIELDTYPE_ULong 7 //!< Unsigned 4-byte integer (0 - 2^32-1) 00759 #define DBFIELDTYPE_Long 8 //!< Signed 4-byte integer (-2^31 - 2^31-1) 00760 #define DBFIELDTYPE_Float 9 //!< 4-byte floating-point number 00761 #define DBFIELDTYPE_Double 10 //!< 8-byte floating-point number 00762 #define DBFIELDTYPE_Logical 11 //!< 1-byte logical (?/Y/y/N/n/T/t/F/f/0/1) 00763 #define DBFIELDTYPE_Date 12 //!< 4-byte integer date YYYYMMDD 00764 #define DBFIELDTYPE_UDLong 13 //!< Unsigned 8-byte integer (0 - 2^64-1) 00765 #define DBFIELDTYPE_DLong 14 //!< Signed 8-byte integer (-2^63 - 2^63-1) 00766 #define DBFIELDTYPE_Color 15 //!< Color spec. Always 8 bytes (COLOR) 00767 #define DBFIELDTYPE_Binary 16 //!< BLOB field (Binary Largs Object Blob) 00768 #define DBFIELDTYPE_Memo 17 //!< Memo field 00769 #define DBFIELDTYPE_Unicode 18 //!< UNICODE string, null-terminated 00770 #define DBFIELDTYPE_DateTime 19 //!< Date/Time field, 100 nanoseconds from 1-Jan-1601 (unsigned 64 bit integer) 00771 #define DBFIELDTYPE_NumTypes 20 //!< 1 + the last type 00772 //! Be sure to update "alignment" array in rvcdbase.c when adding field types 00773 00774 #define DBCONV_dddmmss 1 //!< Special DDDMMSS conversion 00775 #define DBCONV_currency 2 //!< Long (cents) -> double (dollars) 00776 #define DBCONV_rbdate 3 //!< R:BASE date format (format unknown) 00777 #define DBCONV_time 4 00778 #define DBCONV_ODBCDate 5 00779 #define DBCONV_ODBCDateTime 6 //!< TIMESTAMP_STRUCT -> DBFIELDTYPE_DateTime 00780 00781 //! DBFIELDINFO.flags 00782 #define FIELD_PK 0x00000001 //!< Field is a primary key (force index) 00783 #define FIELD_FK 0x00000002 //!< Field is a foreign key (index optional) 00784 #define FIELD_Indexed 0x00000004 //!< Field has index (in RVC) 00785 #define FIELD_SSIndex 0x00010000 //!< Field has index (in ODBC) 00786 #define FIELD_Searchable (FIELD_Indexed | FIELD_SSIndex) 00787 #define FIELD_INDEXED FIELD_Indexed //!< old "spelling" 00788 #define FIELD_KEYMASK 0x00000007 //!< All field flags 00789 #define FIELD_NotNULL 0x00000010 //!< Value cannot be NULL 00790 #define FIELD_Unique 0x00000020 //!< value must be unique 00791 #define FIELD_ReadOnly 0x00000040 //!< User can't change value 00792 #define FIELD_SK 0x00000080 //!< Secondary (or higher) key 00793 #define FIELD_Invisible 0x00000100 //!< Don't show the field at all 00794 00795 //! These are for specifying that a key field has an implied range. 00796 //! 00797 //! RangeAbove is defined as starting with the key field value 00798 //! itself as the minimum value and extending to (but not including) the 00799 //! value of the field in the next record in sorted order. 00800 00801 #define FIELD_Closest 0x00000200 00802 #define FIELD_RangeAbove 0x00000400 00803 #define FIELD_RangeBelow 0x00000800 00804 00805 #define FIELD_ForceIndex 0x00002000 //!< For MfMakeKey() Force new index 00806 #define FIELD_Sorted 0x00004000 //!< For MfMakeKey(), already sorted 00807 #define FIELD_Changed 0x00008000 //!< Only temp--set in editor 00808 00809 #define FIELD_ComputeOnRead 0x00000008 //!< Field is computed 00810 #define FIELD_ComputeOnWrite 0x00001000 //!< Compute field on write 00811 #define FIELD_Computed (FIELD_ComputeOnRead|FIELD_ComputeOnWrite) 00812 00813 #define FIELD_LocalTime 0x00002000 //!< DBFIELDTYPE_DateTime is stored in local time 00814 #define FIELD_AutoIncrement 0x00004000 //!< Add record function assignes the "AutoIncrement" value to the field and then increments "AutoImcrement" 00815 00816 //! These flags are for MfDBFieldToStringExt() 00817 //! Note that these can't overlap with the TABLE_Xxx flags passed to 00818 //! the read functions. The two can be or'd together. 00819 //! The fact that the names start with FIELD_ like the DBFIELDINFO flags 00820 //! above is an unfortunate historical mistake. 00821 00822 #define FIELD_ForcePlaces 0x0001 //!< Force 0 decimal places 00823 //! (Without this flag, 0 for decplaces causes it to use whatever's in 00824 //! the DBFIELDINFO 00825 #define FIELD_SingleField 0x0002 //!< Buffer contains JUST this field 00826 //! By default, buffer is assumed to contain the whole record 00827 00828 #define FIELD_Unicode 0x0004 //!< Output buffer should be in Unicode 00829 #define FIELD_ISO2022 0x0008 //!< Output buffer should be in ISO-2022 00830 #define FIELD_NaN 0x0010 //!< Return NaN for unknown values 00831 #define FIELD_NoUnitConv 0x0020 //!< Don't do any unit conversion 00832 #define FIELD_MultiKey 0x0040 //!< String together multi-field keys with commas (for MfReadFieldStr()) 00833 #define FIELD_ShowLocalTime 0x0080 //!< Show DBFIELDTYPE_DateTime in local time zone 00834 00835 00836 00837 //! pseudo fields for DBFIELDINFO.next_field. Some database schemas 00838 //! require a 2 part key where the primary key is made up of 2 fields 00839 //! but the foreign key is made up of 1 field and the name of the field 00840 //! or one field and a "domid" which is looked up from a 3rd table by 00841 //! using the table/field name. We look those up on import and record 00842 //! them in the DBFIELDINFO.domid. I don't know of anything that would 00843 //! use the table name, but I added it for completeness 00844 #define FIELDNUM_ThisFieldName 0xFFFF //!< Name of this field is the key data 00845 #define FIELDNUM_ThisTableName 0xFFFE //!< Name of this table is the key data 00846 #define FIELDNUM_DomID 0xFFFD //!< Key data is the "domid" field of this field 00847 #define FIELDNUM_PseudoField 0xFFFD //!< If next_field is >= this, it's one of these 00848 00849 00850 //! Usage codes. An import could use these as "suggestions". HyperIndex uses 00851 //! them to keep track of which fields in a pinmap contain the link. 00852 //! 00853 //! These should NOT be used to keep track of user settings. i.e., if a user 00854 //! picks a field to use as a label, don't set the finfo.usage; save it in your 00855 //! own subobject. 00856 00857 #define DBFIELDUSAGE_XCoord 1 00858 #define DBFIELDUSAGE_YCoord 2 00859 #define DBFIELDUSAGE_ZCoord 3 00860 #define DBFIELDUSAGE_Label 4 00861 #define DBFIELDUSAGE_Filename 5 00862 #define DBFIELDUSAGE_ObjName 6 00863 00864 00865 //! Structures for Forms. 00866 struct FORMFIELD { 00867 RVC::OBJECTNAME fname; //!< Field name 00868 FIXEDSTRING<80> desc; //!< Label to put on the field 00869 DOUBLE min, max; //!< For range checking 00870 DOUBLE dft, sparedouble; 00871 INT16 lin, partial_lin; //!< Position in chars and 100ths of a char 00872 INT16 col, partial_col; 00873 00874 INT16 end_lin, end_partial_lin; //!< Lower right corner 00875 INT16 end_col, end_partial_col; //!< For "frames" 00876 00877 INT16 lins, cols; //!< Shape of editable portion 00878 INT16 partial_lins, partial_cols; //!< Partial lines / cols 00879 00880 INT16 places; //!< Number of decimal places to show 00881 INT16 type; //!< FFIELDTYPE_Xxxx below 00882 00883 UINT32 flags; //!< FFIELDFLAG_Xxxx below 00884 INT32 parent; //!< For fields in scrolled list 00885 UINT8 spare[4]; 00886 }; 00887 00888 //! Form info structure. 00889 struct RVCFORMINFO : public RVCGENINFO { 00890 RVC::OBJECTNAME table; //!< Table for which this form was designed 00891 INT32 NumFields; //!< Number of FORMFIELD structures 00892 UINT32 flags; //!< Formflag below 00893 INT16 h, partial_h; //!< Height in chars and 100ths of a char 00894 INT16 w, partial_w; //!< Width in chars and 100ths of a char 00895 INT16 x, y; //!< Window position on the screen 00896 UINT8 spare[4]; 00897 00898 RVCFORMINFO ( 00899 ) {Clear();} 00900 00901 RVCFORMINFO ( 00902 const RVCGENINFO& ginfo 00903 ) {Clear();*static_cast<RVCGENINFO*>(this) = ginfo;} 00904 00905 RVCFORMINFO& operator= ( 00906 const RVCGENINFO& ginfo //!< RVCGENINFO structure to copy from 00907 ) {*static_cast<RVCGENINFO*>(this) = ginfo; return (*this);} 00908 00909 void Clear ( 00910 ) {memset(static_cast<void*>(this), 0, sizeof(*this));} 00911 00912 }; 00913 00914 //! Disallow memset/memcpy. 00915 PREVENT_MEMFUNC(RVCDBASEINFO) 00916 PREVENT_MEMFUNC(RVCTABLEINFO) 00917 PREVENT_MEMFUNC(RVCFORMINFO) 00918 00919 #define DBFORM_ShowInList 0x0001 00920 #define DBFORM_CheckMin 0x0002 00921 #define DBFORM_CheckMax 0x0004 00922 #define DBFORM_Leading0 0x0008 00923 #define DBFORM_RightJustify 0x0010 00924 00925 #define FFIELDTYPE_Field 1 00926 #define FFIELDTYPE_Desc 2 00927 #define FFIELDTYPE_ScrolledList 3 00928 #define FFIELDTYPE_Frame 4 00929 00930 #define FFIELDFLAG_CheckMin 1 00931 #define FFIELDFLAG_CheckMax 2 00932 #define FFIELDFLAG_RightJustify 4 00933 #define FFIELDFLAG_SelectButton 8 00934 #define FFIELDFLAG_AttachLeftForm 0x10 00935 #define FFIELDFLAG_AttachRightForm 0x20 00936 #define FFIELDFLAG_AttachTopForm 0x40 00937 #define FFIELDFLAG_AttachBottomForm 0x80 00938 00939 #define FORMFLAG_VScroll 1 00940 #define FORMFLAG_HScroll 2 00941 #define FORMFLAG_AllowResize 4 00942 00943 #define DBCAP_CanCreate 0x00000001 00944 #define DBCAP_CanLink 0x00000002 00945 #define DBCAP_ReadMemo 0x00000004 00946 #define DBCAP_WriteMemo 0x00000008 00947 #define DBCAP_WriteRecord 0x00000010 //!< Can written via API, regardless of DBCAP_UserWritable 00948 #define DBCAP_MultiTable 0x00000020 00949 #define DBCAP_Server 0x00000040 00950 #define DBCAP_Import 0x00000080 00951 #define DBCAP_Export 0x00000100 00952 #define DBCAP_DeleteRecord 0x00000200 00953 #define DBCAP_UserWritable 0x00000400 //!< ! TABLE_ReadOnly (Only used by editor) 00954 #define DBCAP_CanSetUserWrite 0x00000800 //!< User can toggle TABLE_ReadOnly 00955 #define DBCAP_ChangeFields 0x00001000 00956 #define DBCAP_AddFields 0x00002000 00957 #define DBCAP_DeleteFields 0x00004000 00958 #define DBCAP_AddRecord 0x00008000 00959 #define DBCAP_RandomAccess 0x00010000 00960 #define DBCAP_ReadBinary 0x00020000 00961 #define DBCAP_WriteBinary 0x00040000 00962 00963 00964 /*************************************************************************** 00965 * 00966 * Stuff for MfDBCursorSetFunction() 00967 * 00968 ***************************************************************************/ 00969 00970 #define DBCURSOR_Unique 0x00000001 00971 #define DBCURSOR_Sorted 0x00000002 00972 #define DBCURSOR_Equal 0x00000004 00973 #define DBCURSOR_GreaterThan 0x00000008 00974 #define DBCURSOR_LessThan 0x00000010 00975 #define DBCURSOR_NotEqual 0x00000020 00976 #define DBCURSOR_AND 0x00000040 00977 #define DBCURSOR_OR 0x00000080 00978 #define DBCURSOR_NoClear 0x00000100 //!< Add to previous function 00979 #define DBCURSOR_ForUpdate 0x00000200 //!< To allow writes 00980 #define DBCURSOR_OPMASK (DBCURSOR_Equal|DBCURSOR_GreaterThan|DBCURSOR_LessThan|DBCURSOR_NotEqual) 00981 00982 00983 //! For a list of possible callback reasons, see the "Custom Code in Header 00984 //! After Class Declaration" section below 00985 struct DBCALLBACKSTRUCT : public McbAnyCallbackStruct { 00986 int table; //!< Table 00987 INT32 record; //!< Record 00988 int handle; //!< Handle to open database 00989 UINT32 subreason; //!< For _StructChanged, what part changed 00990 00991 //! Default constructor. 00992 DBCALLBACKSTRUCT ( 00993 ) {memset(this, 0, sizeof(DBCALLBACKSTRUCT));} 00994 00995 //! Constructor. 00996 DBCALLBACKSTRUCT ( 00997 UINT32 ireason, //!< For _StructChanged, what part changed 00998 int itable, //!< Input table 00999 INT32 irecord, //!< Input record 01000 int ihandle, //!< Input database handle 01001 UINT32 isubreason = 0 //!< Sub reason 01002 ) : 01003 McbAnyCallbackStruct(ireason), 01004 table(itable), 01005 record(irecord), 01006 handle(ihandle), 01007 subreason(isubreason) 01008 {} 01009 01010 }; 01011 01012 #define DBCALLBACK_StructChanged 0x0001 //!< Structure of a table has changed 01013 #define DBCALLBACK_RecordAdded 0x0002 01014 #define DBCALLBACK_RecordChanged 0x0004 //!< Record has been changed 01015 #define DBCALLBACK_TableAdded 0x0008 01016 #define DBCALLBACK_TableDropping 0x0010 //!< About to drop table 01017 #define DBCALLBACK_TableDropped 0x0020 //!< Table is gone 01018 #define DBCALLBACK_DBListAdded 0x0040 //!< New dblist entry added 01019 #define DBCALLBACK_DBListChanged 0x0080 //!< DBList entry changed 01020 #define DBCALLBACK_PreRecordChange 0x0100 //!< Record about to change 01021 #define DBCALLBACK_RecordDeleted 0x0200 //!< Record has been deleted 01022 #define DBCALLBACK_PreRecordDelete 0x0400 //!< Record about to be deleted 01023 #define DBCALLBACK_TableValid 0x0800 //!< Table became valid or invalid 01024 #define DBCALLBACK_BulkModifyBegin 0x1000 //!< Something is about to modify the database a lot (may want to ignore callbacks for a while 01025 #define DBCALLBACK_BulkModifyEnd 0x2000 //!< Done with bulk modifications 01026 #define DBCALLBACK_All 0x3FFF //!< All callback types 01027 01028 #define DBCALLBACKSUB_Name 0x00000001 01029 #define DBCALLBACKSUB_Desc 0x00000002 01030 #define DBCALLBACKSUB_ViewMode 0x00000004 01031 #define DBCALLBACKSUB_Field 0x00000008 //!< Something in one or more fields changed 01032 #define DBCALLBACKSUB_FieldsAdded 0x00000010 01033 #define DBCALLBACKSUB_Flags 0x00000020 01034 #define DBCALLBACKSUB_AttachmentType 0x00000040 01035 #define DBCALLBACKSUB_Encoding 0x00000080 01036 #define DBCALLBACKSUB_DBEditorUpdate 0x00000100 01037 #define DBCALLBACKSUB_DBEditorRebuild 0x00000200 01038 01039 #define EDITREC_SaveMenu 0x0001 01040 #define EDITREC_DftView 0x0000 01041 #define EDITREC_DftEdit 0x0002 01042 #define EDITREC_OnlyView 0x0004 //!< Don't let user edit anything 01043 #define EDITREC_UseMouse 0x0008 //!< Return mouse event if there is one 01044 #define EDITREC_NewOK 0x0010 //!< Let user create new database 01045 #define EDITREC_IgnoreAtlas 0x0020 //!< Let user edit data even in TNTatlas (for sketch layers) 01046 01047 #define DBMODE_Interactive 0x0001 //!< Renumber these later 01048 #define DBMODE_Batch 0x0002 //!< Don't update index until end 01049 #define DBMODE_NoInternal 0x0004 //!< Ignore internal table 01050 #define DBMODE_DontForceCreate 0x0008 //!< Don't create if ReadLocked 01051 #define DBMODE_ValidateOnClose 0x0010 //!< Don't validate keys until close 01052 #define DBMODE_InfoSet 0x0020 //!< internal use only 01053 #define DBMODE_Overwrite 0x0040 //!< Delete external table if it already exists (MfMakeTable only) 01054 #define DBMODE_WriteLockAsNeeded 0x0080 //!< Don't write-lock the file until user tries to write 01055 #define DBMODE_IgnoreAtlas 0x0100 //!< Let user edit data even in TNTatlas (for sketch layers) 01056 01057 /* 01058 ** Table numbers for search functions (eg: MfGetAttachedRecordList()) 01059 ** Some day, we may combine databases, which would tables -2 to -4 01060 ** valid for other Internal tables 01061 */ 01062 #define TABLE_Internal -1 //!< The "Built-in" table 01063 #define TABLE_InternalNode -2 //!< Internal table number for vector nodes 01064 #define TABLE_New -9 //!< Pass to MfTableWritable to see if we can add tables 01065 #define TABLE_All -99 //!< All tables 01066 #define TABLE_Invalid -98 //!< Internal use only 01067 01068 //! Special record numbers 01069 #define RECORD_New -1 01070 01071 01072 //! Flags for MfGetAttachedRecordList() 01073 #define FIND_NoInternal 0x00000001 //!< Ignore "internal" table 01074 #define FIND_OnlyDirect 0x00000002 //!< Ignore related records 01075 #define FIND_FirstMatch 0x00000008 //!< Only need one match 01076 01077 //! Flags for MfSearchIndexExt() 01078 #define SEARCH_CheckExists 0x00000001 01079 #define SEARCH_ReturnRecordNumber 0x00000002 01080 #define SEARCH_ReturnIndexOffset 0x00000000 //!< Default 01081 #define SEARCH_ReturnInsertOffset 0x00000004 01082 #define SEARCH_StartsWith 0x00000080 //!< For string searches, matches if the string starts with the given value (ignored for non-string fields) 01083 01084 //! Used by MfGetSortedRecordList 01085 #define SEARCH_OnlyUnique 0x00000010 01086 #define SEARCH_MakeIndex 0x00000020 //!< Make index if you have to 01087 #define SEARCH_NoMakeIndex 0x00000040 //!< Skip index maint if none around 01088 01089 //! Flags for MfTableJoin() and MfTableJoinTest(), MfTableCombine() 01090 #define JOIN_CopyThemeTable 0x01000000 //!< Copy theme tables, only if not joining tables 01091 #define JOIN_OuterRight 0x02000000 //!< Right Outer (for Join) 01092 #define JOIN_Union 0x04000000 //!< Union (MfTableCombine only) 01093 #define JOIN_Natural 0x08000000 //!< Natural Join (MfTableCombine only)