home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / odtlktv4.zip / ODTLKT / TOOLKIT / IDL / PART.IDL < prev    next >
Text File  |  1995-12-13  |  13KB  |  415 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.  
  16. #ifndef _PART_
  17. #define _PART_
  18.  
  19. #ifndef _PSTOBJ_
  20. #include "PstObj.idl"
  21. #endif
  22.  
  23. //==============================================================================
  24. // Classes defined in this interface
  25. //==============================================================================
  26.  
  27. interface ODPart;
  28.  
  29. //==============================================================================
  30. // Classes used by this interface
  31. //==============================================================================
  32.  
  33. interface ODCanvas;
  34. interface ODDragItemIterator;
  35. interface ODEmbeddedFramesIterator;
  36. interface ODFacet;
  37. interface ODFrame;
  38. interface ODLink;
  39. interface ODLinkSource;
  40. #ifdef _PLATFORM_OS2_
  41. interface  ODMenuBar;
  42. #endif
  43. interface ODObjectSpec;
  44. interface ODShape;
  45. interface ODStorageUnit;
  46. interface ODStorageUnitView;
  47. interface ODTypeList;
  48.  
  49. //==============================================================================
  50. // ODPart
  51. //==============================================================================
  52.  
  53. interface ODPart : ODPersistentObject
  54. {
  55.  
  56.   //==========================================================================
  57.   // Required Protocols
  58.   //==========================================================================
  59.  
  60.   //--------------------------------------------------------------------------
  61.   // Initialization
  62.   //--------------------------------------------------------------------------
  63.  
  64.   void InitPart(in ODStorageUnit storageUnit,
  65.           in ODPart partWrapper);
  66.  
  67.   void InitPartFromStorage(in ODStorageUnit storageUnit,
  68.                in ODPart partWrapper);
  69.  
  70.   //--------------------------------------------------------------------------
  71.   // From Layout protocol
  72.   //--------------------------------------------------------------------------
  73.  
  74.   void DisplayFrameAdded(in ODFrame frame);
  75.  
  76.   void DisplayFrameRemoved(in ODFrame frame);
  77.  
  78.   void DisplayFrameConnected(in ODFrame frame);
  79.  
  80.   void DisplayFrameClosed(in ODFrame frame);
  81.  
  82.   void AttachSourceFrame(in ODFrame frame,
  83.                in ODFrame sourceFrame);
  84.  
  85.   void FrameShapeChanged(in ODFrame frame);
  86.  
  87.   void ViewTypeChanged(in ODFrame frame);
  88.  
  89.   void PresentationChanged(in ODFrame frame);
  90.  
  91.   void SequenceChanged(in ODFrame frame);
  92.  
  93.   void LinkStatusChanged(in ODFrame frame);
  94.  
  95.   void ContainingPartPropertiesUpdated(in ODFrame frame,
  96.                      in ODStorageUnit propertyUnit);
  97.  
  98.   ODInfoType ReadPartInfo(in ODFrame frame,
  99.               in ODStorageUnitView storageUnitView);
  100.  
  101.   void WritePartInfo(in ODInfoType partInfo,
  102.              in ODStorageUnitView storageUnitView);
  103.  
  104.   void ClonePartInfo(in ODDraftKey key,
  105.              in ODInfoType partInfo,
  106.              in ODStorageUnitView storageUnitView,
  107.              in ODFrame scope);
  108.  
  109.   ODID Open(in ODFrame frame);
  110.  
  111.   //--------------------------------------------------------------------------
  112.   // From Imaging protocol
  113.   //--------------------------------------------------------------------------
  114.  
  115.   void Draw(in ODFacet facet,
  116.         in ODShape invalidShape);
  117.  
  118.   void FacetAdded(in ODFacet facet);
  119.  
  120.   void FacetRemoved(in ODFacet facet);
  121.  
  122.   void GeometryChanged(in ODFacet facet,
  123.              in ODBoolean clipShapeChanged,
  124.              in ODBoolean externalTransformChanged);
  125.  
  126.   void HighlightChanged(in ODFacet facet);
  127.  
  128.   void CanvasChanged(in ODFacet facet);
  129.  
  130.   void CanvasUpdated(in ODCanvas canvas);
  131.  
  132.   ODULong GetPrintResolution(in ODFrame frame);
  133.  
  134.   //--------------------------------------------------------------------------
  135.   // From Part Activation protocol
  136.   //--------------------------------------------------------------------------
  137.  
  138.   ODBoolean BeginRelinquishFocus(in ODTypeToken focus,
  139.                    in ODFrame ownerFrame,
  140.                    in ODFrame proposedFrame);
  141.  
  142.   void CommitRelinquishFocus(in ODTypeToken focus,
  143.                  in ODFrame ownerFrame,
  144.                  in ODFrame proposedFrame);
  145.  
  146.   void AbortRelinquishFocus(in ODTypeToken focus,
  147.                 in ODFrame ownerFrame,
  148.                 in ODFrame proposedFrame);
  149.  
  150.   void FocusAcquired(in ODTypeToken focus,
  151.              in ODFrame ownerFrame);
  152.  
  153.   void FocusLost(in ODTypeToken focus,
  154.            in ODFrame ownerFrame);
  155.  
  156.   //--------------------------------------------------------------------------
  157.   // From Part Persistance protocol
  158.   //--------------------------------------------------------------------------
  159.  
  160.   void ExternalizeKinds(in ODTypeList kindset);
  161.  
  162.   void ChangeKind(in ODType kind);
  163.  
  164.   //--------------------------------------------------------------------------
  165.   // From UI Events protocol
  166.   //--------------------------------------------------------------------------
  167.  
  168.   ODBoolean HandleEvent(inout ODEventData event,
  169.               in ODFrame frame,
  170.               in ODFacet facet,
  171.               inout ODEventInfo eventInfo);
  172.  
  173.   void AdjustMenus(in ODFrame frame);
  174.  
  175.    #ifdef _PLATFORM_OS2_
  176.       ODMenuBar CreateRootMenuBar( in ODFrame frame );
  177.    #endif
  178.   //==========================================================================
  179.   // Optional Protocols
  180.   //==========================================================================
  181.  
  182.   //--------------------------------------------------------------------------
  183.   // From Undo protocol
  184.   //--------------------------------------------------------------------------
  185.  
  186.   void UndoAction(in ODActionData actionState);
  187.  
  188.   void RedoAction(in ODActionData actionState);
  189.  
  190.   void DisposeActionState(in ODActionData actionState,
  191.               in ODDoneState doneState);
  192.  
  193.   void WriteActionState(in ODActionData actionState,
  194.               in ODStorageUnitView storageUnitView);
  195.  
  196.   ODActionData ReadActionState(in ODStorageUnitView storageUnitView);
  197.  
  198.   //--------------------------------------------------------------------------
  199.   // From DragAndDrop protocol
  200.   //--------------------------------------------------------------------------
  201.  
  202.   void FulfillPromise(in ODStorageUnitView promiseSUView);
  203.  
  204.   void DropCompleted(in ODPart destPart,
  205.              in ODDropResult dropResult);
  206.  
  207.   ODDragResult DragEnter(in ODDragItemIterator dragInfo,
  208.                in ODFacet facet,
  209.                in ODPoint where);
  210.  
  211.   ODDragResult DragWithin(in ODDragItemIterator dragInfo,
  212.               in ODFacet facet,
  213.               in ODPoint where);
  214.  
  215.   void DragLeave(in ODFacet facet,
  216.            in ODPoint where);
  217.  
  218.   ODDropResult Drop(in ODDragItemIterator dropInfo,
  219.             in ODFacet facet,
  220.             in ODPoint where);
  221.  
  222.   //--------------------------------------------------------------------------
  223.   // From Linking protocol
  224.   //--------------------------------------------------------------------------
  225.  
  226.   ODLinkSource CreateLink(in ODByteArray data);
  227.  
  228.   void RevealLink(in ODLinkSource linkSource);
  229.  
  230.   void LinkUpdated(in ODLink updatedLink,
  231.            in ODUpdateID change);
  232.  
  233.    #ifdef _PLATFORM_OS2_
  234.  
  235.   void BreakLink(in ODLink link);
  236.   void BreakLinkSource(in ODLinkSource linkSource);
  237.   void LinkBroken(in ODLink link);
  238.   void UpdateFromLinkSource(in ODLinkSource linkSource);
  239.   void ShowLink(in ODLink link);
  240.  
  241.    #endif
  242.  
  243.   // --- for containing parts ---
  244.  
  245.   void EmbeddedFrameUpdated(in ODFrame frame,
  246.                 in ODUpdateID change);
  247.  
  248.   ODBoolean EditInLinkAttempted(in ODFrame frame);
  249.  
  250.   //--------------------------------------------------------------------------
  251.   // From Embedding protocol
  252.   //--------------------------------------------------------------------------
  253.  
  254.   ODFrame RequestEmbeddedFrame(in ODFrame containingFrame,
  255.                  in ODFrame baseFrame,
  256.                  in ODShape frameShape,
  257.                  in ODPart embedPart,
  258.                  in ODTypeToken viewType,
  259.                  in ODTypeToken presentation,
  260.                  in ODBoolean isOverlaid);
  261.  
  262.   void RemoveEmbeddedFrame(in ODFrame embeddedFrame);
  263.  
  264.   ODShape RequestFrameShape(in ODFrame embeddedFrame,
  265.                 in ODShape frameShape);
  266.  
  267.   void UsedShapeChanged(in ODFrame embeddedFrame);
  268.  
  269.   ODShape AdjustBorderShape(in ODFacet embeddedFacet,
  270.                 in ODShape shape);
  271.  
  272.   ODStorageUnit AcquireContainingPartProperties(in ODFrame frame);
  273.  
  274.   ODBoolean RevealFrame(in ODFrame embeddedFrame,
  275.               in ODShape revealShape);
  276.  
  277.   void EmbeddedFrameSpec(in ODFrame embeddedFrame,
  278.                in ODObjectSpec spec);
  279.  
  280.   ODEmbeddedFramesIterator CreateEmbeddedFramesIterator(in ODFrame frame);
  281.  
  282.   //==========================================================================
  283.   // DO NOT OVERRIDE
  284.   //==========================================================================
  285.  
  286.   //--------------------------------------------------------------------------
  287.   // From Part Wrapping protocol
  288.   //--------------------------------------------------------------------------
  289.  
  290.   ODBoolean IsRealPart();
  291.  
  292.   ODPart GetRealPart();
  293.  
  294.   void ReleaseRealPart();
  295.  
  296.   //==========================================================================
  297.  
  298.   #ifdef __SOMIDL__
  299.   implementation
  300.   {
  301.     functionprefix = ODPart;
  302.     override:
  303.       somInit,
  304.       somUninit,
  305.       CloneInto;
  306.     releaseorder:
  307.           InitPart,
  308.           InitPartFromStorage,
  309.           DisplayFrameAdded,
  310.           DisplayFrameRemoved,
  311.           DisplayFrameConnected,
  312.           DisplayFrameClosed,
  313.           AttachSourceFrame,
  314.           FrameShapeChanged,
  315.           ViewTypeChanged,
  316.           PresentationChanged,
  317.       SequenceChanged,
  318.           LinkStatusChanged,
  319.           ContainingPartPropertiesUpdated,
  320.           ReadPartInfo,
  321.           WritePartInfo,
  322.       ClonePartInfo,
  323.           Open,
  324.           Draw,
  325.           FacetAdded,
  326.           FacetRemoved,
  327.           GeometryChanged,
  328.           HighlightChanged,
  329.           CanvasChanged,
  330.           CanvasUpdated,
  331.           GetPrintResolution,
  332.           BeginRelinquishFocus,
  333.           CommitRelinquishFocus,
  334.           AbortRelinquishFocus,
  335.           FocusAcquired,
  336.           FocusLost,
  337.           ExternalizeKinds,
  338.           ChangeKind,
  339.           HandleEvent,
  340.           AdjustMenus,
  341.         #ifdef _PLATFORM_OS2_
  342.            CreateRootMenuBar,
  343.         #endif
  344.           UndoAction,
  345.           RedoAction,
  346.           DisposeActionState,
  347.           WriteActionState,
  348.           ReadActionState,
  349.           FulfillPromise,
  350.           DropCompleted,
  351.           DragEnter,
  352.           DragWithin,
  353.           DragLeave,
  354.           Drop,
  355.           CreateLink,
  356.           RevealLink,
  357.           LinkUpdated,
  358.         #ifdef _PLATFORM_OS2_
  359.           BreakLink,
  360.           BreakLinkSource,
  361.           LinkBroken,
  362.           UpdateFromLinkSource,
  363.           ShowLink,
  364.         #endif
  365.           EmbeddedFrameUpdated,
  366.           EditInLinkAttempted,
  367.           RequestEmbeddedFrame,
  368.           RemoveEmbeddedFrame,
  369.           RequestFrameShape,
  370.           UsedShapeChanged,
  371.           AdjustBorderShape,
  372.           AcquireContainingPartProperties,
  373.           RevealFrame,
  374.           EmbeddedFrameSpec,
  375.           CreateEmbeddedFramesIterator,
  376.  
  377.       IsRealPart,
  378.       GetRealPart,
  379.       ReleaseRealPart;
  380.   };
  381.   #endif
  382. };
  383.  
  384. #ifdef _PLATFORM_OS2_
  385. interface M_ODPart : SOMClass
  386. {
  387.   ISOString              clsGetODPartHandlerName();
  388.   string                 clsGetODPartHandlerDisplayName();
  389.   sequence<PartKindInfo> clsGetODPartKinds();
  390.   string                 clsGetOLE2ClassId();
  391.   string                 clsGetWindowsIconFileName();
  392.  
  393. #ifdef __SOMIDL__
  394.   implementation
  395.   {
  396.     functionprefix = M_ODPart;
  397.     override:
  398.       somInitClass,
  399.       somNew;
  400.     releaseorder:
  401.       clsGetODPartHandlerName,
  402.       clsGetODPartHandlerDisplayName,
  403.       clsGetODPartKinds,
  404.       clsGetOLE2ClassId,
  405.       clsGetWindowsIconFileName,
  406.       reservered1,
  407.       reservered2,
  408.       reservered3,
  409.       reservered4;
  410.   };
  411. #endif
  412. };
  413. #endif
  414. #endif // _PART_
  415.