// $Revision: 1.4 $ // Copyright (c) 1994-1995 Taligent, Inc. All rights reserved. #ifndef TaligentSamples_STANDARDSELECTSTATES #define TaligentSamples_STANDARDSELECTSTATES #ifndef TaligentSamples_SELECTTEXTINTERACTOR #include "SampleSelectTextInteractor.h" #endif // This sets the anchor to be a selection computed from the initial offset, the initial area // is ignored. Tracking extends the selection from the anchor to the tracking offset. class TSetSelectState : public TSelectState { public: TaligentTypeExtensionDeclarationsMacro_Abstract(TSetSelectState) TSetSelectState(MTextRepresentation*, TTextChunkIteratorReference&); virtual ~TSetSelectState(); virtual void Setup(const TInsertionOffset& initialOffset, const TTextArea& initialArea); virtual void Track(const TInsertionOffset& trackingOffset, TTextArea& resultArea); protected: virtual void SetAnchor(const TTextArea&); virtual void ExtendArea(TTextArea&); private: TTextArea fAnchor; }; // This computes the anchor to be the end of the initial selection furthest from the // initial offset. class TExtendSelectState : public TSetSelectState { public: TaligentTypeExtensionDeclarationsMacro_Abstract(TExtendSelectState) TExtendSelectState(MTextRepresentation*, TTextChunkIteratorReference&); virtual ~TExtendSelectState(); virtual void Setup(const TInsertionOffset& initialOffset, const TTextArea& initialArea); }; #endif // TaligentSamples_STANDARDSELECTSTATES