xref: /haiku/src/apps/diskprobe/ProbeView.h (revision 4bd0c1066b227cec4b79883bdef697c7a27f2e90)
1 /*
2  * Copyright 2004-2008, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef PROBE_VIEW_H
6 #define PROBE_VIEW_H
7 
8 
9 #include "DataEditor.h"
10 
11 #include <View.h>
12 #include <String.h>
13 #include <Path.h>
14 
15 
16 class BScrollView;
17 class BMenuItem;
18 class BMenu;
19 
20 class HeaderView;
21 class DataView;
22 class EditorLooper;
23 
24 
25 class ProbeView : public BView {
26 	public:
27 		ProbeView(entry_ref* ref, const char* attribute = NULL,
28 			const BMessage* settings = NULL);
29 		virtual ~ProbeView();
30 
31 		virtual void DetachedFromWindow();
32 		virtual void AttachedToWindow();
33 		virtual void AllAttached();
34 		virtual void WindowActivated(bool active);
35 		virtual void MessageReceived(BMessage* message);
36 
37 		void AddSaveMenuItems(BMenu* menu, int32 index);
38 		void AddPrintMenuItems(BMenu* menu, int32 index);
39 		void AddViewAsMenuItems();
40 
41 		bool QuitRequested();
42 
43 		DataEditor& Editor() { return fEditor; }
44 
45 	private:
46 		void _UpdateAttributesMenu(BMenu* menu);
47 		void _UpdateSelectionMenuItems(int64 start, int64 end);
48 		void _UpdateBookmarkMenuItems();
49 		void _AddBookmark(off_t position);
50 		void _RemoveTypeEditor();
51 		void _SetTypeEditor(int32 index);
52 		void _CheckClipboard();
53 		status_t _PageSetup();
54 		void _Print();
55 		status_t _Save();
56 
57 		DataEditor		fEditor;
58 		EditorLooper*	fEditorLooper;
59 		HeaderView*		fHeaderView;
60 		DataView*		fDataView;
61 		BScrollView*	fScrollView;
62 		BMenuItem*		fPasteMenuItem;
63 		BMenuItem*		fUndoMenuItem;
64 		BMenuItem*		fRedoMenuItem;
65 		BMenuItem*		fNativeMenuItem;
66 		BMenuItem*		fSwappedMenuItem;
67 		BMenuItem*		fSaveMenuItem;
68 		BMessage*		fPrintSettings;
69 		BMenu*			fBookmarkMenu;
70 		BView*			fTypeView;
71 
72 		BMenuItem*		fFindAgainMenuItem;
73 		const uint8*	fLastSearch;
74 		size_t			fLastSearchSize;
75 };
76 
77 #endif	/* PROBE_VIEW_H */
78