xref: /haiku/src/apps/mail/MailApp.h (revision 1214ef1b2100f2b3299fc9d8d6142e46f70a4c3f)
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 _MAIL_APP_H
35 #define _MAIL_APP_H
36 
37 #include <Application.h>
38 #include <Entry.h>
39 #include <Font.h>
40 #include <List.h>
41 #include <String.h>
42 
43 
44 class BFile;
45 class BMessenger;
46 class TMailWindow;
47 class TPrefsWindow;
48 class TSignatureWindow;
49 
50 
51 class TMailApp : public BApplication {
52 	public:
53 								TMailApp();
54 		virtual					~TMailApp();
55 
56 		virtual	void			AboutRequested();
57 		virtual	void			ArgvReceived(int32, char**);
58 		virtual	void			MessageReceived(BMessage*);
59 		virtual	bool			QuitRequested();
60 		virtual	void			ReadyToRun();
61 		virtual	void			RefsReceived(BMessage*);
62 
63 				TMailWindow*	FindWindow(const entry_ref&);
64 				void			FontChange();
65 				TMailWindow*	NewWindow(const entry_ref* rec = NULL,
66 									const char* to = NULL, bool resend = false,
67 									BMessenger* messenger = NULL);
68 
69 				void			SetPrintSettings(const BMessage* settings);
70 				bool			HasPrintSettings();
71 				BMessage		PrintSettings();
72 
73 				void			SetLastWindowFrame(BRect frame);
74 
75 				// TODO: move these into a MailSettings class
76 				BString			Signature();
77 				BString			ReplyPreamble();
78 				bool			WrapMode();
79 				void			SetShowHeader(bool show);
80 				bool			ShowHeader();
81 				bool			AttachAttributes();
82 				bool			ColoredQuotes();
83 				uint8			ShowButtonBar();
84 				bool			WarnAboutUnencodableCharacters();
85 				bool			StartWithSpellCheckOn();
86 				void			SetDefaultChain(uint32 chain);
87 				uint32			DefaultChain();
88 				int32			UseAccountFrom();
89 				uint32			MailCharacterSet();
90 				bool			ShowSpamGUI() const
91 									{ return fShowSpamGUI; }
92 				BFont			ContentFont();
93 
94 	private:
95 				void			_ClearPrintSettings();
96 				void			_CheckForSpamFilterExistence();
97 
98 				status_t		GetSettingsPath(BPath &path);
99 				status_t		LoadOldSettings();
100 				status_t		SaveSettings();
101 				status_t		LoadSettings();
102 
103 				BList			fWindowList;
104 				int32			fWindowCount;
105 				TPrefsWindow*	fPrefsWindow;
106 				TSignatureWindow* fSigWindow;
107 
108 				uint8			fPreviousShowButtonBar;
109 
110 				BRect			fMailWindowFrame;
111 				BRect			fLastMailWindowFrame;
112 				BRect			fSignatureWindowFrame;
113 				BPoint			fPrefsWindowPos;
114 
115 				BMessage*		fPrintSettings;
116 
117 				bool			fPrintHelpAndExit;
118 
119 				// TODO: these should go into a settings class
120 				char*			fSignature;
121 				char*			fReplyPreamble;
122 				bool			fWrapMode;
123 				bool			fShowHeader;
124 				bool			fAttachAttributes;
125 				bool			fColoredQuotes;
126 				uint8			fShowButtonBar;
127 				bool			fWarnAboutUnencodableCharacters;
128 				bool			fStartWithSpellCheckOn;
129 				bool			fShowSpamGUI;
130 				uint32			fDefaultChain;
131 				int32			fUseAccountFrom;
132 				uint32			fMailCharacterSet;
133 				BFont			fContentFont;
134 };
135 
136 
137 #endif // #ifndef _MAIL_H
138