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