1 //-------------------------------------------------------------------- 2 // 3 // PeopleApp.h 4 // 5 // Written by: Robert Polic 6 // 7 //-------------------------------------------------------------------- 8 /* 9 Copyright 1999, Be Incorporated. All Rights Reserved. 10 This file may be used under the terms of the Be Sample Code License. 11 */ 12 13 #ifndef PEOPLEAPP_H 14 #define PEOPLEAPP_H 15 16 17 #include <Application.h> 18 19 class BFile; 20 21 22 #define B_PERSON_MIMETYPE "application/x-person" 23 #define APP_SIG "application/x-vnd.Be-PEPL" 24 25 struct people_field { 26 const char* attribute; 27 int32 width; 28 const char* name; 29 }; 30 extern people_field gFields[]; 31 32 enum messages{ 33 M_NEW = 128, M_SAVE, M_SAVE_AS, M_REVERT, 34 M_UNDO, M_SELECT, M_GROUP_MENU, M_DIRTY, 35 M_NAME, M_NICKNAME, M_COMPANY, M_ADDRESS, 36 M_CITY, M_STATE, M_ZIP, M_COUNTRY, M_HPHONE, 37 M_WPHONE, M_FAX, M_EMAIL, M_URL, M_GROUP, 38 M_WINDOW_QUITS 39 }; 40 41 enum fields { 42 F_NAME = 0, F_NICKNAME, F_COMPANY, F_ADDRESS, 43 F_CITY, F_STATE, F_ZIP, F_COUNTRY, F_HPHONE, 44 F_WPHONE, F_FAX, F_EMAIL, F_URL, F_GROUP, F_END 45 }; 46 47 class TPeopleWindow; 48 49 //==================================================================== 50 51 class TPeopleApp : public BApplication { 52 public: 53 TPeopleApp(void); 54 virtual ~TPeopleApp(void); 55 56 virtual void AboutRequested(void); 57 virtual void ArgvReceived(int32, char**); 58 virtual void MessageReceived(BMessage*); 59 virtual void RefsReceived(BMessage*); 60 virtual void ReadyToRun(void); 61 TPeopleWindow *FindWindow(entry_ref); 62 TPeopleWindow *NewWindow(entry_ref* = NULL); 63 64 BFile *fPrefs; 65 66 private: 67 void SavePreferences(BMessage* message); 68 69 uint32 fWindowCount; 70 BRect fPosition; 71 }; 72 73 #endif /* PEOPLEAPP_H */ 74 75