xref: /haiku/src/apps/stylededit/StyledEditView.h (revision 31139022cd3056691fc8d6f64b2d9ffa9a101de3)
1 /*
2  * Copyright 2002-2006, Haiku, Inc. All Rights Reserved.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  *		Mattias Sundblad
7  *		Andrew Bachmann
8  */
9 #ifndef STYLED_EDIT_VIEW_H
10 #define STYLED_EDIT_VIEW_H
11 
12 
13 #include <File.h>
14 #include <TextView.h>
15 #include <DataIO.h>
16 
17 
18 class StyledEditView : public BTextView {
19 	public:
20 		StyledEditView(BRect viewframe, BRect textframe, BHandler *handler);
21 		virtual ~StyledEditView();
22 
23 		virtual void Select(int32 start, int32 finish);
24 		virtual void FrameResized(float width, float height);
25 
26 		virtual void Reset();
27 		virtual status_t GetStyledText(BPositionIO * stream);
28 		virtual status_t WriteStyledEditFile(BFile * file);
29 
30 		virtual void SetEncoding(uint32 encoding);
31 		virtual uint32 GetEncoding() const;
32 
33 	protected:
34 		virtual void InsertText(const char *text, int32 length, int32 offset, const text_run_array *runs = NULL);
35 		virtual void DeleteText(int32 start, int32 finish);
36 
37 	private:
38 		BHandler	*fHandler;
39 		BMessage	*fChangeMessage;
40 		BMessenger 	*fMessenger;
41 		bool		fSuppressChanges;
42 		uint32		fEncoding;
43 };
44 
45 #endif	// STYLED_EDIT_VIEW_H
46