#ifdef __PRIVATE__
//#
//#	File:		Part.idl
//#
//#	Contains:	Interface for ODPart class
//#
//#	Owned by:	Caia Grisar
//#
//#	Copyright:	c 1994 by Apple Computer, Inc., all rights reserved.
//#
//#	Change History (most recent first):
//#
//#		<12>	 9/23/94	RR		#1183564 made EventData inout
//#		<11>	  9/1/94	CC		RADAR #1183005 - change AdjustBorderShape
//#									param from Frame to Facet (for JBS)
//#		<10>	 8/28/94	VL		#1182975: DragEnter & DragWithin should
//#									return ODDragResult (instead of ODBoolean).
//#		 <9>	 8/26/94	VL		1183174: Removed CloneInto as it does not
//#									really override the superclass method.
//#		 <8>	 8/24/94	CG		#1181622: Updated file ownership.
//#		 <7>	 8/16/94	VL		1143605: Added override CloneInto.
//#		 <6>	 8/13/94	T 		#1180814 Added support for ODPartWrapper
//#									API
//#		 <5>	  8/9/94	VL		1179857: DragEnter and DragWithin return
//#									ODBoolean.
//#		 <4>	  8/5/94	JBS		#1179151 Part API cleanup
//#		 <3>	 6/28/94	CG		Synched API with a7.
//#		 <2>	 6/24/94	CG		Added functionprefix.
//#		 <1>	  6/8/94	CG		first checked in
//#		 <1>	  6/8/94	CG		first checked in
//#
//#	To Do:
//#
#else
//#	Copyright:	c 1993-1994 by Apple Computer, Inc., all rights reserved.
#endif

#ifndef _PART_
#define _PART_

#ifndef _PSTOBJ_
#include "PstObj.idl"
#endif

//==============================================================================
// Constants
//==============================================================================

//==============================================================================
// Classes defined in this interface
//==============================================================================

interface  ODPart;

//==============================================================================
// Classes used by this interface
//==============================================================================

interface  ODPartWrapper;
interface  ODCanvas;
interface  ODFacet;
interface  ODFrame;
interface  ODLink;
interface  ODLinkSource;
interface  ODShape;
interface  ODStorageUnit;
interface  ODStorageUnitView;
interface  ODDragItemIterator;
interface  ODTypeList;
interface  ODEmbeddedFramesIterator;
interface  ODObjectSpec;

//# interface  ODTransform;
//# interface  ODSession;
//# $$$$$ struct ODPoint;

//==============================================================================
// ODPart
//==============================================================================

interface ODPart :  ODPersistentObject
{

  //-------------------------------------------------------------------------
  // From DragAndDrop protocol
  //-------------------------------------------------------------------------

   void FulfillPromise(in ODStorageUnitView promiseSUView);
  
   void DropCompleted(in ODPart destPart,
   					  in ODDropResult dropResult);
    
   ODDragResult DragEnter(in ODDragItemIterator dragInfo,
   				  in ODFacet facet,
				  in ODPoint where);

   ODDragResult DragWithin(in ODDragItemIterator dragInfo,
   				   in ODFacet facet,
				   in ODPoint where);

   void DragLeave(in ODFacet facet,
				  in ODPoint where);

   ODDropResult Drop(in ODDragItemIterator dropInfo,
					 in ODFacet facet,
					 in ODPoint where);

  //-------------------------------------------------------------------------
  // From Embedding protocol
  //-------------------------------------------------------------------------

   void ContainingPartPropertiesChanged(in ODFrame frame,
   										in ODStorageUnit propertyUnit);

  // ********* for containing parts *********

   ODStorageUnit  GetContainingPartProperties(in ODFrame frame);

   ODBoolean RevealFrame(in ODFrame embeddedFrame,
   						 in ODShape revealShape);
    
   void EmbeddedFrameSpec(in ODFrame embeddedFrame,
   						  in ODObjectSpec spec);
    
   ODEmbeddedFramesIterator CreateEmbeddedFramesIterator(in ODFrame frame);

  //-------------------------------------------------------------------------
  // From Frames protocol
  //-------------------------------------------------------------------------

   void DisplayFrameAdded(in ODFrame frame);

   void DisplayFrameRemoved(in ODFrame frame);

   void DisplayFrameConnected(in ODFrame frame);

   void DisplayFrameClosed(in ODFrame frame);

   void AttachSourceFrame(in ODFrame frame,
   						  in ODFrame sourceFrame);

   void FrameShapeChanged(in ODFrame frame);

   void ViewTypeChanged(in ODFrame frame);

   void PresentationChanged(in ODFrame frame);

   void SequenceChanged(in ODFrame frame);

   void WritePartInfo(in ODPtr partInfo,
   					  in ODStorageUnitView storageUnitView);

   ODPtr ReadPartInfo(in ODFrame frame,
   					  in ODStorageUnitView storageUnitView);

   ODID Open(in ODFrame frame);

  //---------------------------------
  // for containing parts

   ODFrame  RequestEmbeddedFrame(in ODFrame containingFrame,
   								in ODFrame baseFrame,
								in ODShape frameShape,
								in ODPart embedPart,
								in ODTypeToken viewType,
								in ODTypeToken presentation,
								in ODBoolean isOverlaid);

    // create a new frame and embed a part in it.
    
   void RemoveEmbeddedFrame(in ODFrame embeddedFrame);

   ODShape  RequestFrameShape(in ODFrame embeddedFrame,
   							  in ODShape frameShape);

   void UsedShapeChanged(in ODFrame embeddedFrame);

   ODShape AdjustBorderShape(in ODFacet embeddedFacet,
   							 in ODShape shape);

