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 20 #define B_PERSON_MIMETYPE "application/x-person" 21 #define APP_SIG "application/x-vnd.Be-PEPL" 22 23 struct people_field { 24 const char* attribute; 25 int32 width; 26 const char* name; 27 }; 28 extern people_field gFields[]; 29 30 enum messages{ 31 M_NEW = 128, M_SAVE, M_SAVE_AS, M_REVERT, 32 M_UNDO, M_SELECT, M_GROUP_MENU, M_DIRTY, 33 M_NAME, M_NICKNAME, M_COMPANY, M_ADDRESS, 34 M_CITY, M_STATE, M_ZIP, M_COUNTRY, M_HPHONE, 35 M_WPHONE, M_FAX, M_EMAIL, M_URL, M_GROUP 36 }; 37 38 enum fields { 39 F_NAME = 0, F_NICKNAME, F_COMPANY, F_ADDRESS, 40 F_CITY, F_STATE, F_ZIP, F_COUNTRY, F_HPHONE, 41 F_WPHONE, F_FAX, F_EMAIL, F_URL, F_GROUP, F_END 42 }; 43 44 class TPeopleWindow; 45 46 //==================================================================== 47 48 class TPeopleApp : public BApplication { 49 public: 50 TPeopleApp(void); 51 virtual ~TPeopleApp(void); 52 53 virtual void AboutRequested(void); 54 virtual void ArgvReceived(int32, char**); 55 virtual void MessageReceived(BMessage*); 56 virtual void RefsReceived(BMessage*); 57 virtual void ReadyToRun(void); 58 TPeopleWindow *FindWindow(entry_ref); 59 TPeopleWindow *NewWindow(entry_ref* = NULL); 60 61 BFile *fPrefs; 62 63 private: 64 bool fHaveWindow; 65 BRect fPosition; 66 }; 67 68 #endif /* PEOPLEAPP_H */ 69