home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / opendc12.zip / od124os2.exe / od12osr1.exe / src / LinkSpec.idl < prev    next >
Text File  |  1997-03-21  |  15KB  |  366 lines

  1. //#====START_GENERATED_PROLOG======================================
  2. //#
  3. //#
  4. //#   COMPONENT_NAME: oddataxfer
  5. //#
  6. //#   CLASSES: none
  7. //#
  8. //#   ORIGINS: 82,27,94
  9. //#
  10. //#
  11. //#   (C) COPYRIGHT International Business Machines Corp. 1995,1996
  12. //#   All Rights Reserved
  13. //#   Licensed Materials - Property of IBM
  14. //#   US Government Users Restricted Rights - Use, duplication or
  15. //#   disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  16. //#
  17. //#   IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  18. //#   ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  19. //#   PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  20. //#   CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
  21. //#   USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  22. //#   OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
  23. //#   OR PERFORMANCE OF THIS SOFTWARE.
  24. //#
  25. //#====END_GENERATED_PROLOG========================================
  26. //#
  27. // @(#) 1.16 com/src/storage/idl/LinkSpec.idl, oddataxfer, od96os2, odos29712d 8/2/96 09:04:49 [ 3/21/97 17:20:09 ]
  28. #ifdef __PRIVATE__
  29. //#
  30. //#     File:           LinkSpec.idl
  31. //#
  32. //#     Contains:       Class definition for ODLinkSpec
  33. //#
  34. //#     Owned by:       Craig Carper
  35. //#
  36. //#     Copyright:      (r) 1993 - 1995 by Apple Computer, Inc., all rights reserved.
  37. //#
  38. //#     Change History (most recent first):
  39. //#
  40. //#             <11>     8/15/95        CC              1275241: IDL review.
  41. //#             <10>      8/3/95        RR              #1257260: Collapse B classes. Remove
  42. //#                                                                     somInit methods. Don't call IsInitialized
  43. //#                                                                     or SubclassResponsibility
  44. //#              <9>     7/14/95        TJ              Made Some TypeDefs into Structs so SOM Slim
  45. //#                                                                     can get there correct Sizes.
  46. //#              <8>      4/5/95        CSL             #1221461: Fix number of reserved methods
  47. //#              <7>     3/10/95        CC              1225926: Override FromThisDraft().
  48. //#              <6>     1/27/95        TJ              Removed interface ODAppleEvent. Changed
  49. //#                                                                     ODAppleEvent to AppleEvent in WriteTo and
  50. //#                                                                     changed ODAppleEvent to AppleEvent* in
  51. //#                                                                     ReadFrom.
  52. //#              <5>     1/27/95        VL              Added interface ODAppleEvent.
  53. //#              <4>    12/15/94        CC              1205709 LinkSpec.idl - Removed GetPart(), ,
  54. //#                                                                     GetData(), and GetDataSize() methods.
  55. //#              <3>     7/27/94        CC              Removed GetProcessLaunchDate, added
  56. //#                                                                     FromThisDraft, changed GetProcessID to
  57. //#                                                                     GetOriginatingProcessID.
  58. //#              <2>     6/21/94        CC              Added functionprefix.
  59. //#              <1>      6/8/94        CG              first checked in
  60. //#              <6>      6/8/94        CC              Change AppleEvent to ODAppleEvent.
  61. //#              <5>      6/7/94        RR              Privatise change log
  62. //#
  63. //#     To Do:
  64. //#
  65. #else
  66. //#     Copyright:      (r) 1993 - 1995 by Apple Computer, Inc., all rights reserved.
  67. #endif
  68.  
  69. #ifndef _LINKSPEC_
  70. #define _LINKSPEC_
  71.  
  72. #ifndef _LINKSPCB_
  73. #include "LinkSpcB.idl"
  74. #endif
  75.  
  76. #ifdef _PLATFORM_OS2_
  77. #ifndef _IODDEFS_
  78. #include <IODDefs.idl>
  79. #endif
  80. #endif
  81.  
  82. //==============================================================================
  83. // Classes defined in this interface
  84. //==============================================================================
  85.  
  86. #ifdef _PLATFORM_OS2_
  87. #ifdef __PRIVATE__
  88. interface IODLinkRegistry;
  89. interface IODLinkService;
  90. interface IODLinkTargetToLinkSource;
  91. interface IODLinkTarget;
  92. #endif
  93. #endif // _PLATFORM_OS2_
  94.  
  95. interface  ODLinkSpec;
  96.  
  97. //==============================================================================
  98. // Classes used by this interface
  99. //==============================================================================
  100.  
  101. interface  ODStorageUnit;
  102. interface  ODDraft;
  103. interface  ODPart;
  104.  
  105. #ifdef __PRIVATE__
  106.  
  107. //==============================================================================
  108. // Implementation Types
  109. //==============================================================================
  110.  
  111. struct ProcessSerialNumber {
  112.         ODULong hi;
  113.         ODULong lo;
  114. };
  115. typedef somToken AppleEvent;
  116.  
  117. #ifdef _PLATFORM_WIN32_
  118. typedef somToken LPVOID;
  119. typedef somToken FILETIME;
  120. #endif //# _PLATFORM_WIN32_
  121.  
  122. #endif //# __PRIVATE__
  123.  
  124. //==============================================================================
  125. // ODLinkSpec
  126. //==============================================================================
  127.  
  128. interface ODLinkSpec :  ODBaseLinkSpec
  129. {
  130. #ifdef __PRIVATE__
  131. #ifndef _PLATFORM_OS2_
  132.         void InitLinkSpec(in ODPart part, in ODByteArray partData);
  133. #endif // _PLATFORM_OS2_
  134.         void GetOriginatingProcessID(out ProcessSerialNumber psn);
  135.  
  136. #ifdef _PLATFORM_MACINTOSH_
  137.  
  138.         void WriteToAppleEvent(in AppleEvent* theAppleEvent);
  139.  
  140.         void ReadFromAppleEvent(in AppleEvent* theAppleEvent);
  141.  
  142. #endif //# _PLATFORM_MACINTOSH_
  143.  
  144. #ifdef _PLATFORM_OS2_
  145.  
  146.     enum Value {PERSISTENT_LINKSPEC_VALUE,
  147.                 TRANSIENT_LINKSPEC_VALUE};
  148.   // State machine for use by ODL:
  149.   // A transient Linkspec (ODLinkSpec) will use states {U, TI, P, T}
  150.   // A persistent Linkspec (IODPersistentLinkSpec) will use states {U, PI, P}
  151.     enum State {UNINIT,         // U state -- just after new or
  152.                                 //         ReleaseAll
  153.                 TRANSIENT_INIT, // TI state -- just after CreateLinkSpec
  154.                                 //         A part SUID exists.
  155.                                 //         Can either Write, in which case
  156.                                 //         part SUID is assumed to be a source;
  157.                                 //         or Read, in which case the data
  158.                                 //         read defines source part, and
  159.                                 //         part SUID is assumed to be target
  160.                                 //         Not used by PersistentLinkSpec
  161.                 PERSISTENT_INIT,// PI state -- just after CreatePersistentLinkSpec(null, ...)
  162.                                 //         PI state is just like TI state except
  163.                                 //         that if a source Part does a Write,
  164.                                 //         the PersistentLinkSpec is first converted
  165.                                 //         into a PERSISTENTLINKABLE spec by
  166.                                 //         calling Draft::GetRegistryAndLinkIDFromTSpec
  167.                                 //         Not used by Transient LinkSpec
  168.                 TRANSIENTLINKABLE, // T state-- just after reading transient
  169.                                    //          value from a SU (not used
  170.                                    //          by PersistentLinkSpec; these
  171.                                    //          LinkSpecs always convert
  172.                                    //          transient values to persistent
  173.                                    //          when reading them in)
  174.                 PERSISTENTLINKABLE // P state-- just after reading persistent
  175.                                    //          value from a SU
  176.                                    //          (or, for persistent LSpec,
  177.                                    //          after creation by draft when
  178.                                    //          a LinkSource was provided)
  179.                };
  180.       // Can issue Write from states PI, TI, T, P
  181.       // Can issue Draft::GetLink from states T, P
  182.       // Can issue Read from any state except U
  183.       //     Transient Linkspecs will read transient value and go to T
  184.       //                                or persistent value and go to P
  185.       //     If state is T or P, old value will be thrown away first
  186.       //     Persistent Linkspecs will read transient value and convert, go to P
  187.       //                                or persistent value and go to P
  188.       //     If already was in P, first throw away old value, go back to PI
  189.  
  190.     void EstablishLink (in IODLinkTarget linkTrgt,
  191.                         in  ODULong pid,
  192.                         in  ODLinkConnectionData trgtPartDesc,
  193.                         in  IODLinkService trgtLinkService,
  194.                         out ODStorageUnitID trgtPartSUID,
  195.                         out ODLinkID linkID,
  196.                         out IODLinkTargetToLinkSource linkSrc,  /* should be IODVirtualLinkSource */
  197.                         out ODLinkConnectionID trgtID,
  198.                         out ODBoolean isLocal,
  199.                         out ODBoolean trackTrgt,
  200.                         out ODISOStr asName);
  201.       // Called in LinkTarget::EstablishLink to establish a new link with the
  202.       //   source part.
  203.       // If aState is TRANSIENTLINKABLE, it internalizes fSourceLinkService and
  204.       //   invokes its EstablishLinkFromTSpec method.
  205.       // If aState is PERSISTENTLINKABLE, it internalizes aLinkRegistry and
  206.       //   queries the LinkRegistry for the reference of the LinkSource to
  207.       //   invokes its AddTarget method.
  208.  
  209.  
  210.     void InitLinkSpec (in IODDSOMExternalizedID linkService,
  211.                        in ODPart part,
  212.                        in ODByteArray data);
  213.       // Called in Draft::CreateLinkSpec to initialize the LinkSpec after it
  214.       //   is created.
  215.       // If caller is the draft of a source part, it must provide the
  216.       //   linkService and source partSUID for call back to establish a link.
  217.       // If caller is the draft of a target part, it only needs to provide
  218.       //   the target partSUID for the LinkSpec to query the part attributes.
  219.      // In either case the TI state will be entered.
  220.      //
  221.     void VoidLinkSpec ();
  222.       // Called to void this LinkSpec.
  223.  
  224.     void ConvertToPersistent();
  225.       // Called to convert a Transient Linkspec to a Persistent one
  226.  
  227.     void GetLinkSourceConnectionData (out ODLinkConnectionData* srcConnData);
  228.       // Called by the draft to retrieve the description of the source content
  229.  
  230. #endif
  231.  
  232. #ifdef _PLATFORM_WIN32_
  233.  
  234.         void UseItemName( in char *pszItemName );
  235.  
  236.         char *WriteLinkSpecString();
  237.  
  238.         void ReadLinkSpecString( in char *pHexDigit );
  239.  
  240.         void *GetMoniker();
  241.  
  242.         void VoidLinkSpec();
  243.  
  244. #endif //# _PLATFORM_WIN32_
  245.  
  246. #endif //# __PRIVATE__
  247.  
  248. #ifdef __SOMIDL__
  249. #if defined(_PLATFORM_MACINTOSH_) || defined(_PLATFORM_WIN32_) || defined(_PLATFORM_OS2_) || defined(_PLATFORM_AIX_)
  250. implementation
  251. {
  252.         majorversion = 1; minorversion = 0;
  253.  
  254.         functionprefix = ODLinkSpec;
  255.  
  256.         override:
  257.                 somUninit,
  258.         #ifdef _PLATFORM_WIN32_
  259.                 somInit,
  260.         #endif
  261.         #ifdef _PLATFORM_OS2_
  262.                 somInit,
  263.         #endif
  264.         #ifdef __PRIVATE__
  265.            #ifdef _PLATFORM_WIN32_
  266.                 GetPart,
  267.                 GetPartData,
  268.            #endif
  269.                 FromThisDraft,
  270.         #endif
  271.                 ReadLinkSpec,
  272.                 WriteLinkSpec;
  273.  
  274.         releaseorder:
  275.                 #ifdef __PRIVATE__
  276.                         InitLinkSpec,
  277.                         GetOriginatingProcessID,
  278.                   #ifdef _PLATFORM_MACINTOSH_
  279.                         WriteToAppleEvent,
  280.                         ReadFromAppleEvent,
  281.                         reservedA,
  282.                         reservedB,
  283.                         reservedC;
  284.                   #endif //# _PLATFORM_MACINTOSH_
  285.                   #ifdef _PLATFORM_OS2_
  286.                         EstablishLink,
  287.                         VoidLinkSpec,
  288.                         ConvertToPersistent,
  289.                         GetLinkSourceConnectionData,
  290.                         ReservedA;
  291.                   #endif //# _PLATFORM_OS2_
  292.                   #ifdef _PLATFORM_WIN32_
  293.                         UseItemName,
  294.                         WriteLinkSpecString,
  295.                         ReadLinkSpecString,
  296.                         GetMoniker,
  297.                         VoidLinkSpec;
  298.                   #endif //# _PLATFORM_WIN32_
  299.                   #ifdef _PLATFORM_AIX_
  300.                         reservedA,
  301.                         reservedB,
  302.                         reservedC,
  303.                         reservedD,
  304.                         reservedE;
  305.                   #endif //# _PLATFORM_AIX_
  306.                 #else
  307.                         reserved1,
  308.                         reserved2,
  309.                         reserved3,
  310.                         reserved4,
  311.                         reserved5,
  312.                         reserved6,
  313.                         reserved7;
  314.                 #endif
  315.  
  316.         #ifdef __PRIVATE__
  317.                 passthru C_xh =
  318.                         ""
  319.                         "#ifdef _PLATFORM_MACINTOSH_"
  320.                         "#ifndef __PROCESSES__"
  321.                         "#include <Processes.h>"
  322.                         "#endif"
  323.                         ""
  324.                         "#ifndef __APPLEEVENTS__"
  325.                         "#include <AppleEvents.h>"
  326.                         "#endif"
  327.                         "#endif"
  328.                         "";
  329.                 passthru C_xh_after =
  330.                         ""
  331.                         "#ifdef _PLATFORM_OS2_"
  332.                         "#include <ioddefs.xh>"
  333.                         "#endif"
  334.                         "";
  335.                 ProcessSerialNumber fProcessID;
  336.           #ifdef _PLATFORM_WIN32_
  337.                 FILETIME                                fProcessLaunchDate;
  338.           #else
  339.                 ODULong                         fProcessLaunchDate;
  340.           #endif // _PLATFORM_WIN32_
  341.           #ifdef _PLATFORM_WIN32_
  342.                 ODPart                          fPart;
  343.                 ODByteArray                     fPartData;
  344.                 LPVOID                          fpmkFull;
  345.           #endif //# _PLATFORM_WIN32_
  346.           #ifdef _PLATFORM_OS2_
  347.                 ODByteArray           fData;              // Set at TI/PI/T states
  348.                 IODDSOMExternalizedID fSourceLinkService; // Set at TI/PI/T states
  349.                 ODStorageUnitID       fTargetPartSUID;    // Set at T,P states
  350.                 ODStorageUnitID       fSourcePartSUID;    // Set at TI/PI/T states
  351.                 ODLinkID              fLinkID;            // Set at P state
  352.                 ODISOStr              fASName;            // Set at P state
  353.                 ODULong               fVersion;           // Value is kODOS2
  354.                 State                 fState;             // Current state
  355.  
  356.           #endif //# _PLATFORM_OS2_
  357.         #endif //# __PRIVATE__
  358.  
  359. };
  360. #endif //# _PLATFORM_MACINTOSH_
  361. #endif //# __SOMIDL__
  362. };
  363.  
  364. #endif //# _LINKSPEC_
  365.  
  366.