/* @(#)Z 1.36 com/src/layout/idl/Facet.idl, odlayout, od96nt, odnt9712d 97/03/21 16:44:48 (97/02/19 09:14:41) */

/********************************************************************/
/*  Licensed Materials - Property of IBM                            */
/*                                                                  */
/*                                                                  */
/* Copyright (C) International Business Machines Corp., 1994.       */
/* Copyright (C) Apple Computer, Inc., 1994                         */
/*                                                                  */
/*  US Government Users Restricted Rights -                         */
/*  Use, duplication, or disclosure restricted                      */
/*  by GSA ADP Schedule Contract with IBM Corp.                     */
/*                                                                  */
/*                                                                  */
/********************************************************************/


#ifndef _FACET_
#define _FACET_

#ifndef _ODOBJECT_
#include "ODObject.idl"
#endif

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

interface  ODFacet;

//=====================================================================================
// Classes used by this interface
//=====================================================================================
interface  ODCanvas;
interface  ODDragItemIterator;
interface  ODFacetIterator;
interface  ODFrame;
interface  ODShape;
interface  ODTransform;
interface  ODWindow;
#if defined (_PLATFORM_OS2_) || defined (_PLATFORM_WIN32_) || defined (_PLATFORM_UNIX_)
interface  ODPlatformCanvas;
#endif // _PLATFORM_OS2_ ||  _PLATFORM_WIN32_ || _PLATFORM_UNIX_

#if defined (_PLATFORM_OS2_) || defined (_PLATFORM_WIN32_) 
interface  M_ODFacet;

#endif // _PLATFORM_OS2_ ||  _PLATFORM_WIN32_ 

#ifdef _PLATFORM_OS2_
interface ODOS2StandardCanvas;
interface ODOS2WindowCanvas;
#endif //_PLATFORM_OS2_

#ifdef _PLATFORM_WIN32_
interface ODWin32StandardCanvas;
#endif // _PLATFORM_WIN32_

#ifdef _PLATFORM_UNIX_
interface ODAIXStandardCanvas;
typedef somToken Display;
typedef somToken Pixmap;
typedef somToken GC;
typedef somToken Widget;
typedef somToken Window;
#endif // UNIX


#ifdef _PLATFORM_OS2_
//=====================================================================================
// Constants used in this interface
//=====================================================================================

// Bitfield flags used by Set/GetHandleMouseEvents

#pragma somemittypes on
const ODULong kODPartHandlesMouseEvents = 1;
const ODULong kODPartHandlesDragDropEvents = 2;
#pragma somemittypes off

#endif // _PLATFORM_OS2_

//=====================================================================================
// ODFacet
//=====================================================================================

interface ODFacet :  ODObject
{
   ODFrame GetFrame();

   ODFacet CreateEmbeddedFacet(in ODFrame frame,
                               in ODShape clipShape,
                               in ODTransform externalTransform,
                               in ODCanvas canvas,
                               in ODCanvas biasCanvas,
                               in ODFacet siblingFacet,
                               in ODFramePosition position);

   void RemoveFacet(in ODFacet facet);

   void MoveBefore(in ODFacet child,
                   in ODFacet sibling);

   void MoveBehind(in ODFacet child,
                   in ODFacet sibling);

   ODFacet GetContainingFacet();

   ODFacetIterator CreateFacetIterator(in ODTraversalType traversalType,
                                       in ODSiblingOrder siblingOrder);

   ODShape CreateShape();

   ODShape AcquireClipShape(in ODCanvas biasCanvas);

   void ChangeGeometry(in ODShape clipShape,
                       in ODTransform transform,
                       in ODCanvas biasCanvas);

   ODShape AcquireAggregateClipShape(in ODCanvas biasCanvas);

   ODShape AcquireWindowAggregateClipShape(in ODCanvas biasCanvas);

   ODShape AcquireActiveShape(in ODCanvas biasCanvas);

   void ChangeActiveShape(in ODShape activeShape, in ODCanvas biasCanvas);

   ODTransform CreateTransform();

   ODTransform AcquireExternalTransform(in ODCanvas biasCanvas);

   ODTransform AcquireFrameTransform(in ODCanvas biasCanvas);

   ODTransform AcquireContentTransform(in ODCanvas biasCanvas);

   ODTransform AcquireWindowFrameTransform(in ODCanvas biasCanvas);

   ODTransform AcquireWindowContentTransform(in ODCanvas biasCanvas);

   ODCanvas CreateCanvas(in ODGraphicsSystem graphicsSystem,
                         in ODPlatformCanvas platformCanvas,
                         in ODBoolean isDynamic,
                         in ODBoolean isOffscreen);

   ODBoolean HasCanvas();

   ODCanvas GetCanvas();

   void ChangeCanvas(in ODCanvas canvas);

   ODWindow GetWindow();

   ODInfoType GetPartInfo();

   void SetPartInfo(in ODInfoType partInfo);

   ODDragResult DragEnter(in ODPoint point,
                          in ODDragItemIterator dragInfo,
                          in ODCanvas biasCanvas);

   ODDragResult DragWithin(in ODPoint point,
                           in ODDragItemIterator dragInfo,
                           in ODCanvas biasCanvas);

   void DragLeave(in ODPoint point,
                  in ODCanvas biasCanvas);

