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