2 * Copyright 2014, Stephan Aßmus <superstippi@gmx.de>.
3 * All rights reserved. Distributed under the terms of the MIT License.
5 #ifndef TEXT_LISTENER_H
6 #define TEXT_LISTENER_H
9 #include <Referenceable.h>
12 class TextChangeEvent
{
15 TextChangeEvent(int32 firstChangedParagraph
,
16 int32 changedParagraphCount
);
17 virtual ~TextChangeEvent();
20 int32
FirstChangedParagraph() const
21 { return fFirstChangedParagraph
; }
22 int32
ChangedParagraphCount() const
23 { return fChangedParagraphCount
; }
26 int32 fFirstChangedParagraph
;
27 int32 fChangedParagraphCount
;
31 class TextChangingEvent
: public TextChangeEvent
{
33 TextChangingEvent(int32 firstChangedParagraph
,
34 int32 changedParagraphCount
);
35 virtual ~TextChangingEvent();
38 bool IsCanceled() const
39 { return fIsCanceled
; }
49 class TextChangedEvent
: public TextChangeEvent
{
51 TextChangedEvent(int32 firstChangedParagraph
,
52 int32 changedParagraphCount
);
53 virtual ~TextChangedEvent();
60 class TextListener
: public BReferenceable
{
63 virtual ~TextListener();
65 virtual void TextChanging(TextChangingEvent
& event
);
67 virtual void TextChanged(const TextChangedEvent
& event
);
71 typedef BReference
<TextListener
> TextListenerRef
;
74 #endif // TEXT_LISTENER_H