// $Revision: 1.4 $ //------------------------------------------------------------------------------ // // Copyright (C) 1994, 1995 Taligent, Inc. All rights reserved. // // Project: TaligentSelectionTool // File: DragOMatic.h // Build/Version: 1.0.0 // // Description: Provide and easy to use drag source and destination with // selection capabilities. // //------------------------------------------------------------------------------ #ifndef TaligentSamples_DRAGOMATIC #define TaligentSamples_DRAGOMATIC class TDOMDocumentComponentView; #ifndef TaligentSamples_SELECTIONMAPPING #include "SelectionMapping.h" #endif #ifndef TaligentSamples_FEEDBACKER #include "Feedbacker.h" #endif #ifndef TaligentSamples_SELECTIONTOOLHANDLER #include "SelectionToolHandler.h" #endif #ifndef TaligentSamples_AUTODROPACCEPTOR #include "AutoDropAcceptor.h" #endif #ifndef Taligent_DROPACCEPTOR #include #endif //................................................................................ class TDOMDocumentComponentView : public TDocumentComponentView, public MDropAcceptor, public MSelectionMapping { public: TaligentTypeExtensionDeclarationsMacro(TDOMDocumentComponentView) public: TDOMDocumentComponentView(); TDOMDocumentComponentView(TGUIBundle* guiBundleToAlias); virtual ~TDOMDocumentComponentView(); virtual TStream& operator>>=(TStream&) const; virtual TStream& operator<<=(TStream&); virtual bool DispatchEvent(TEvent& event); virtual void DragItemEntered(const TGPoint& whereEntered, const TSequenceOf& availableTypes); virtual void DragItemMoved(const TGPoint& whereMoved, const TSequenceOf& availableTypes); virtual void DragItemExited(const TGPoint& whereExited); virtual bool ChoosePreferredType(const TGPoint& whereDropped, const TSequenceOf& availableTypes, TTypeDescription& chosenType) const; virtual bool AcceptDrop(const TGPoint& whereDropped, const TTypeDescription& type, const TScrapItem& item); protected: virtual void DrawContents(TGrafPort&) const; virtual void HandleAfterConnectionToViewRoot(); virtual void HandleBeforeDisconnectionFromViewRoot(); virtual TGArea GetSelectionDisplayArea(const TModelSelection& area) const; virtual TModelSelection* CreateInsertionPoint(const TGPoint& where) const; virtual TModelSelection* CreateSelectionFromPoint(const TGPoint& area) const; virtual TModelSelection* CreateSelectionFromArea(const TGArea& area) const; private: enum {kOriginalVersion}; TDOMDocumentComponentView(const TDOMDocumentComponentView&); TDOMDocumentComponentView& operator=(const TDOMDocumentComponentView& source); MFeedbacker fFeedbacker; MSelectionToolHandler fSelectionToolHandler; TToolNegotiator* fNegotiator; MAutoDropAcceptor fDropAcceptor; }; #endif