xref: /haiku/src/apps/mail/MailApp.h (revision 746cac055adc6ac3308c7bc2d29040fb95689cc9)
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 				bool			AttachAttributes();
80 				bool			ColoredQuotes();
81 				uint8			ShowButtonBar();
82 				bool			WarnAboutUnencodableCharacters();
83 				bool			StartWithSpellCheckOn();
84 				void			SetDefaultChain(uint32 chain);
85 				uint32			DefaultChain();
86 				int32			UseAccountFrom();
87 				uint32			MailCharacterSet();
88 				bool			ShowSpamGUI() const
89 									{ return fShowSpamGUI; }
90 				BFont			ContentFont();
91 
92 	private:
93 				void			_ClearPrintSettings();
94 				void			_CheckForSpamFilterExistence();
95 
96 				status_t		GetSettingsPath(BPath &path);
97 				status_t		LoadOldSettings();
98 				status_t		SaveSettings();
99 				status_t		LoadSettings();
100 
101 				BList			fWindowList;
102 				int32			fWindowCount;
103 				TPrefsWindow*	fPrefsWindow;
104 				TSignatureWindow* fSigWindow;
105 
106 				uint8			fPreviousShowButtonBar;
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 				char*			fSignature;
119 				char*			fReplyPreamble;
120 				bool			fWrapMode;
121 				bool			fAttachAttributes;
122 				bool			fColoredQuotes;
123 				uint8			fShowButtonBar;
124 				bool			fWarnAboutUnencodableCharacters;
125 				bool			fStartWithSpellCheckOn;
126 				bool			fShowSpamGUI;
127 				uint32			fDefaultChain;
128 				int32			fUseAccountFrom;
129 				uint32			fMailCharacterSet;
130 				BFont			fContentFont;
131 };
132 
133 
134 #endif // #ifndef _MAIL_H
135