repository_infos: Enable automatic updates on the main Haiku repostiory.
[haiku.git] / src / apps / haikudepot / textview / TextListener.h
blob5f8a41d92947aa6a132203d19a52aa2a72ea9f54
1 /*
2 * Copyright 2014, Stephan Aßmus <superstippi@gmx.de>.
3 * All rights reserved. Distributed under the terms of the MIT License.
4 */
5 #ifndef TEXT_LISTENER_H
6 #define TEXT_LISTENER_H
9 #include <Referenceable.h>
12 class TextChangeEvent {
13 protected:
14 TextChangeEvent();
15 TextChangeEvent(int32 firstChangedParagraph,
16 int32 changedParagraphCount);
17 virtual ~TextChangeEvent();
19 public:
20 int32 FirstChangedParagraph() const
21 { return fFirstChangedParagraph; }
22 int32 ChangedParagraphCount() const
23 { return fChangedParagraphCount; }
25 private:
26 int32 fFirstChangedParagraph;
27 int32 fChangedParagraphCount;
31 class TextChangingEvent : public TextChangeEvent {
32 public:
33 TextChangingEvent(int32 firstChangedParagraph,
34 int32 changedParagraphCount);
35 virtual ~TextChangingEvent();
37 void Cancel();
38 bool IsCanceled() const
39 { return fIsCanceled; }
41 private:
42 TextChangingEvent();
44 private:
45 bool fIsCanceled;
49 class TextChangedEvent : public TextChangeEvent {
50 public:
51 TextChangedEvent(int32 firstChangedParagraph,
52 int32 changedParagraphCount);
53 virtual ~TextChangedEvent();
55 private:
56 TextChangedEvent();
60 class TextListener : public BReferenceable {
61 public:
62 TextListener();
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