xref: /haiku/src/apps/people/PeopleApp.h (revision d374a27286b8a52974a97dba0d5966ea026a665d)
1 /*
2  * Copyright 2005-2010, Haiku, Inc. All rights reserved.
3  * Distributed under the terms of the MIT license.
4  *
5  * Authors:
6  *		Robert Polic
7  *		Stephan Aßmus <superstippi@gmx.de>
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 #ifndef PEOPLE_APP_H
13 #define PEOPLE_APP_H
14 
15 
16 #include <Application.h>
17 #include <ObjectList.h>
18 #include <String.h>
19 
20 
21 #define	B_PERSON_MIMETYPE	"application/x-person"
22 #define APP_SIG				"application/x-vnd.Be-PEPL"
23 
24 
25 class BFile;
26 
27 enum {
28 	M_NEW					= 'newp',
29 	M_SAVE_AS				= 'svas',
30 	M_WINDOW_QUITS			= 'wndq',
31 	M_CONFIGURE_ATTRIBUTES	= 'catr'
32 };
33 
34 class PersonWindow;
35 
36 class TPeopleApp : public BApplication {
37 public:
38 								TPeopleApp();
39 		virtual 				~TPeopleApp();
40 
41 		virtual	void			AboutRequested();
42 		virtual void			ArgvReceived(int32, char**);
43 		virtual void			MessageReceived(BMessage*);
44 		virtual void			RefsReceived(BMessage*);
45 		virtual void			ReadyToRun();
46 
47 private:
48 				PersonWindow*	_FindWindow(const entry_ref&) const;
49 				PersonWindow*	_NewWindow(entry_ref* = NULL);
50 				void			_AddAttributes(PersonWindow* window) const;
51 				void			_SavePreferences(BMessage* message) const;
52 
53 private:
54 				BFile*			fPrefs;
55 				uint32			fWindowCount;
56 				BRect			fPosition;
57 
58 				struct Attribute {
59 					BString		attribute;
60 					int32		width;
61 					BString		name;
62 				};
63 
64 				BObjectList<Attribute> fAttributes;
65 };
66 
67 #endif // PEOPLE_APP_H
68 
69