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(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 void AddViewAsMenuItems(); 40 41 void UpdateSizeLimits(); 42 bool QuitRequested(); 43 44 DataEditor& Editor() { return fEditor; } 45 46 private: 47 void _UpdateAttributesMenu(BMenu* menu); 48 void _UpdateSelectionMenuItems(int64 start, int64 end); 49 void _UpdateBookmarkMenuItems(); 50 void _AddBookmark(off_t position); 51 void _RemoveTypeEditor(); 52 void _SetTypeEditor(int32 index); 53 void _CheckClipboard(); 54 status_t _PageSetup(); 55 void _Print(); 56 status_t _Save(); 57 58 DataEditor fEditor; 59 EditorLooper* fEditorLooper; 60 HeaderView* fHeaderView; 61 DataView* fDataView; 62 BScrollView* fScrollView; 63 BMenuItem* fPasteMenuItem; 64 BMenuItem* fUndoMenuItem; 65 BMenuItem* fRedoMenuItem; 66 BMenuItem* fNativeMenuItem; 67 BMenuItem* fSwappedMenuItem; 68 BMenuItem* fSaveMenuItem; 69 BMessage* fPrintSettings; 70 BMenu* fBookmarkMenu; 71 BView* fTypeView; 72 73 BMenuItem* fFindAgainMenuItem; 74 const uint8* fLastSearch; 75 size_t fLastSearchSize; 76 }; 77 78 #endif /* PROBE_VIEW_H */ 79