xref: /haiku/src/apps/diskprobe/ProbeView.h (revision 1d9d47fc72028bb71b5f232a877231e59cfe2438)
1 /*
2  * Copyright 2004-2006, 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(BRect rect, 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 
40 		void UpdateSizeLimits();
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 CheckClipboard();
51 		status_t PageSetup();
52 		void Print();
53 		status_t Save();
54 
55 		DataEditor		fEditor;
56 		EditorLooper	*fEditorLooper;
57 		HeaderView		*fHeaderView;
58 		DataView		*fDataView;
59 		BScrollView		*fScrollView;
60 		BMenuItem		*fPasteMenuItem;
61 		BMenuItem		*fUndoMenuItem, *fRedoMenuItem;
62 		BMenuItem		*fNativeMenuItem, *fSwappedMenuItem;
63 		BMenuItem		*fSaveMenuItem;
64 		BMessage		*fPrintSettings;
65 		BMenu			*fBookmarkMenu;
66 
67 		BMenuItem		*fFindAgainMenuItem;
68 		const uint8		*fLastSearch;
69 		size_t			fLastSearchSize;
70 };
71 
72 #endif	/* PROBE_VIEW_H */
73