2 * Copyright 2003-2008, Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
6 * Stefano Ceccherini (burton666@libero.it)
10 #define __UNDOBUFFER_H
19 class BTextView::UndoBuffer
{
21 UndoBuffer(BTextView
* view
, undo_state state
);
22 virtual ~UndoBuffer();
24 void Undo(BClipboard
* clipboard
);
25 undo_state
State(bool* _isRedo
) const;
28 virtual void UndoSelf(BClipboard
* clipboard
);
29 virtual void RedoSelf(BClipboard
* clipboard
);
37 text_run_array
* fRunArray
;
38 int32 fRunArrayLength
;
48 class BTextView::CutUndoBuffer
: public BTextView::UndoBuffer
{
50 CutUndoBuffer(BTextView
* textView
);
51 virtual ~CutUndoBuffer();
54 virtual void RedoSelf(BClipboard
* clipboard
);
59 class BTextView::PasteUndoBuffer
: public BTextView::UndoBuffer
{
61 PasteUndoBuffer(BTextView
* textView
,
62 const char* text
, int32 textLength
,
63 text_run_array
* runArray
,
65 virtual ~PasteUndoBuffer();
68 virtual void UndoSelf(BClipboard
* clipboard
);
69 virtual void RedoSelf(BClipboard
* clipboard
);
73 int32 fPasteTextLength
;
74 text_run_array
* fPasteRunArray
;
79 class BTextView::ClearUndoBuffer
: public BTextView::UndoBuffer
{
81 ClearUndoBuffer(BTextView
* textView
);
82 virtual ~ClearUndoBuffer();
85 virtual void RedoSelf(BClipboard
* clipboard
);
90 class BTextView::DropUndoBuffer
: public BTextView::UndoBuffer
{
92 DropUndoBuffer(BTextView
* textView
,
93 char const* text
, int32 textLength
,
94 text_run_array
* runArray
,
95 int32 runArrayLength
, int32 location
,
97 virtual ~DropUndoBuffer();
100 virtual void UndoSelf(BClipboard
* clipboard
);
101 virtual void RedoSelf(BClipboard
* clipboard
);
105 int32 fDropTextLength
;
106 text_run_array
* fDropRunArray
;
114 class BTextView::TypingUndoBuffer
: public BTextView::UndoBuffer
{
116 TypingUndoBuffer(BTextView
* textView
);
117 virtual ~TypingUndoBuffer();
119 void InputCharacter(int32 length
);
120 void BackwardErase();
124 virtual void RedoSelf(BClipboard
* clipboard
);
125 virtual void UndoSelf(BClipboard
* clipboard
);
136 #endif //__UNDOBUFFER_H