Mail: minor cleanup.

This commit is contained in:
Axel Dörfler 2015-08-17 20:47:08 +02:00
parent f8300bd979
commit b20d210d5a
4 changed files with 319 additions and 351 deletions

View File

@ -1253,6 +1253,13 @@ BComboBox::Text() const
} }
int32
BComboBox::TextLength() const
{
return fText->TextLength();
}
BTextView * BTextView *
BComboBox::TextView() BComboBox::TextView()
{ {

View File

@ -150,6 +150,7 @@ public:
virtual void SetLabel(const char *text); virtual void SetLabel(const char *text);
virtual void SetText(const char *text); virtual void SetText(const char *text);
const char *Text() const; const char *Text() const;
int32 TextLength() const;
BTextView *TextView(); BTextView *TextView();
virtual void SetDivider(float dividing_line); virtual void SetDivider(float dividing_line);
float Divider() const; float Divider() const;

File diff suppressed because it is too large Load Diff

View File

@ -65,153 +65,156 @@ class BMenuBar;
class BMenuItem; class BMenuItem;
class Words; class Words;
class TMailWindow : public BWindow { class TMailWindow : public BWindow {
public: public:
TMailWindow(BRect frame, const char* title, TMailWindow(BRect frame, const char* title,
TMailApp* app, const entry_ref* ref, TMailApp* app, const entry_ref* ref,
const char* to, const BFont *font, const char* to, const BFont *font,
bool resending, bool resending,
BMessenger* trackerMessenger); BMessenger* trackerMessenger);
virtual ~TMailWindow(); virtual ~TMailWindow();
virtual void FrameResized(float width, float height); virtual void FrameResized(float width, float height);
virtual void MenusBeginning(); virtual void MenusBeginning();
virtual void MessageReceived(BMessage*); virtual void MessageReceived(BMessage*);
virtual bool QuitRequested(); virtual bool QuitRequested();
virtual void Show(); virtual void Show();
virtual void Zoom(BPoint, float, float); virtual void Zoom(BPoint, float, float);
virtual void WindowActivated(bool state); virtual void WindowActivated(bool state);
void SetTo(const char* mailTo, const char* subject, void SetTo(const char* mailTo, const char* subject,
const char* ccTo = NULL, const char* ccTo = NULL,
const char* bccTo = NULL, const char* bccTo = NULL,
const BString* body = NULL, const BString* body = NULL,
BMessage* enclosures = NULL); BMessage* enclosures = NULL);
void AddSignature(BMailMessage*); void AddSignature(BMailMessage*);
void Forward(entry_ref*, TMailWindow*, void Forward(entry_ref*, TMailWindow*,
bool includeAttachments); bool includeAttachments);
void Print(); void Print();
void PrintSetup(); void PrintSetup();
void Reply(entry_ref*, TMailWindow*, uint32); void Reply(entry_ref*, TMailWindow*, uint32);
void CopyMessage(entry_ref* ref, TMailWindow* src); void CopyMessage(entry_ref* ref, TMailWindow* src);
status_t Send(bool); status_t Send(bool now);
status_t SaveAsDraft(); status_t SaveAsDraft();
status_t OpenMessage(const entry_ref* ref, status_t OpenMessage(const entry_ref* ref,
uint32 characterSetForDecoding uint32 characterSetForDecoding
= B_MAIL_NULL_CONVERSION); = B_MAIL_NULL_CONVERSION);
status_t GetMailNodeRef(node_ref &nodeRef) const; status_t GetMailNodeRef(node_ref &nodeRef) const;
BEmailMessage* Mail() const { return fMail; } BEmailMessage* Mail() const { return fMail; }
bool GetTrackerWindowFile(entry_ref*, bool GetTrackerWindowFile(entry_ref*,
bool dir) const; bool dir) const;
void SaveTrackerPosition(entry_ref*); void SaveTrackerPosition(entry_ref*);
void SetOriginatingWindow(BWindow* window); void SetOriginatingWindow(BWindow* window);
void PreserveReadingPos(bool save); void PreserveReadingPos(bool save);
void MarkMessageRead(entry_ref* message, void MarkMessageRead(entry_ref* message,
read_flags flag); read_flags flag);
void SetTrackerSelectionToCurrent(); void SetTrackerSelectionToCurrent();
TMailWindow* FrontmostWindow(); TMailWindow* FrontmostWindow();
void UpdateViews(); void UpdateViews();
void UpdatePreferences(); void UpdatePreferences();
protected: protected:
void SetTitleForMessage(); void SetTitleForMessage();
void AddEnclosure(BMessage* msg); void AddEnclosure(BMessage* msg);
void BuildToolBar(); void BuildToolBar();
status_t TrainMessageAs(const char* commandWord); status_t TrainMessageAs(const char* commandWord);
private: private:
void _UpdateSizeLimits(); void _UpdateSizeLimits();
status_t _GetQueryPath(BPath* path) const; status_t _GetQueryPath(BPath* path) const;
void _RebuildQueryMenu(bool firstTime = false); void _RebuildQueryMenu(bool firstTime = false);
char* _BuildQueryString(BEntry* entry) const; char* _BuildQueryString(BEntry* entry) const;
void _AddReadButton(); void _AddReadButton();
void _UpdateReadButton(); void _UpdateReadButton();
void _SetDownloading(bool downloading); void _SetDownloading(bool downloading);
TMailApp* fApp; static BBitmap* _RetrieveVectorIcon(int32 id);
BEmailMessage* fMail; private:
entry_ref* fRef; TMailApp* fApp;
// Reference to currently displayed file
int32 fFieldState;
BFilePanel* fPanel;
BMenuBar* fMenuBar;
BMenuItem* fAdd;
BMenuItem* fCut;
BMenuItem* fCopy;
BMenuItem* fHeader;
BMenuItem* fPaste;
BMenuItem* fPrint;
BMenuItem* fPrintSetup;
BMenuItem* fQuote;
BMenuItem* fRaw;
BMenuItem* fRemove;
BMenuItem* fRemoveQuote;
BMenuItem* fSendNow;
BMenuItem* fSendLater;
BMenuItem* fUndo;
BMenuItem* fRedo;
BMenuItem* fNextMsg;
BMenuItem* fPrevMsg;
BMenuItem* fDeleteNext;
BMenuItem* fSpelling;
BMenu* fSaveAddrMenu;
BMenu* fQueryMenu; BEmailMessage* fMail;
BMenu* fLeaveStatusMenu; entry_ref* fRef;
// Reference to currently displayed file
int32 fFieldState;
BFilePanel* fPanel;
BMenuBar* fMenuBar;
BMenuItem* fAdd;
BMenuItem* fCut;
BMenuItem* fCopy;
BMenuItem* fHeader;
BMenuItem* fPaste;
BMenuItem* fPrint;
BMenuItem* fPrintSetup;
BMenuItem* fQuote;
BMenuItem* fRaw;
BMenuItem* fRemove;
BMenuItem* fRemoveQuote;
BMenuItem* fSendNow;
BMenuItem* fSendLater;
BMenuItem* fUndo;
BMenuItem* fRedo;
BMenuItem* fNextMsg;
BMenuItem* fPrevMsg;
BMenuItem* fDeleteNext;
BMenuItem* fSpelling;
BMenu* fSaveAddrMenu;
static BBitmap* _RetrieveVectorIcon(int32 id); BMenu* fQueryMenu;
struct BitmapItem { BMenu* fLeaveStatusMenu;
BBitmap* bm;
int32 id;
};
static BObjectList<BitmapItem> fBitmapCache;
static BLocker fBitmapCacheLock;
BToolBar* fToolBar; struct BitmapItem {
BBitmap* bm;
int32 id;
};
static BObjectList<BitmapItem> sBitmapCache;
static BLocker sBitmapCacheLock;
BRect fZoom; BToolBar* fToolBar;
TContentView* fContentView;
THeaderView* fHeaderView;
TEnclosuresView* fEnclosuresView;
TMenu* fSignature;
BMessenger fTrackerMessenger; BRect fZoom;
// Talks to tracker window that this was launched from. TContentView* fContentView;
BMessenger fMessengerToSpamServer; THeaderView* fHeaderView;
TEnclosuresView* fEnclosuresView;
TMenu* fSignature;
entry_ref fPrevRef; BMessenger fTrackerMessenger;
entry_ref fNextRef; // Talks to tracker window that this was launched from.
bool fPrevTrackerPositionSaved : 1; BMessenger fMessengerToSpamServer;
bool fNextTrackerPositionSaved : 1;
entry_ref fOpenFolder; entry_ref fPrevRef;
entry_ref fNextRef;
bool fPrevTrackerPositionSaved : 1;
bool fNextTrackerPositionSaved : 1;
bool fSigAdded : 1; entry_ref fOpenFolder;
bool fIncoming : 1;
bool fReplying : 1;
bool fResending : 1;
bool fSent : 1;
bool fDraft : 1;
bool fChanged : 1;
static BList sWindowList; bool fSigAdded : 1;
static BLocker sWindowListLock; bool fIncoming : 1;
bool fReplying : 1;
bool fResending : 1;
bool fSent : 1;
bool fDraft : 1;
bool fChanged : 1;
entry_ref fRepliedMail; static BList sWindowList;
BMessenger* fOriginatingWindow; static BLocker sWindowListLock;
bool fAutoMarkRead : 1; entry_ref fRepliedMail;
bool fKeepStatusOnQuit; BMessenger* fOriginatingWindow;
bool fDownloading; bool fAutoMarkRead : 1;
bool fKeepStatusOnQuit;
bool fDownloading;
}; };
#endif // _MAIL_WINDOW_H
#endif // _MAIL_WINDOW_H