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 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 bool AutoMarkRead(); 77 BString Signature(); 78 BString ReplyPreamble(); 79 bool WrapMode(); 80 bool AttachAttributes(); 81 bool ColoredQuotes(); 82 uint8 ShowButtonBar(); 83 bool WarnAboutUnencodableCharacters(); 84 bool StartWithSpellCheckOn(); 85 void SetDefaultAccount(int32 account); 86 int32 DefaultAccount(); 87 int32 UseAccountFrom(); 88 uint32 MailCharacterSet(); 89 bool ShowSpamGUI() const 90 { return fShowSpamGUI; } 91 BFont ContentFont(); 92 93 private: 94 void _ClearPrintSettings(); 95 void _CheckForSpamFilterExistence(); 96 97 status_t GetSettingsPath(BPath &path); 98 status_t LoadOldSettings(); 99 status_t SaveSettings(); 100 status_t LoadSettings(); 101 102 BList fWindowList; 103 int32 fWindowCount; 104 TPrefsWindow* fPrefsWindow; 105 TSignatureWindow* fSigWindow; 106 107 BRect fMailWindowFrame; 108 BRect fLastMailWindowFrame; 109 BRect fSignatureWindowFrame; 110 BPoint fPrefsWindowPos; 111 112 BMessage* fPrintSettings; 113 114 bool fPrintHelpAndExit; 115 116 // TODO: these should go into a settings class 117 bool fAutoMarkRead; 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 int32 fDefaultAccount; 128 int32 fUseAccountFrom; 129 uint32 fMailCharacterSet; 130 BFont fContentFont; 131 }; 132 133 134 #endif // #ifndef _MAIL_H 135 136