1/*
2Open Tracker License
3
4Terms and Conditions
5
6Copyright (c) 1991-2001, Be Incorporated. All rights reserved.
7
8Permission is hereby granted, free of charge, to any person obtaining a copy of
9this software and associated documentation files (the "Software"), to deal in
10the Software without restriction, including without limitation the rights to
11use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
12of the Software, and to permit persons to whom the Software is furnished to do
13so, subject to the following conditions:
14
15The above copyright notice and this permission notice applies to all licensees
16and shall be included in all copies or substantial portions of the Software.
17
18THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF TITLE, MERCHANTABILITY,
20FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
21BE INCORPORATED BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
22AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION
23WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24
25Except as contained in this notice, the name of Be Incorporated shall not be
26used in advertising or otherwise to promote the sale, use or other dealings in
27this Software without prior written authorization from Be Incorporated.
28
29BeMail(TM), Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks
30of Be Incorporated in the United States and other countries. Other brand product
31names are registered trademarks or trademarks of their respective holders.
32All rights reserved.
33*/
34#ifndef _PREFS_H
35#define _PREFS_H
36
37
38#include <Font.h>
39#include <Window.h>
40
41class BButton;
42class BMenu;
43class BPopUpMenu;
44class BTextControl;
45
46
47#define ACCOUNT_USE_DEFAULT	0
48#define ACCOUNT_FROM_MAIL	1
49
50#define	PREF_WIDTH			340
51#define PREF_HEIGHT			330
52
53struct EncodingItem {
54			char*				name;
55			uint32				flavor;
56};
57
58extern const EncodingItem kEncodings[];
59
60
61class TPrefsWindow : public BWindow {
62public:
63								TPrefsWindow(BRect rect, BFont* font,
64									int32* level, bool* warp,
65									bool* attachAttributes, bool* cquotes,
66									int32* account, int32* replyTo,
67									char** preamble, char** sig,
68									uint32* encoding, bool* warnUnencodable,
69									bool* spellCheckStartOn,
70									bool* autoMarkRead, uint8* buttonBar);
71	virtual						~TPrefsWindow();
72
73	virtual	void				MessageReceived(BMessage* message);
74
75private:
76			BPopUpMenu*			_BuildFontMenu(BFont*);
77			BPopUpMenu*			_BuildLevelMenu(int32);
78			BPopUpMenu*			_BuildAccountMenu(int32);
79			BPopUpMenu*			_BuildReplyToMenu(int32);
80			BMenu*				_BuildReplyPreambleMenu();
81			BPopUpMenu*			_BuildSignatureMenu(char*);
82			BPopUpMenu*			_BuildSizeMenu(BFont*);
83			BPopUpMenu*			_BuildWrapMenu(bool);
84			BPopUpMenu*			_BuildAttachAttributesMenu(bool);
85			BPopUpMenu*			_BuildColoredQuotesMenu(bool quote);
86			BPopUpMenu*			_BuildEncodingMenu(uint32 encoding);
87			BPopUpMenu*			_BuildWarnUnencodableMenu(
88									bool warnUnencodable);
89			BPopUpMenu*			_BuildSpellCheckStartOnMenu(
90									bool spellCheckStartOn);
91			BPopUpMenu*			_BuildAutoMarkReadMenu(
92									bool autoMarkRead);
93			BPopUpMenu*			_BuildButtonBarMenu(uint8 show);
94
95			BPopUpMenu*			_BuildBoolMenu(uint32 msg,
96									const char* boolItem, bool isTrue);
97
98			bool*				fNewWrap;
99			bool				fWrap;
100			bool*				fNewAttachAttributes;
101			bool				fAttachAttributes;
102			uint8*				fNewButtonBar;
103			uint8				fButtonBar;
104			bool*				fNewColoredQuotes;
105			bool				fColoredQuotes;
106			int32*				fNewAccount;
107			int32				fAccount;
108			int32*				fNewReplyTo;
109			int32				fReplyTo;
110
111			char**				fNewPreamble;
112
113			char**				fNewSignature;
114			char*				fSignature;
115			BFont*				fNewFont;
116			BFont				fFont;
117			uint32*				fNewEncoding;
118			uint32				fEncoding;
119			bool*				fNewWarnUnencodable;
120			bool				fWarnUnencodable;
121			bool*				fNewSpellCheckStartOn;
122			bool				fSpellCheckStartOn;
123			bool*				fNewAutoMarkRead;
124			bool				fAutoMarkRead;
125
126			BButton*			fRevert;
127
128			BPopUpMenu*			fFontMenu;
129			BPopUpMenu*			fSizeMenu;
130			BPopUpMenu*			fWrapMenu;
131			BPopUpMenu*			fColoredQuotesMenu;
132			BPopUpMenu*			fAttachAttributesMenu;
133			BPopUpMenu*			fAccountMenu;
134			BPopUpMenu*			fReplyToMenu;
135			BMenu*				fReplyPreambleMenu;
136			BTextControl*		fReplyPreamble;
137			BPopUpMenu*			fSignatureMenu;
138			BPopUpMenu*			fEncodingMenu;
139			BPopUpMenu*			fWarnUnencodableMenu;
140			BPopUpMenu*			fSpellCheckStartOnMenu;
141			BPopUpMenu*			fButtonBarMenu;
142			BPopUpMenu*			fAutoMarkReadMenu;
143};
144
145#endif	/* _PREFS_H */
146
147