  //-------------------------------------------------------------------------
  // From Facet protocol
  //-------------------------------------------------------------------------

   void FacetAdded(in ODFacet facet);

   void FacetRemoved(in ODFacet facet);

   void CanvasChanged(in ODFacet facet);

   void GeometryChanged(in ODFacet facet,
   						in ODBoolean clipShapeChanged,
						in ODBoolean externalTransformChanged);

  //-------------------------------------------------------------------------
  // From Imaging protocol
  //-------------------------------------------------------------------------

   void Draw(in ODFacet facet,
   			 in ODShape invalidShape);

   void CanvasUpdated(in ODCanvas canvas);

   void HighlightChanged(in ODFacet facet);

   ODULong GetPrintResolution(in ODFrame frame);

  //-------------------------------------------------------------------------
  // From Linking protocol
  //-------------------------------------------------------------------------

   ODLink  CreateLink(in ODPtr data,
   					  in ODULong size);

   void LinkUpdated(in ODLink updatedLink,
   					in ODChangeID id);

   void RevealLink(in ODLinkSource linkSource);

   void  EmbeddedFrameChanged(in ODFrame frame,
   							  in ODChangeID change);

   void  LinkStatusChanged(in ODFrame frame);

  //-------------------------------------------------------------------------
  // From Part Activation protocol
  //-------------------------------------------------------------------------

   ODBoolean BeginRelinquishFocus(in ODTypeToken focus,
   								  in ODFrame ownerFrame,
								  in ODFrame proposedFrame);

   void CommitRelinquishFocus(in ODTypeToken focus,
   							  in ODFrame ownerFrame,
							  in ODFrame proposedFrame);
              
   void AbortRelinquishFocus(in ODTypeToken focus,
   							 in ODFrame ownerFrame,
							 in ODFrame proposedFrame);
                  
   void FocusAcquired(in ODTypeToken focus,
   					  in ODFrame ownerFrame);
  
   void FocusLost(in ODTypeToken focus,
   				  in ODFrame ownerFrame);
                  

  //-------------------------------------------------------------------------
  // From Binding protocol
  //-------------------------------------------------------------------------

   void ExternalizeKinds(in ODTypeList kindset);

   void ChangeKind(in ODType kind);

  //-------------------------------------------------------------------------
  // From UI Events protocol
  //-------------------------------------------------------------------------

   ODBoolean HandleEvent(inout ODEventData event,
   						 in ODFrame frame,
						 in ODFacet facet);

   ODBoolean HandleEventInEmbedded(inout ODEventData event,
   								   in ODFrame frame,
								   in ODFacet facet,
								   in ODFrame embeddedFrame,
								   in ODFacet embeddedFacet);

   void MouseEnter(in ODFacet facet,
   				   in ODPoint where);
  
   void MouseWithin(in ODFacet facet,
   					in ODPoint where);
  
   void MouseLeave(in ODFacet facet);
  
   void AdjustMenus(in ODFrame frame);
    
  //-------------------------------------------------------------------------
  // From Undo protocol
  //-------------------------------------------------------------------------

   void UndoAction(in ODActionData actionState);

   void RedoAction(in ODActionData actionState);

   void DisposeActionState(in ODActionData actionState,
   						   in ODDoneState doneState);

   void WriteActionState(in ODPtr actionState,
   					     in ODStorageUnitView storageUnitView);

   ODPtr ReadActionState(in ODStorageUnitView storageUnitView);

  // private by convention

  //-------------------------------------------------------------------------
  // constructors/destructors
  //-------------------------------------------------------------------------

  

   void InitPart(in ODStorageUnit storageUnit, in ODPartWrapper partWrapper);
    
   void InitPartFromStorage(in ODStorageUnit storageUnit, in ODPartWrapper partWrapper);

#ifdef __SOMIDL__
  implementation
	{
	functionprefix = ODPart;
	override:
		somInit,
		somUninit;
	releaseorder:
        FulfillPromise,
        DropCompleted,
        DragEnter,
        DragWithin,
        DragLeave,
        Drop,
        ContainingPartPropertiesChanged,
        GetContainingPartProperties,
        RevealFrame,
        EmbeddedFrameSpec,
        CreateEmbeddedFramesIterator,
        DisplayFrameAdded,
        DisplayFrameRemoved,
        DisplayFrameConnected,
        DisplayFrameClosed,
        AttachSourceFrame,
        FrameShapeChanged,
        ViewTypeChanged,
        PresentationChanged,
		SequenceChanged,
        WritePartInfo,
        ReadPartInfo,
        Open,
        RequestEmbeddedFrame,
        RemoveEmbeddedFrame,
        RequestFrameShape,
        UsedShapeChanged,
        AdjustBorderShape,
        FacetAdded,
        FacetRemoved,
        CanvasChanged,
        GeometryChanged,
        Draw,
        CanvasUpdated,
        HighlightChanged,
        GetPrintResolution,
        CreateLink,
        LinkUpdated,
        RevealLink,
        EmbeddedFrameChanged,
        LinkStatusChanged,
        BeginRelinquishFocus,
        CommitRelinquishFocus,
        AbortRelinquishFocus,
        FocusAcquired,
        FocusLost,
        ExternalizeKinds,
        ChangeKind,
        HandleEvent,
        HandleEventInEmbedded,
        MouseEnter,
        MouseWithin,
        MouseLeave,
        AdjustMenus,
        UndoAction,
        RedoAction,
        DisposeActionState,
        WriteActionState,
        ReadActionState,
        InitPart,
        InitPartFromStorage;
    #ifdef __PRIVATE__
    #endif
    
  };
#endif
};



#endif // _PART_


