xref: /haiku/src/apps/mail/Header.h (revision 508f54795f39c3e7552d87c95aae9dd8ec6f505b)
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 								BEmailMessage *mail, bool resending,
86 								uint32 defaultCharacterSet,
87 								uint32 defaultChain);
88 
89 	virtual	void			MessageReceived(BMessage*);
90 	virtual	void			AttachedToWindow();
91 			status_t		LoadMessage(BEmailMessage*);
92 
93 			BPopUpMenu*		fAccountMenu;
94 			BPopUpMenu*		fEncodingMenu;
95 			int32			fChain;
96 			TTextControl*	fAccountTo;
97 			TTextControl*	fAccount;
98 			TTextControl*	fBcc;
99 			TTextControl*	fCc;
100 			TTextControl*	fSubject;
101 			TTextControl*	fTo;
102 			BStringView*	fDateLabel;
103 			BStringView*	fDate;
104 			bool			fIncoming;
105 			uint32			fCharacterSetUserSees;
106 
107 private:
108 			void			InitEmailCompletion();
109 			void			InitGroupCompletion();
110 
111 			bool			fResending;
112 			QPopupMenu*		fBccMenu;
113 			QPopupMenu*		fCcMenu;
114 			QPopupMenu*		fToMenu;
115 			BDefaultChoiceList	fEmailList;
116 };
117 
118 
119 class TTextControl : public BComboBox {
120 public:
121 							TTextControl(BRect, const char*, BMessage*, bool,
122 								bool, int32 resizingMode = B_FOLLOW_NONE);
123 
124 	virtual	void			AttachedToWindow();
125 	virtual	void			MessageReceived(BMessage*);
126 
127 			bool			HasFocus();
128 
129 private:
130 			bool			fIncoming;
131 			bool			fResending;
132 			char			fLabel[100];
133 			BPopUpMenu*		fRefDropMenu;
134 			int32			fCommand;
135 };
136 
137 #endif	/* _HEADER_H */
138 
139