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