xref: /haiku/src/apps/mail/MailApp.h (revision 45b01eb84189a623981270a02d21c7a8cb93a9e1)
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 <Catalog.h>
39 #include <Entry.h>
40 #include <Font.h>
41 #include <List.h>
42 #include <String.h>
43 
44 
45 class BFile;
46 class BMessenger;
47 class TMailWindow;
48 class TPrefsWindow;
49 class TSignatureWindow;
50 
51 
52 class TMailApp : public BApplication {
53 	public:
54 								TMailApp();
55 		virtual					~TMailApp();
56 
57 		virtual	void			AboutRequested();
58 		virtual	void			ArgvReceived(int32, char**);
59 		virtual	void			MessageReceived(BMessage*);
60 		virtual	bool			QuitRequested();
61 		virtual	void			ReadyToRun();
62 		virtual	void			RefsReceived(BMessage*);
63 
64 				TMailWindow*	FindWindow(const entry_ref&);
65 				void			FontChange();
66 				TMailWindow*	NewWindow(const entry_ref* rec = NULL,
67 									const char* to = NULL, bool resend = false,
68 									BMessenger* messenger = NULL);
69 
70 				void			SetPrintSettings(const BMessage* settings);
71 				bool			HasPrintSettings();
72 				BMessage		PrintSettings();
73 
74 				void			SetLastWindowFrame(BRect frame);
75 
76 				// TODO: move these into a MailSettings class
77 				bool			AutoMarkRead();
78 				BString			Signature();
79 				BString			ReplyPreamble();
80 				bool			WrapMode();
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 				BRect			fMailWindowFrame;
109 				BRect			fLastMailWindowFrame;
110 				BRect			fSignatureWindowFrame;
111 				BPoint			fPrefsWindowPos;
112 
113 				BMessage*		fPrintSettings;
114 
115 				bool			fPrintHelpAndExit;
116 
117 				// TODO: these should go into a settings class
118 				bool			fAutoMarkRead;
119 				char*			fSignature;
120 				char*			fReplyPreamble;
121 				bool			fWrapMode;
122 				bool			fAttachAttributes;
123 				bool			fColoredQuotes;
124 				uint8			fShowButtonBar;
125 				bool			fWarnAboutUnencodableCharacters;
126 				bool			fStartWithSpellCheckOn;
127 				bool			fShowSpamGUI;
128 				uint32			fDefaultChain;
129 				int32			fUseAccountFrom;
130 				uint32			fMailCharacterSet;
131 				BFont			fContentFont;
132 
133 				BCatalog		fCatalog;
134 };
135 
136 
137 #endif // #ifndef _MAIL_H
138 
139