   ODDropResult Drop(in ODPoint point,
                     in ODDragItemIterator dropInfo,
                     in ODCanvas biasCanvas);

   void Update(in ODShape invalidShape, in ODCanvas biasCanvas);

   void Invalidate(in ODShape invalidShape, in ODCanvas biasCanvas);

   void Validate(in ODShape validShape, in ODCanvas biasCanvas);

   void Draw(in ODShape invalidShape, in ODCanvas biasCanvas);

   void DrawChildren(in ODShape invalidShape, in ODCanvas biasCanvas);

   void DrawChildrenAlways(in ODShape invalidShape, in ODCanvas biasCanvas);

   void DrawnIn(in ODShape shape, in ODCanvas biasCanvas);

   void InvalidateActiveBorder();

   void DrawActiveBorder();

   ODBoolean ContainsPoint(in ODPoint point, in ODCanvas biasCanvas);

   ODBoolean ActiveBorderContainsPoint(in ODPoint point, in ODCanvas biasCanvas);

   ODBoolean IsSelected();

   void SetSelected(in ODBoolean isSelected);

   ODHighlight GetHighlight();

   void ChangeHighlight(in ODHighlight highlight);

#ifdef _PLATFORM_WIN32_
  HWND GetFacetHWND();

  ODWin32StandardCanvas CreatePlatformCanvas( in HDC hdc);

#endif

#ifdef _PLATFORM_OS2_
  HWND GetFacetHWND();

  ODOS2StandardCanvas CreatePlatformCanvas( in HPS hps );

  void SetHandleMouseEvents(in ODULong flags);

  ODULong GetHandleMouseEvents();

  ODRgnHandle CopyAggregateClipRegion( in HPS hps );
  ODRgnHandle CopyFacetClipRegion( in HPS hps );
  ODPlatformWindow ChildUnderPoint( in ODPoint odPt );

#endif // _PLATFORM_OS2_

#ifdef _PLATFORM_UNIX_

  Widget GetFacetWidget();

  ODBoolean IsEventInActiveBorder( in ODEventData event);

  ODAIXStandardCanvas CreatePlatformCanvas( in Display* display,
					    in Pixmap   pixmap,
					    in GC       gc      );

#endif // UNIX


#ifdef __SOMIDL__
  implementation
  {
   majorversion = 1; minorversion = 0;

   functionprefix = ODFacet;
  #if defined (_PLATFORM_OS2_) || defined (_PLATFORM_WIN32_) 
   metaclass = M_ODFacet;
  #endif // _PLATFORM_OS2_ || _PLATFORM_WIN32_ 

   override:
       somUninit,
       Purge;

   releaseorder:
       GetFrame,
       CreateEmbeddedFacet,
       RemoveFacet,
       MoveBefore,
       MoveBehind,
       GetContainingFacet,
       CreateFacetIterator,
       CreateShape,
       AcquireClipShape,
       ChangeGeometry,
       AcquireAggregateClipShape,
       AcquireWindowAggregateClipShape,
       AcquireActiveShape,
       ChangeActiveShape,
       CreateTransform,
       AcquireExternalTransform,
       AcquireFrameTransform,
       AcquireContentTransform,
       AcquireWindowFrameTransform,
       AcquireWindowContentTransform,
       CreateCanvas,
       HasCanvas,
       GetCanvas,
       ChangeCanvas,
       GetWindow,
       GetPartInfo,
       SetPartInfo,
       DragEnter,
       DragWithin,
       DragLeave,
       Drop,
       Update,
       Invalidate,
       Validate,
       Draw,
       DrawChildren,
       DrawChildrenAlways,
       DrawnIn,
       InvalidateActiveBorder,
       DrawActiveBorder,
       ContainsPoint,
       ActiveBorderContainsPoint,
       IsSelected,
       SetSelected,
       GetHighlight,
       ChangeHighlight,
     #ifdef _PLATFORM_WIN32_
       GetFacetHWND,
       CreatePlatformCanvas,
     #endif
     #ifdef _PLATFORM_OS2_
       GetFacetHWND,
       CreatePlatformCanvas,
       SetHandleMouseEvents,
       GetHandleMouseEvents,
       CopyAggregateClipRegion,
       CopyFacetClipRegion,
       ChildUnderPoint,
     #endif // _PLATFORM_OS2_
     #ifdef _PLATFORM_UNIX_
       GetFacetWidget,
       IsEventInActiveBorder,
       CreatePlatformCanvas,
     #endif //UNIX

       reserved1,
       reserved2,
       reserved3,
       reserved4,
       reserved5,
       reserved6,
       reserved7,
     #ifdef _PLATFORM_MACINTOSH_
       reserved8;
     #endif  // _PLATFORM_MACINTOSH_
     #ifdef _PLATFORM_UNIX_
       reserved8,
       reserved9,
       reserved10,
       reserved11,
       reserved12,
       reserved13;
     #endif
     #ifdef _PLATFORM_WIN32_
       reserved8,
       reserved9,
       reserved10,
       reserved11;
     #endif // _PLATFORM_WIN32_
     #ifdef _PLATFORM_OS2_
       reserved8,
       reserved9,
       reserved10,
       reserved11,
       reserved12;
     #endif // _PLATFORM_OS2_


  };
#endif   // __SOMIDL__
};


#endif // _FACET_
