1 /* 2 * Copyright 2010, Haiku, Inc. All rights reserved. 3 * Distributed under the terms of the MIT license. 4 * 5 * Authors: 6 * Robert Polic 7 * 8 * Copyright 1999, Be Incorporated. All Rights Reserved. 9 * This file may be used under the terms of the Be Sample Code License. 10 */ 11 #ifndef PERSON_WINDOW_H 12 #define PERSON_WINDOW_H 13 14 15 #include <String.h> 16 #include <Window.h> 17 18 19 #define TITLE_BAR_HEIGHT 25 20 #define WIND_WIDTH 420 21 #define WIND_HEIGHT 340 22 23 24 class PersonView; 25 class BFilePanel; 26 class BMenuItem; 27 28 29 class PersonWindow : public BWindow { 30 public: 31 32 PersonWindow(BRect frame, const char* title, 33 const char* nameAttribute, 34 const char* categoryAttribute, 35 const entry_ref* ref); 36 virtual ~PersonWindow(); 37 38 virtual void MenusBeginning(); 39 virtual void MessageReceived(BMessage* message); 40 virtual bool QuitRequested(); 41 virtual void Show(); 42 43 void AddAttribute(const char* label, 44 const char* attribute); 45 46 void SaveAs(); 47 48 bool RefersPersonFile(const entry_ref& ref) const; 49 50 private: 51 void _GetDefaultFileName(char* name); 52 void _SetToRef(entry_ref* ref); 53 void _WatchChanges(bool doIt); 54 55 private: 56 entry_ref* fRef; 57 58 BFilePanel* fPanel; 59 BMenuItem* fCopy; 60 BMenuItem* fCut; 61 BMenuItem* fPaste; 62 BMenuItem* fRevert; 63 BMenuItem* fSave; 64 BMenuItem* fUndo; 65 PersonView* fView; 66 67 BString fNameAttribute; 68 }; 69 70 71 #endif // PERSON_WINDOW_H 72