home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
cset21v1.zip
/
IBMCPP
/
IBMCLASS
/
IDMHNDLR.HPP
< prev
next >
Wrap
C/C++ Source or Header
|
1993-10-22
|
8KB
|
162 lines
#ifndef _IDMHNDLR_
#define _IDMHNDLR_
/*******************************************************************************
* FILE NAME: idmhndlr.hpp *
* *
* DESCRIPTION: *
* This file contains the declaration(s) of the class(es): *
* IDMHandler - Direct manipulation base handler class. *
* *
* COPYRIGHT: *
* Licensed Materials - Property of IBM *
* (C) Copyright IBM Corporation 1992, 1993 *
* All Rights Reserved *
* US Government Users Restricted Rights - Use, duplication, or *
* disclosure *
* restricted by GSA ADP Schedule Contract with IBM Corp. *
* *
*******************************************************************************/
#ifndef _IHANDLER_
#include <ihandler.hpp>
#endif
/*----------------------------------------------------------------------------*/
/* Align classes on four byte boundary. */
/*----------------------------------------------------------------------------*/
#pragma pack(4)
class IDMSourceHandler;
class IDMTargetHandler;
class IDMRenderer;
class IDMRendererSeq;
class IWindow;
class IEntryField;
class IMultiLineEdit;
class IContainerControl;
class IDMHandler : public IHandler {
typedef IHandler
Inherited;
/*******************************************************************************
* The IDMHandler class is the common base class, or abstract class, for the *
* direct manipulation source window handler class, IDMSourceHandler, and the *
* target window handler class, IDMTargetHandler. *
* *
* This base class provides static functions to enable drag/drop from *
* application windows and controls. *
*******************************************************************************/
public:
/*----------------------- Direct Manipulation Enabling -------------------------
| These static member functions provide a simple means of enabling drag/drop |
| for application windows and controls: |
| enableDragFrom - Attaches default source handler to argument window. |
| enableDropOn - Attaches default target handler to argument window. |
| enableDragDropFor - Attaches default source and target handlers. |
------------------------------------------------------------------------------*/
static void
enableDragFrom ( IWindow *window ),
enableDragFrom ( IEntryField *ef ),
enableDragFrom ( IMultiLineEdit *mle ),
enableDragFrom ( IContainerControl *container ),
enableDropOn ( IWindow *window ),
enableDropOn ( IEntryField *ef ),
enableDropOn ( IMultiLineEdit *mle ),
enableDropOn ( IContainerControl *container ),
enableDragDropFor ( IWindow *window ),
enableDragDropFor ( IEntryField *ef ),
enableDragDropFor ( IMultiLineEdit *mle ),
enableDragDropFor ( IContainerControl *container );
/*----------------------------- Default Handlers -------------------------------
| These static member functions get/set the default source/target handlers |
| used by the various enabling functions (see above): |
| defaultSourceHandler - Returns the default source handler. |
| defaultTargetHandler - Returns the default target handler. |
| setDefaultSourceHandler - Sets the default source handler. |
| setDefaultTargetHandler - Sets the default target handler. |
------------------------------------------------------------------------------*/
static IDMSourceHandler
&defaultSourceHandler ( );
static IDMTargetHandler
&defaultTargetHandler ( );
static void
setDefaultSourceHandler ( IDMSourceHandler &source ),
setDefaultTargetHandler ( IDMTargetHandler &target );
protected:
/*-------------------------- Constructor/Destructor ----------------------------
| This class's constructor is protected since the class is really an |
| abstract base class. The default contructor requires no arguments. |
------------------------------------------------------------------------------*/
IDMHandler ( );
virtual
~IDMHandler ( );
/*------------------------------ Implementation --------------------------------
| These static functions set a default item provider for the argument |
| window: |
| setItemProvider - Set default item provider. |
------------------------------------------------------------------------------*/
static void
setItemProvider ( IEntryField *ef ),
setItemProvider ( IMultiLineEdit *mle ),
setItemProvider ( IContainerControl *container );
/*-------------------------------- Rendering -----------------------------------
| The following functions provide a means of accessing the base IDMRenderer |
| objects involved in the direct manipulation operation described by instances |
| of this class. These objects will be used to handle the rendering of |
| dragged objects that are compatible with the supported remderering |
| mechanisms and formats: |
| numberOfRenderers - Returns the number of renderers |
| renderer - Returns the renderer with the given position |
| replaceRenderer - Replaces a given renderer with another |
| addRenderer - Adds another renderer to this operation |
| removeRenderer - Removes a renderer from this operation |
| setRenderer - Sets the renderer for this operation. Removes any |
| existing renderers. |
| |
| Note: Renderers are maintained positionally, which is 1-based. |
------------------------------------------------------------------------------*/
virtual unsigned
numberOfRenderers ( );
virtual IDMRenderer
*renderer ( unsigned position );
virtual IDMHandler
&replaceRenderer ( unsigned position,
const IDMRenderer &replacement ),
&addRenderer ( const IDMRenderer &newRenderer ),
&removeRenderer ( unsigned position ),
&removeRenderer ( const IDMRenderer &rendererToRemove ),
&setRenderer ( const IDMRenderer &newRenderer );
private: /*------------------------ PRIVATE ----------------------------------*/
static IDMSourceHandler
*pSource;
static IDMTargetHandler
*pTarget;
IDMRendererSeq
*pRendererSeqCl;
IDMRendererSeq
*rendererCollection ();
}; // class IDMHandler
/*----------------------------------------------------------------------------*/
/* Resume compiler default packing. */
/*----------------------------------------------------------------------------*/
#pragma pack()
#endif // _IDMHNDLR_