home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / odtlktv4.zip / ODTLKT / TOOLKIT / IDL / ODTYPESM.IDL < prev    next >
Text File  |  1995-12-13  |  15KB  |  536 lines

  1. /********************************************************************/
  2. /*  Licensed Materials - Property of IBM                            */
  3. /*                                                                  */
  4. /*                                                                  */
  5. /* Copyright (C) International Business Machines Corp., 1994.       */
  6. /* Copyright (C) Apple Computer, Inc., 1994                         */
  7. /*                                                                  */
  8. /*  US Government Users Restricted Rights -                         */
  9. /*  Use, duplication, or disclosure restricted                      */
  10. /*  by GSA ADP Schedule Contract with IBM Corp.                     */
  11. /*                                                                  */
  12. /*                                                                  */
  13. /********************************************************************/
  14.  
  15. #ifndef _ODTYPESM_
  16. #define _ODTYPESM_
  17.  
  18. #ifndef _PLATFORM_OS2_
  19. #define _PLATFORM_MACINTOSH_
  20. #endif
  21.  
  22. // Platform-specific types. Four byte types are defined as unsigned long,
  23. // rather than
  24. // foreign, so that they can be marshalled. They are not emitted however,
  25. // so that the actual type definitions in ODTypesF.h are used, so that type
  26. // casting is not necessary where these types are used.
  27.  
  28. typedef unsigned long ODPlatformShape;      // Graphics-system-dependent shape data
  29. typedef unsigned long ODPlatformTransform;  // Graphics-system-dependent transform data
  30. typedef unsigned long ODRgnHandle;
  31. typedef unsigned long ODgxShape;
  32. typedef unsigned long ODPlatformWindow;
  33. typedef unsigned long ODPlatformMenu;
  34. typedef unsigned long ODPlatformMenuBar;
  35. typedef unsigned long ODOSType;
  36. typedef unsigned long ODPlatformType;      // Host platform file & data type
  37. typedef unsigned long ODHandle;
  38. typedef unsigned long ODPlatformDragReference;
  39. #ifdef _PLATFORM_OS2_
  40. typedef unsigned long ODPlatformPrintJob;  // ced [119447]
  41. #endif
  42.  
  43. #ifndef _PLATFORM_OS2_
  44. struct Point {    // This is a QuickDraw "Point" structure.
  45.   short v;      // It's 32 bits, but still a struct, and for things to work
  46.   short h;      // at runtime, SOM has to _know_ that it's really a struct.
  47. };            // ("Don't fool SOM!" --Erik Eidt)               --jpa
  48.  
  49. struct Rect {    // This is a QuickDraw "Rect" structure.
  50.   short top;
  51.   short left;
  52.   short bottom;
  53.   short right;
  54. };
  55. #else
  56. typedef unsigned long HPS;
  57. typedef unsigned long HWND;
  58. typedef unsigned long HACCEL;
  59. typedef unsigned long MRESULT;
  60. typedef unsigned long MPARAM;
  61. typedef unsigned long ULONG;
  62. struct OS2POINTL {
  63.   long x;
  64.   long y;
  65. };
  66. typedef OS2POINTL POINTL;
  67. struct OS2RECTL {
  68.   long  xLeft;
  69.   long  yBottom;
  70.   long  xRight;
  71.   long  yTop;
  72. };
  73. typedef OS2RECTL RECTL;
  74.  
  75. struct ACCEL{
  76.   unsigned short fs;
  77.   unsigned short key;
  78.   unsigned short cmd;
  79. };
  80.  
  81. #define ACCELMAX 20
  82. struct ODACCEL{
  83.   ACCEL aAccel[ACCELMAX];
  84. };
  85. #endif
  86.  
  87. typedef unsigned long  DescType;
  88. typedef unsigned long  AEEventClass;
  89. typedef unsigned long  AEEventID;
  90. typedef long      AESendMode;
  91. typedef short      AESendPriority;
  92.  
  93. #ifndef _PLATFORM_OS2_
  94. struct EventRecord {
  95.   short            what;
  96.   long            message;
  97.   long            when;
  98.   Point            where;
  99.   short            modifiers;
  100. };
  101. #endif
  102.  
  103. // End of platform types
  104.  
  105. #ifndef _ODTYPESB_
  106. #include "ODTypesB.idl"
  107. #endif
  108.  
  109. #ifndef _GEOTYPES_
  110. #include "GeoTypes.idl"
  111. #endif
  112.  
  113. #if defined(__SOMIDL__) && defined(EMIT_GLOBAL_TYPES)
  114. #pragma somemittypes on
  115. #endif
  116.  
  117. #if defined(_PLATFORM_MACINTOSH_) || defined(_PLATFORM_OS2_)
  118.  
  119. #ifndef _PLATFORM_OS2_   // should be deleted after clean build - REH  ----------------------------------------------
  120.  
  121.   #ifdef __SOMIDL__
  122.     typedef void* ODForeign;
  123.   #else
  124.     typedef unsigned long ODForeign;
  125.   #endif /* __SOMIDL__ */
  126.  
  127.   interface ODObjectSpec;            // CED 03/17/95
  128.  
  129.    typedef ODForeign ODOSLToken;
  130.    #pragma modifier ODOSLToken: impctx = OPENDOC;
  131.  
  132. #endif   //--------------------------------------------------------------------------------------------------------
  133.  
  134. typedef DescType  ODDescType;
  135.  
  136. #ifndef _PLATFORM_OS2_  // should be deleted after clean build - REH    --------------------------------------------
  137.  
  138.   struct ODDesc
  139.   {
  140.     ODDescType  descriptorType;
  141.     ODHandle  dataHandle;
  142.   };
  143.  
  144.   //typedef ODDesc    ODObjectSpec;
  145.  
  146.   typedef ODDesc    ODAddressDesc;
  147.  
  148.   typedef ODDesc    ODDescList;
  149.  
  150.   typedef ODDescList  ODRecord;
  151.  
  152.   typedef  ODRecord  ODOSAEvent;
  153. #endif   //--------------------------------------------------------------------------------------------------------
  154.  
  155. typedef AESendMode    ODSendMode;
  156. typedef AESendPriority  ODSendPriority;
  157.  
  158. typedef  AEEventClass  ODEventClass;
  159. typedef  AEEventID    ODEventID;
  160.  
  161. // Types added for OSAObject support
  162.  
  163. typedef ODULong  ODScriptingSubType;
  164. typedef ODULong  ODScriptingConnection;
  165. typedef ODULong  ODOSAID;
  166.  
  167. // OS specific types
  168. //
  169. //  The following typedefs are OS specific. They are put together in this file for the
  170. //  time being. However, they can be put into separate files if desired. For example,
  171. //  all the primitive types will be put in ODPlatformMisc.h;
  172. //  all graphics system types will be put in ODPlatformGraphics.h;
  173. //  all File system types will be put in ODPlatformFiles.h; and so on.
  174. //  The advantage of splitting them in separate files is the changing one type will not
  175. //  require recompiling all the files which includea ODTypes.h. Also, there may be a lot
  176. //  of OS-specific types. If that's the case, we don't want them all in one file.
  177. //
  178.  
  179. // Text
  180.  
  181. typedef long ODITextFormat;
  182.  
  183. struct ODIText {
  184.   ODITextFormat  format;
  185.   ODByteArray    text;
  186. };
  187.  
  188. typedef ODIText ODName;
  189. typedef ODName  ODContainerName;
  190. typedef ODName  ODDocumentName;
  191.  
  192. // Imaging
  193.  
  194. typedef ODHandle  ODIconFamily;
  195.  
  196. // Events
  197.  
  198. typedef ODUShort     ODEventType;
  199.  
  200. #ifndef _PLATFORM_OS2_
  201. typedef EventRecord  ODEventData;
  202. #else
  203. struct ODEventData {
  204.   HWND            hwnd;
  205.   ULONG           msg;
  206.   MPARAM          mp1;
  207.   MPARAM          mp2;
  208.   MRESULT         result;
  209. };
  210. #endif
  211.  
  212. interface ODFrame;
  213. interface ODFacet;
  214. #ifdef _PLATFORM_OS2_
  215. interface ODPlatformCanvas;
  216. #endif
  217.  
  218. struct ODEventInfo
  219. {
  220.   ODFrame embeddedFrame;
  221.   ODFacet embeddedFacet;
  222.   ODPoint where;
  223. #ifdef _PLATFORM_OS2_
  224.   ODULong flags;
  225. #else
  226.   ODBoolean propagated;
  227. #endif
  228. };
  229.  
  230. #ifdef _PLATFORM_OS2_
  231.  
  232. // opendoc messages
  233. const ODULong OD_PRINT =  0x00000491;
  234. const ODULong OD_HELP =   0x00000492;
  235. // opendoc document shell menu.
  236. const ODSLong HLPM_ODMENU = -4;
  237.  
  238. // Event info flags
  239.  
  240. const ODULong kODPropagated = 1;
  241. const ODULong kODInBorder   = 2;
  242. const ODULong kODInEmbedded = 3;
  243. #endif
  244.  
  245. typedef ODULong      ODIdleFrequency;
  246.  
  247. //typedef ODULong      ODTimerFrequency;
  248.  
  249. typedef ODULong      ODTime;
  250.  
  251. // Menus
  252.  
  253. typedef ODSShort    ODMenuID;
  254. typedef ODSShort    ODMenuItemID;
  255. typedef ODSLong    ODCommandID;
  256. #ifdef _PLATFORM_OS2_
  257. struct ODPlatformMenuItem {
  258.    short  iPosition;
  259.    unsigned short  afStyle;
  260.    unsigned short  afAttribute;
  261.    unsigned short  id;
  262.    unsigned long  hwndSubMenu;
  263.    unsigned long  hItem;
  264. };
  265. //typedef struct ODPlatformMenuItem ODPlatformMenuItem ;
  266. #endif
  267.  
  268. // @SESH [142206]
  269. //==============================================================================
  270. // Structures defined for OLE menu manipulation
  271. //==============================================================================
  272. struct NewSubMenu{
  273.    ODUShort  Position;
  274.    ODUShort  MenuId;
  275.    char      SubMenuString[40];
  276.    char      hasSubMenu; // A flag used to find if this sub menu has a cascade menu
  277. };
  278.  
  279. struct NewMenu{
  280.    ODUShort  Position;
  281.    ODUShort  MenuId;
  282.    char      MenuString[40];
  283.    short     nSubMenuCount;    // no. of items for this menu item on the menu bar
  284.    NewSubMenu newsubmenu[20];  // structure contains position and sub menu string
  285. };
  286.  
  287. // Name Binding
  288.  
  289. typedef ODISOStr ODEditor;    // An opaque type identifying a specific part editor
  290.  
  291. typedef ODISOStr ODContainerSuite;  // An opaque type identifying a specific container suite
  292.  
  293. typedef ODULong ODUpdateID;      // Content change IDs
  294.  
  295. typedef ODULong  ODDraftKey;
  296.  
  297. // Drag and Drop
  298.  
  299. #ifndef _PLATFORM_OS2_
  300. typedef ODBoolean ODDragResult;
  301. #else
  302. typedef MRESULT ODDragResult;
  303. #endif
  304.  
  305. const ODType kODDragImageRegionHandle       = "+//ISO 9070/ANSI::113722::US::CI LABS::OpenDoc::DragImage:RegionHandle";
  306. const ODValueType      kODHFSPromise     = "+//ISO 9070/ANSI::113722::US::CI LABS::OpenDoc::Type:HFSPromise";
  307.  
  308. // Link Protocol
  309.  
  310. #ifdef _PLATFORM_OS2_
  311. typedef ODIText  ODLinkDescription;
  312.  
  313. struct ODLinkConnectionData {
  314.   ODLinkDescription LinkDesc;
  315.   ODIText DocumentName;
  316.   ODIText HostName;
  317. };
  318. #endif
  319.  
  320. typedef ODULong ODPasteAsMergeSetting;
  321.  
  322. const ODPasteAsMergeSetting kODPasteAsMerge = 1;
  323. const ODPasteAsMergeSetting kODPasteAsEmbed = 3;
  324. const ODPasteAsMergeSetting kODPasteAsMergeOnly = 0;
  325. const ODPasteAsMergeSetting kODPasteAsEmbedOnly = 2;
  326.  
  327. struct ODLinkInfo
  328. {
  329.   ODType      kind;
  330.   ODTime      creationTime;
  331.   ODTime      changeTime;
  332.   ODUpdateID    change;
  333.   ODBoolean    autoUpdate;
  334. };
  335.  
  336. // Link Dialogs
  337. #ifdef _PLATFORM_MACINTOSH_
  338. struct ODPasteAsResult
  339. {
  340.   ODBoolean    pasteLinkSetting;
  341.   ODBoolean    autoUpdateSetting;
  342.   ODBoolean    mergeSetting;
  343.   ODTypeToken  selectedView;
  344.   ODType       selectedKind;
  345.   ODType       translateKind;
  346.   ODEditor     editor;
  347. };
  348. #endif
  349.  
  350. #ifdef _PLATFORM_OS2_
  351. struct ODPasteAsResult
  352. {
  353.   ODBoolean    pasteLinkSetting;
  354.   ODLinkDescription linkdescription;
  355.   ODBoolean    autoUpdateSetting;
  356.   ODBoolean    mergeSetting;
  357.   ODTypeToken  selectedView;
  358.   ODType       selectedKind;
  359.   ODType       translateKind;
  360.   ODEditor     editor;
  361. };
  362. #endif
  363.  
  364. enum ODLinkInfoAction
  365. {
  366.   kODLinkInfoCancel,
  367.   kODLinkInfoOk,
  368.   kODLinkInfoBreakLink,
  369.   kODLinkInfoUpdateNow,
  370.   kODLinkInfoFindSource
  371. };
  372.  
  373. struct ODLinkInfoResult
  374. {
  375.   ODLinkInfoAction  action;
  376.   ODBoolean      autoUpdate;
  377. };
  378.  
  379. #ifdef _PLATFORM_OS2_
  380. // Link Service Dialogs
  381. struct ODMoveCopyResult
  382. {
  383.   char*          fOldDocPathName;
  384.   char*          fNewDocPathName;
  385.   ODBoolean      FileMoved;
  386.   ODBoolean      FileCopied;
  387. };
  388. #endif
  389.  
  390. //==============================================================================
  391. // Constants
  392. //==============================================================================
  393.  
  394. const  ODBoolean  kODFalse = 0;
  395. const  ODBoolean  kODTrue = 1;
  396.  
  397. const  ODMenuID  kODAppleMenuID  = 128;
  398. const  ODMenuID  kODDocumentMenuID  = 129;
  399. const  ODMenuID  kODEditMenuID  = 130;
  400. const  ODMenuID  kODOCEFileMenuID  = 193;
  401. const  ODMenuID  kODOCEMailerMenuID  = 194;
  402. const  ODOSType  kODDASMenuRsrc  = 0x44525652; // 'DRVR';
  403.  
  404. const  ODGraphicsSystem  kODQuickDraw  = 1; // Macintosh QuickDraw graphics system
  405. const  ODGraphicsSystem kODQuickDrawGX  = 2; // Macintosh QuickDraw GX graphics system
  406.  
  407. #ifdef _PLATFORM_OS2_
  408. const  ODGraphicsSystem kODGPI          = 3; // OS/2 GPI graphics @F1
  409. #endif
  410.  
  411. const  ODEditor  kODNoEditor = kODNULL;
  412.  
  413. const  ODUpdateID  kODUnknownUpdate = 0;
  414.  
  415. #ifndef _PLATFORM_OS2_
  416. const  ODSShort  kODEvtNull       = 0; // Té: 0-15 copied from Macintosh: <Events.h>
  417. const  ODSShort  kODEvtMouseDown    = 1;
  418. const  ODSShort  kODEvtMouseUp    = 2;
  419. const  ODSShort  kODEvtKeyDown    = 3;
  420. const  ODSShort  kODEvtKeyUp      = 4;
  421. const  ODSShort  kODEvtAutoKey    = 5;
  422. const  ODSShort  kODEvtUpdate    = 6;
  423. const  ODSShort  kODEvtDisk      = 7;
  424. const  ODSShort  kODEvtActivate    = 8;
  425. const  ODSShort  kODEvtOS      = 15;
  426.  
  427. const  ODSShort  kODEvtMenu      = 98;
  428. const  ODSShort  kODEvtMouseDownEmbedded = 99;
  429.                     // A mouse-down in an embedded frame, or the active border
  430.                     // Sent to the container
  431. const  ODSShort  kODEvtMouseUpEmbedded = 100;
  432.                     // A mouse-up in an embedded frame, or the active border
  433.                     // Sent to the container
  434. const  ODSShort  kODEvtMouseDownBorder = 101;
  435.                     // A mouse-down in an embedded frame, or the active border
  436.                     // Sent to the container
  437. const  ODSShort  kODEvtMouseUpBorder  = 102;
  438.                     // A mouse-up in an embedded frame, or the active border
  439.                     // Sent to the container
  440. const  ODSShort  kODEvtWindow     = 103;
  441.                     // Used to offer events in title bar to root part
  442. const  ODSShort  kODEvtMouseEnter   = 104;
  443. const  ODSShort  kODEvtMouseWithin   = 105;
  444. const  ODSShort  kODEvtMouseLeave   = 106;
  445.  
  446. #endif
  447.  
  448. const  ODSShort  kODMDInDesk      = 0; // Té: 0-8 copied from Macintosh: <Windows.h>
  449. const  ODSShort  kODMDInMenuBar    = 1;
  450. const  ODSShort  kODMDInSysWindow  = 2;
  451. const  ODSShort  kODMDInContent    = 3;
  452. const  ODSShort  kODMDInDrag      = 4;
  453. const  ODSShort  kODMDInGrow      = 5;
  454. const  ODSShort  kODMDInGoAway    = 6;
  455. const  ODSShort  kODMDInZoomIn    = 7;
  456. const  ODSShort  kODMDInZoomOut    = 8;
  457.  
  458. #ifdef _PLATFORM_OS2_
  459. //==============================================================================
  460. // Registration types                           KLS: 8/11/94
  461. //==============================================================================
  462.  
  463. enum OperatingSystem
  464. {
  465.   OS2,
  466.   AIX,
  467.   MAC,
  468.   WINDOWS
  469. };
  470.  
  471. typedef string ISOString;
  472.  
  473. struct PartKindInfo
  474. {
  475.   ISOString partKindName;
  476.   string    partKindDisplayName;
  477.   string    filenameFilters;
  478.   string    filenameTypes;
  479.   string    categories;
  480.   string    categoryDisplayName;
  481.   string    objectID;
  482. };
  483.  
  484. //==============================================================================
  485. // Registration types - END                     KLS: 8/11/94
  486. //==============================================================================
  487. #endif
  488.  
  489. #ifdef _PLATFORM_OS2_
  490. //==============================================================================
  491. // Component Manager types and constants        AHT: 4/24/95
  492. //==============================================================================
  493. typedef unsigned long OSType;
  494.  
  495. const   ODULong CMGR_MAX_STRING    = 256;
  496.  
  497. typedef char CMGRString[CMGR_MAX_STRING];
  498.  
  499. struct ComponentDescription {
  500.         OSType  componentType;
  501.         OSType  componentSubType;
  502.         OSType  componentManufacturer;
  503.         ODULong componentFlags;
  504.         ODULong componentFlagsMask;
  505. };
  506.  
  507. struct ComponentRegistryData {
  508.         OSType        componentType;
  509.         OSType        componentSubType;
  510.         OSType        componentManufacturer;
  511.         ODULong       componentFlags;
  512.         ODULong       componentVersion;
  513.         CMGRString    componentDLL;           // dll name string
  514.         CMGRString    componentClassName;     // som class name
  515.         CMGRString    componentName;          // name string
  516.         CMGRString    componentInfo;          // info string
  517. };
  518.  
  519. //==============================================================================
  520. // Component Manager types - END                AHT: 4/24/95
  521. //==============================================================================
  522. #endif
  523.  
  524. #if defined(__SOMIDL__) && defined(EMIT_GLOBAL_TYPES)
  525. #pragma somemittypes off
  526. #endif
  527.  
  528. #endif // _PLATFORM_MACINTOSH_
  529.  
  530. module OpenDoc_Global_Types
  531. {
  532.   const string OpenDoc_Types_Version = "1.0.";
  533. };
  534.  
  535. #endif  // _ODTYPESM
  536.