xref: /haiku/src/apps/mail/Header.h (revision 579f1dbca962a2a03df54f69fdc6e9423f91f20e)
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 _HEADER_H
35 #define _HEADER_H
36 
37 
38 #include "ComboBox.h"
39 
40 #include <Box.h>
41 #include <NodeInfo.h>
42 #include <Point.h>
43 #include <Rect.h>
44 #include <TextControl.h>
45 #include <View.h>
46 #include <Window.h>
47 #include <fs_attr.h>
48 
49 
50 #define TO_FIELD_H			 39
51 #define FROM_FIELD_H		 31
52 #define TO_FIELD_V			  7
53 #define TO_FIELD_WIDTH		270
54 #define FROM_FIELD_WIDTH	280
55 
56 #define ACCOUNT_FIELD_WIDTH	165
57 
58 #define SUBJECT_FIELD_H		 18
59 #define SUBJECT_FIELD_V		 33
60 #define SUBJECT_FIELD_WIDTH	270
61 #define SUBJECT_FIELD_HEIGHT 16
62 
63 #define CC_FIELD_H			 40
64 #define CC_FIELD_V			 58
65 #define CC_FIELD_WIDTH		192
66 #define CC_FIELD_HEIGHT		 16
67 
68 #define BCC_FIELD_H			268
69 #define BCC_FIELD_V			 58
70 #define BCC_FIELD_WIDTH		197
71 #define BCC_FIELD_HEIGHT	 16
72 
73 class BFile;
74 class BMenuField;
75 class BMenuItem;
76 class BPopUpMenu;
77 class BStringView;
78 class QPopupMenu;
79 class TTextControl;
80 
81 
82 class THeaderView : public BBox {
83 public:
84 							THeaderView(BRect, BRect, bool incoming,
85 								bool resending, uint32 defaultCharacterSet,
86 								int32 defaultAccount);
87 
88 	virtual	void			MessageReceived(BMessage*);
89 	virtual	void			AttachedToWindow();
90 			status_t		LoadMessage(BEmailMessage*);
91 
92 			BPopUpMenu*		fAccountMenu;
93 			BPopUpMenu*		fEncodingMenu;
94 			int32			fAccountID;
95 			TTextControl*	fAccountTo;
96 			TTextControl*	fAccount;
97 			TTextControl*	fBcc;
98 			TTextControl*	fCc;
99 			TTextControl*	fSubject;
100 			TTextControl*	fTo;
101 			BStringView*	fDateLabel;
102 			BStringView*	fDate;
103 			bool			fIncoming;
104 			uint32			fCharacterSetUserSees;
105 
106 private:
107 			void			InitEmailCompletion();
108 			void			InitGroupCompletion();
109 
110 			bool			fResending;
111 			QPopupMenu*		fBccMenu;
112 			QPopupMenu*		fCcMenu;
113 			QPopupMenu*		fToMenu;
114 			BDefaultChoiceList	fEmailList;
115 };
116 
117 
118 class TTextControl : public BComboBox {
119 public:
120 							TTextControl(BRect, const char*, BMessage*, bool,
121 								bool, int32 resizingMode = B_FOLLOW_NONE);
122 
123 	virtual	void			AttachedToWindow();
124 	virtual	void			MessageReceived(BMessage*);
125 
126 			bool			HasFocus();
127 
128 private:
129 			bool			fIncoming;
130 			bool			fResending;
131 			char			fLabel[100];
132 			BPopUpMenu*		fRefDropMenu;
133 			int32			fCommand;
134 };
135 
136 #endif	/* _HEADER_H */
137 
138