xref: /haiku/src/apps/people/PeopleApp.h (revision 0562493379cd52eb7103531f895f10bb8e77c085)
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 };
39 
40 enum fields {
41 	F_NAME = 0, F_NICKNAME, F_COMPANY, F_ADDRESS,
42 	F_CITY, F_STATE, F_ZIP, F_COUNTRY, F_HPHONE,
43 	F_WPHONE, F_FAX, F_EMAIL, F_URL, F_GROUP, F_END
44 };
45 
46 class TPeopleWindow;
47 
48 //====================================================================
49 
50 class TPeopleApp : public BApplication {
51 	public:
52 		TPeopleApp(void);
53 		virtual ~TPeopleApp(void);
54 
55 		virtual void	AboutRequested(void);
56 		virtual void	ArgvReceived(int32, char**);
57 		virtual void	MessageReceived(BMessage*);
58 		virtual void	RefsReceived(BMessage*);
59 		virtual void	ReadyToRun(void);
60 		TPeopleWindow	*FindWindow(entry_ref);
61 		TPeopleWindow	*NewWindow(entry_ref* = NULL);
62 
63 		BFile			*fPrefs;
64 
65 	private:
66 		bool			fHaveWindow;
67 		BRect			fPosition;
68 };
69 
70 #endif /* PEOPLEAPP_H */
71