// $Revision: 1.4 $ //------------------------------------------------------------------------------ // // Copyright (C) 1994, 1995 Taligent, Inc. All rights reserved. // // Project: TaligentSelectionTool // File: SimpleDragAndDropItem.h // Build/Version: 1.0.0 // // Description: TDragAndDropItem is abstract class that encapsulates the complete set of // representations of a logically dragged item. It is what is provided on the drag // source side to a drag and drop interactor. TDragAndDropItem can intuitively be // thought of as representing an internal collection of TScrapItems. // CopyAvailableTypes can then be explained as providing the sum collection of // available types providable by the logical collection of scrap items. // FindItemMatchingDescription returns a pointer to the scrap item that represents // the specified type description. Both of these functions are pure abstract.. // //------------------------------------------------------------------------------ #ifndef Taligent_SIMPLEDRAGANDDROPITEM #define Taligent_SIMPLEDRAGANDDROPITEM class TSimpleDragAndDropItem; #ifndef Taligent_DRAGANDDROP #include #endif #ifndef Taligent_SCRAPITEM #include #endif //................................................................................ class TSimpleDragAndDropItem : public TDragAndDropItem { public: MCollectibleDeclarationsMacro(TSimpleDragAndDropItem); public: TSimpleDragAndDropItem(const TViewHandle& viewForActions); TSimpleDragAndDropItem(const TSimpleDragAndDropItem& source); ~TSimpleDragAndDropItem(); TSimpleDragAndDropItem& operator=(const TSimpleDragAndDropItem& source); virtual TStream& operator>>=(TStream& toStream) const; virtual TStream& operator<<=(TStream& fromStream); // Overrides virtual void CopyAvailableTypes(TSequenceOf& result, TMemoryHeap* whichHeap = NIL) const; virtual TScrapItem* FindItemMatchingDescription(const TTypeDescription& theDescription); // New Functions virtual void AdoptScrapItem(TScrapItem* scrapItem); protected: TSimpleDragAndDropItem(); void CopyDictionaryAndScraps(const TDequeOf& otherScraps); private: enum Version {kOriginalVersion}; TDictionaryOf fDictionary; TDequeOf fScraps; }; #endif