// $Revision: 1.4 $ //------------------------------------------------------------------------------ // // Copyright (C) 1994, 1995 Taligent, Inc. All rights reserved. // // Project: TaligentSelectionTool // File: AutoDropAcceptor.h // Build/Version: 1.0.0 // // Description: Provides an implementation that can be used to implement // MDropAcceptors. // //------------------------------------------------------------------------------ #ifndef TaligentSamples_AUTODROPACCEPTOR #define TaligentSamples_AUTODROPACCEPTOR class TInsertionTarget; class TTypeDescription; class TGPoint; class TScrapItem; class MDataExchanger; #ifndef Taligent_COREPRIMITIVECLASSES #include #endif #ifndef Taligent_DELETERFOR #include #endif #ifndef TaligentSamples_INSERTIONTARGET #include "InsertionTarget.h" #endif //................................................................................ class MAutoDropAcceptor { public: MAutoDropAcceptor(); MAutoDropAcceptor(TInsertionTarget* target); virtual ~MAutoDropAcceptor(); virtual void AdoptTarget(TInsertionTarget* target); 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: void AdjustFeedbackGraphic(const TSequenceOf& types); TTypeDescription* NegotiateType(MDataExchanger* exchanger, const TSequenceOf& availableTypes) const; private: MAutoDropAcceptor& operator=(const MAutoDropAcceptor& source); TDeleterFor fTarget; }; #endif