1/*
2 * Copyright 2010-2023, Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT license.
4 *
5 * Authors:
6 *		Robert Polic
7 *
8 * Copyright 1999, Be Incorporated.   All Rights Reserved.
9 * This file may be used under the terms of the Be Sample Code License.
10 */
11#ifndef PERSON_WINDOW_H
12#define PERSON_WINDOW_H
13
14
15#include <String.h>
16#include <Window.h>
17
18
19#define	TITLE_BAR_HEIGHT	 32
20#define	WIND_WIDTH			420
21#define WIND_HEIGHT			600
22
23
24class PersonView;
25class BFilePanel;
26class BMenuItem;
27
28
29class PersonWindow : public BWindow {
30public:
31
32								PersonWindow(BRect frame, const char* title,
33									const char* nameAttribute,
34									const char* categoryAttribute,
35									const entry_ref* ref);
36	virtual						~PersonWindow();
37
38	virtual	void				MenusBeginning();
39	virtual	void				MessageReceived(BMessage* message);
40	virtual	bool				QuitRequested();
41	virtual	void				Show();
42
43			void				AddAttribute(const char* label,
44									const char* attribute);
45			void				SetInitialValues(BMessage* message);
46
47			void				SaveAs();
48
49			bool				RefersPersonFile(const entry_ref& ref) const;
50
51private:
52			void				_GetDefaultFileName(char* name);
53			void				_SetToRef(entry_ref* ref);
54			void				_WatchChanges(bool doIt);
55
56private:
57			entry_ref*			fRef;
58
59			BFilePanel*			fPanel;
60			BMenuItem*			fCopy;
61			BMenuItem*			fCut;
62			BMenuItem*			fPaste;
63			BMenuItem*			fRevert;
64			BMenuItem*			fSave;
65			BMenuItem*			fUndo;
66			PersonView*			fView;
67
68			BString				fNameAttribute;
69};
70
71
72#endif // PERSON_WINDOW_H
73