xref: /haiku/src/apps/diskprobe/ProbeView.h (revision e85413ad6cca690cadd97dd407455e1de24600ba)
1 /*
2  * Copyright 2004-2018, Axel Dörfler, axeld@pinc-software.de.
3  * All rights reserved. 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,
28 									const char* attribute = NULL,
29 									const BMessage* settings = NULL);
30 	virtual						~ProbeView();
31 
32 	virtual	void				DetachedFromWindow();
33 	virtual	void				AttachedToWindow();
34 	virtual	void				AllAttached();
35 	virtual	void				WindowActivated(bool active);
36 	virtual	void				MessageReceived(BMessage* message);
37 
38 			void				AddSaveMenuItems(BMenu* menu, int32 index);
39 			void				AddPrintMenuItems(BMenu* menu, int32 index);
40 			void				AddViewAsMenuItems();
41 
42 			bool				QuitRequested();
43 
Editor()44 			DataEditor&			Editor() { return fEditor; }
45 
46 private:
47 			void				_UpdateAttributesMenu(BMenu* menu);
48 			void				_UpdateSelectionMenuItems(int64 start,
49 									int64 end);
50 			void				_UpdateBookmarkMenuItems();
51 			void				_AddBookmark(off_t position);
52 			void				_RemoveTypeEditor();
53 			void				_SetTypeEditor(int32 index);
54 			void				_CheckClipboard();
55 			status_t			_PageSetup();
56 			void				_Print();
57 			status_t			_Save();
58 
59 private:
60 			DataEditor			fEditor;
61 			EditorLooper*		fEditorLooper;
62 			HeaderView*			fHeaderView;
63 			DataView*			fDataView;
64 			BScrollView*		fScrollView;
65 			BMenuItem*			fPasteMenuItem;
66 			BMenuItem*			fUndoMenuItem;
67 			BMenuItem*			fRedoMenuItem;
68 			BMenuItem*			fNativeMenuItem;
69 			BMenuItem*			fSwappedMenuItem;
70 			BMenuItem*			fSaveMenuItem;
71 			BMessage*			fPrintSettings;
72 			BMenu*				fBookmarkMenu;
73 			BView*				fTypeView;
74 
75 			BMenuItem*			fFindAgainMenuItem;
76 			const uint8*		fLastSearch;
77 			size_t				fLastSearchSize;
78 };
79 
80 
81 #endif	/* PROBE_VIEW_H */
82