From d74618871952e28f4550c4381bfdef3d14d6ef3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Sundstr=C3=B6m?= Date: Sat, 9 Jan 2010 20:01:25 +0000 Subject: [PATCH] Humble beginnings of a code style correction. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34976 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/mail/AutoTextControl.cpp | 1 + src/apps/mail/AutoTextControl.h | 1 + src/apps/mail/BmapButton.h | 1 + src/apps/mail/ButtonBar.cpp | 1 + src/apps/mail/ButtonBar.h | 1 + src/apps/mail/ComboBox.h | 1 + src/apps/mail/Content.h | 1 + src/apps/mail/Enclosures.h | 1 + src/apps/mail/FieldMsg.h | 1 + src/apps/mail/FindWindow.cpp | 27 +++-- src/apps/mail/FindWindow.h | 5 +- src/apps/mail/Header.cpp | 3 + src/apps/mail/Header.h | 82 +++++++------- src/apps/mail/KUndoBuffer.cpp | 173 ++++++++++++------------------ src/apps/mail/KUndoBuffer.h | 107 +++++++++--------- src/apps/mail/MailPopUpMenu.h | 27 ++--- src/apps/mail/MailWindow.cpp | 1 + src/apps/mail/MailWindow.h | 1 + src/apps/mail/Messages.h | 1 + src/apps/mail/Prefs.cpp | 2 +- src/apps/mail/QueryMenu.h | 1 + src/apps/mail/Status.h | 1 + src/apps/mail/Utilities.h | 1 + src/apps/mail/WIndex.h | 1 + src/apps/mail/Words.cpp | 1 + src/apps/mail/Words.h | 1 + 26 files changed, 217 insertions(+), 227 deletions(-) diff --git a/src/apps/mail/AutoTextControl.cpp b/src/apps/mail/AutoTextControl.cpp index e7a92de7dc..4bdf2c1ace 100644 --- a/src/apps/mail/AutoTextControl.cpp +++ b/src/apps/mail/AutoTextControl.cpp @@ -245,3 +245,4 @@ AutoTextControl::SetFilter(AutoTextControlFilter *filter) if (Window()) Window()->AddCommonFilter(fFilter); } + diff --git a/src/apps/mail/AutoTextControl.h b/src/apps/mail/AutoTextControl.h index d429bb6c1f..5f617e050b 100644 --- a/src/apps/mail/AutoTextControl.h +++ b/src/apps/mail/AutoTextControl.h @@ -75,3 +75,4 @@ private: }; #endif + diff --git a/src/apps/mail/BmapButton.h b/src/apps/mail/BmapButton.h index f44b1afd82..75fd835e87 100644 --- a/src/apps/mail/BmapButton.h +++ b/src/apps/mail/BmapButton.h @@ -85,3 +85,4 @@ private: }; #endif // #ifndef _BMAP_BUTTON_H + diff --git a/src/apps/mail/ButtonBar.cpp b/src/apps/mail/ButtonBar.cpp index 1a3d852136..c9ebcfe2c4 100644 --- a/src/apps/mail/ButtonBar.cpp +++ b/src/apps/mail/ButtonBar.cpp @@ -234,3 +234,4 @@ ButtonBar::ShowLabels(bool show) } fShowLabels = show; } + diff --git a/src/apps/mail/ButtonBar.h b/src/apps/mail/ButtonBar.h index 3350861ccf..7c52dab7cf 100644 --- a/src/apps/mail/ButtonBar.h +++ b/src/apps/mail/ButtonBar.h @@ -80,3 +80,4 @@ protected: }; #endif // #ifndef _BUTTON_BAR_H + diff --git a/src/apps/mail/ComboBox.h b/src/apps/mail/ComboBox.h index 0ed4b1c734..35f6321c7f 100644 --- a/src/apps/mail/ComboBox.h +++ b/src/apps/mail/ComboBox.h @@ -229,3 +229,4 @@ private: }; #endif // #ifndef _COMBOBOX_H + diff --git a/src/apps/mail/Content.h b/src/apps/mail/Content.h index ab7af445e7..02a80b2134 100644 --- a/src/apps/mail/Content.h +++ b/src/apps/mail/Content.h @@ -303,3 +303,4 @@ extern void FillInQuoteTextRuns(BTextView* view, quote_context* context, int32 maxStyles = 5); #endif /* #ifndef _CONTENT_H */ + diff --git a/src/apps/mail/Enclosures.h b/src/apps/mail/Enclosures.h index 28675049ac..101650fa59 100644 --- a/src/apps/mail/Enclosures.h +++ b/src/apps/mail/Enclosures.h @@ -127,3 +127,4 @@ class TListItem : public BListItem }; #endif // #ifndef _ENCLOSURES_H + diff --git a/src/apps/mail/FieldMsg.h b/src/apps/mail/FieldMsg.h index 07ed40edd6..4d827ee2a2 100644 --- a/src/apps/mail/FieldMsg.h +++ b/src/apps/mail/FieldMsg.h @@ -48,3 +48,4 @@ enum { }; #endif // #ifndef _FIELD_MSG_H + diff --git a/src/apps/mail/FindWindow.cpp b/src/apps/mail/FindWindow.cpp index ec0a4b2d90..da4c0626f3 100644 --- a/src/apps/mail/FindWindow.cpp +++ b/src/apps/mail/FindWindow.cpp @@ -59,9 +59,7 @@ enum { M_FIND_STRING_CHANGED = 'fsch' }; -void TextBevel(BView& view, BRect r); -// ============================================================================ void TextBevel(BView& view, BRect r) { r.InsetBy(-1,-1); @@ -96,7 +94,8 @@ void FindWindow::DoFind(BWindow *window, const char *text) { if (window == NULL) { long i=0; - while ((bool)(window = be_app->WindowAt(i++))) { // Send the text to a waiting window + while ((bool)(window = be_app->WindowAt(i++))) { + // Send the text to a waiting window if (window != mFindWindow) if (dynamic_cast(window) != NULL) break; // Found a window @@ -129,9 +128,10 @@ FindPanel::FindPanel(BRect rect) { BRect r = Bounds().InsetByCopy(10,10); - mBTextControl = new AutoTextControl(r,"BTextControl",NULL,sPreviousFind.String(), - new BMessage(M_FIND_STRING_CHANGED), - B_FOLLOW_LEFT_RIGHT | B_FOLLOW_TOP); + mBTextControl = new AutoTextControl(r,"BTextControl",NULL, + sPreviousFind.String(), new BMessage(M_FIND_STRING_CHANGED), + B_FOLLOW_LEFT_RIGHT | B_FOLLOW_TOP); + mBTextControl->SetText(sPreviousFind.String()); mBTextControl->MakeFocus(); mBTextControl->SetEscapeCancel(true); @@ -163,7 +163,8 @@ void FindPanel::AttachedToWindow() mBTextControl->SetTarget(this); mBTextControl->ResizeToPreferred(); - mBTextControl->ResizeTo(Bounds().Width() - 20, mBTextControl->Frame().Height()); + mBTextControl->ResizeTo(Bounds().Width() - 20, + mBTextControl->Frame().Height()); mBTextControl->MakeFocus(true); mBTextControl->TextView()->SelectAll(); @@ -211,6 +212,7 @@ void FindPanel::MessageReceived(BMessage *msg) } } + void FindPanel::Find() { mBTextControl->TextView()->SelectAll(); @@ -219,7 +221,8 @@ void FindPanel::Find() BWindow *window = NULL; long i=0; - while ((bool)(window = be_app->WindowAt(i++))) { // Send the text to a waiting window + while ((bool)(window = be_app->WindowAt(i++))) { + // Send the text to a waiting window if (window != FindWindow::mFindWindow) break; // Found a window } @@ -228,8 +231,6 @@ void FindPanel::Find() FindWindow::DoFind(window, text); } -// ============================================================================ - FindWindow::FindWindow() : BWindow(FindWindow::mLastPosition, @@ -243,12 +244,14 @@ FindWindow::FindWindow() Show(); } + FindWindow::~FindWindow() { FindWindow::mLastPosition = Frame(); mFindWindow = NULL; } + void FindWindow::Find(BWindow *window) { // eliminate unused parameter warning @@ -260,6 +263,7 @@ void FindWindow::Find(BWindow *window) mFindWindow->Activate(); } + void FindWindow::FindAgain(BWindow *window) { if (mFindWindow) { @@ -272,12 +276,15 @@ void FindWindow::FindAgain(BWindow *window) Find(window); } + void FindWindow::SetFindString(const char *string) { sPreviousFind = string; } + const char *FindWindow::GetFindString() { return sPreviousFind.String(); } + diff --git a/src/apps/mail/FindWindow.h b/src/apps/mail/FindWindow.h index 0bee65d070..4205bec498 100644 --- a/src/apps/mail/FindWindow.h +++ b/src/apps/mail/FindWindow.h @@ -47,8 +47,6 @@ All rights reserved. class FindPanel; class AutoTextControl; -// ============================================================================ -// Floating find window, just one of them..... class FindWindow : public BWindow { friend class FindPanel; @@ -89,6 +87,5 @@ protected: }; -// ============================================================================ - #endif // #ifndef _FINDWINDOW_H + diff --git a/src/apps/mail/Header.cpp b/src/apps/mail/Header.cpp index 2465784cdf..894e1fa1a0 100644 --- a/src/apps/mail/Header.cpp +++ b/src/apps/mail/Header.cpp @@ -76,6 +76,7 @@ All rights reserved. using namespace BPrivate; using std::map; + const char* kDateLabel = "Date:"; const uint32 kMsgFrom = 'hFrm'; const uint32 kMsgEncoding = 'encd'; @@ -84,6 +85,7 @@ const uint32 kMsgAddressChosen = 'acsn'; static const float kTextControlDividerOffset = 0; static const float kMenuFieldDividerOffset = 6; + class QPopupMenu : public QueryMenu { public: QPopupMenu(const char *title); @@ -100,6 +102,7 @@ class QPopupMenu : public QueryMenu { int32 fGroups; // Current number of "group" submenus. Includes All People if present. }; + struct CompareBStrings { bool operator()(const BString *s1, const BString *s2) const diff --git a/src/apps/mail/Header.h b/src/apps/mail/Header.h index 1439d58e6c..be3e906b72 100644 --- a/src/apps/mail/Header.h +++ b/src/apps/mail/Header.h @@ -80,56 +80,58 @@ class TTextControl; class THeaderView : public BBox { - public: - THeaderView(BRect, BRect, bool incoming, BEmailMessage *mail, - bool resending, uint32 defaultCharacterSet, uint32 defaultChain); +public: + THeaderView(BRect, BRect, bool incoming, + BEmailMessage *mail, bool resending, + uint32 defaultCharacterSet, + uint32 defaultChain); - virtual void MessageReceived(BMessage *); - virtual void AttachedToWindow(void); - status_t LoadMessage(BEmailMessage *); + virtual void MessageReceived(BMessage*); + virtual void AttachedToWindow(); + status_t LoadMessage(BEmailMessage*); - BPopUpMenu *fAccountMenu; - BPopUpMenu *fEncodingMenu; - int32 fChain; - TTextControl *fAccountTo; - TTextControl *fAccount; - TTextControl *fBcc; - TTextControl *fCc; - TTextControl *fSubject; - TTextControl *fTo; - BStringView *fDateLabel; - BStringView *fDate; - bool fIncoming; - uint32 fCharacterSetUserSees; + BPopUpMenu* fAccountMenu; + BPopUpMenu* fEncodingMenu; + int32 fChain; + TTextControl* fAccountTo; + TTextControl* fAccount; + TTextControl* fBcc; + TTextControl* fCc; + TTextControl* fSubject; + TTextControl* fTo; + BStringView* fDateLabel; + BStringView* fDate; + bool fIncoming; + uint32 fCharacterSetUserSees; - private: - void InitEmailCompletion(); - void InitGroupCompletion(); +private: + void InitEmailCompletion(); + void InitGroupCompletion(); - bool fResending; - QPopupMenu *fBccMenu; - QPopupMenu *fCcMenu; - QPopupMenu *fToMenu; - BDefaultChoiceList fEmailList; + bool fResending; + QPopupMenu* fBccMenu; + QPopupMenu* fCcMenu; + QPopupMenu* fToMenu; + BDefaultChoiceList fEmailList; }; + class TTextControl : public BComboBox { - public: - TTextControl(BRect, const char*, BMessage*, bool, bool, - int32 resizingMode = B_FOLLOW_NONE); +public: + TTextControl(BRect, const char*, BMessage*, bool, + bool, int32 resizingMode = B_FOLLOW_NONE); - virtual void AttachedToWindow(); - virtual void MessageReceived(BMessage*); + virtual void AttachedToWindow(); + virtual void MessageReceived(BMessage*); - // returns focus for the text view - bool HasFocus(); + bool HasFocus(); - private: - bool fIncoming; - bool fResending; - char fLabel[100]; - BPopUpMenu *fRefDropMenu; - int32 fCommand; +private: + bool fIncoming; + bool fResending; + char fLabel[100]; + BPopUpMenu* fRefDropMenu; + int32 fCommand; }; #endif /* _HEADER_H */ diff --git a/src/apps/mail/KUndoBuffer.cpp b/src/apps/mail/KUndoBuffer.cpp index 28bb7152d4..5babccb763 100644 --- a/src/apps/mail/KUndoBuffer.cpp +++ b/src/apps/mail/KUndoBuffer.cpp @@ -4,12 +4,7 @@ #include "KUndoBuffer.h" -/* - KUndoItem -KUndoBuffer に格納される Undo/Redo 情報を記憶するクラス -(The class which remembers the Undo/Redo information which is housed in the KUndoBuffer) -*/ -KUndoItem::KUndoItem(const char *redo_text, +KUndoItem::KUndoItem(const char* redo_text, int32 length, int32 offset, undo_type history, @@ -21,12 +16,12 @@ KUndoItem::KUndoItem(const char *redo_text, CursorPos = cursor_pos; if (redo_text!=NULL) { - RedoText = (char *)malloc(length); + RedoText = (char*)malloc(length); memcpy(RedoText, redo_text, length); if (RedoText!=NULL) { - Status = B_OK; + fStatus = B_OK; } else { - Status = B_ERROR; + fStatus = B_ERROR; } } } @@ -39,32 +34,23 @@ KUndoItem::~KUndoItem() status_t KUndoItem::InitCheck() { - return Status; + return fStatus; } void -KUndoItem::Merge(const char *text, int32 length) +KUndoItem::Merge(const char* text, int32 length) { - RedoText = (char *)realloc(RedoText, Length + length); + RedoText = (char*)realloc(RedoText, Length + length); memcpy(&RedoText[Length], text, length); Length += length; } -/* - KUndoBuffer -Undo/Redo情報リストを管理するクラス。 -(The class which manages the Undo/Redo information list.) -このクラス自体は、BTextViewに影響を及ぼすものではない。 -(This class itself is not something which exerts influence on the BTextView.) -あくまで、アプリケーションがUndo/Redoを実装するための補助にすぎない。 -(To the last, it is no more than an assistance because application mounts the Undo/Redo.) -*/ KUndoBuffer::KUndoBuffer():BList(1024) { - FIndex = 0; + fIndex = 0; Off(); - FNewItem = true; + fNewItem = true; } KUndoBuffer::~KUndoBuffer() @@ -72,16 +58,9 @@ KUndoBuffer::~KUndoBuffer() MakeEmpty(); } -/* -Undo情報を追加する。 -(Undo information is added.) -リスト途中に追加したら、以降はRedoの必要がなくなるため、 -追加位置以降のUndo情報があれば削除する。 -(When it adds on the list middle, if later because necessity of the Redo is -gone, there is Undo information after the additional position, it deletes.) -*/ + bool -KUndoBuffer::AddItem(KUndoItem *item, int32 index) +KUndoBuffer::AddItem(KUndoItem* item, int32 index) { for (int32 i=CountItems()-1; i>=index; i--) { RemoveItem(i); @@ -90,7 +69,7 @@ KUndoBuffer::AddItem(KUndoItem *item, int32 index) } bool -KUndoBuffer::AddItem(KUndoItem *item) +KUndoBuffer::AddItem(KUndoItem* item) { return BList::AddItem(item); } @@ -103,76 +82,65 @@ KUndoBuffer::MakeEmpty(void) } } -KUndoItem * +KUndoItem* KUndoBuffer::RemoveItem(int32 index) { - if (FIndex>=CountItems()) FIndex--; + if (fIndex>=CountItems()) fIndex--; delete this->ItemAt(index); - return (KUndoItem *)BList::RemoveItem(index); + return (KUndoItem*)BList::RemoveItem(index); } -KUndoItem * +KUndoItem* KUndoBuffer::ItemAt(int32 index) const { - return (KUndoItem *)BList::ItemAt(index); + return (KUndoItem*)BList::ItemAt(index); } -/* - Off() 呼び出し後は、On()を実行しないとUndo情報追加を行わない。 - (Unless OFF () it calls after, ON () executes, Undo information addition is not done.) -*/ + void KUndoBuffer::On() { - FNoTouch = false; + fNoTouch = false; } void KUndoBuffer::Off() { - FNoTouch = true; + fNoTouch = true; } status_t -KUndoBuffer::NewUndo(const char *text, int32 length, int32 offset, undo_type history, int32 cursor_pos) +KUndoBuffer::NewUndo(const char* text, int32 length, int32 offset, + undo_type history, int32 cursor_pos) { - KUndoItem *NewUndoItem = new KUndoItem(text, length, offset, history, cursor_pos); + KUndoItem* NewUndoItem = new KUndoItem(text, length, offset, history, + cursor_pos); + status_t status = NewUndoItem->InitCheck(); if ( status != B_OK) { delete NewUndoItem; return status; } - AddItem(NewUndoItem, FIndex); - FIndex++; + AddItem(NewUndoItem, fIndex); + fIndex++; return status; } -/* -Undo情報をリストに追加する。 -(Undo information is added to the list.) -*/ + status_t -KUndoBuffer::AddUndo(const char *text, int32 length, int32 offset, undo_type history, int32 cursor_pos) +KUndoBuffer::AddUndo(const char* text, int32 length, int32 offset, + undo_type history, int32 cursor_pos) { - if (FNoTouch) return B_OK; + if (fNoTouch) return B_OK; status_t status; - // 新たな追加予約がある(FNewItem)か、現在位置(FIndex)が最後尾でないか、Undoリストが空であれば - // 新たにUndo情報を追加する。 - // (There is new additional reservation, if (the FNewItem), 現在位置 (the - // FIndex) is not the last tail or and the Undo list is the sky, Undo - // information is added anew.) - // さもなくば、最後尾Undo情報に結合すべきなら結合し、そうでなければ - // やはり新たにUndo情報を追加する。 - // (Without, if it should connect to last tail Undo information, if it - // connects and so is not Undo information is added after all anew.) - if (FNewItem || (FIndex < CountItems()) || (CountItems()==0)) { + if (fNewItem || (fIndex < CountItems()) || (CountItems()==0)) { status = NewUndo(text, length, offset, history, cursor_pos); - FNewItem = false; + fNewItem = false; } else { - KUndoItem *CurrentUndoItem; - CurrentUndoItem = ItemAt(FIndex-1); + KUndoItem* CurrentUndoItem; + CurrentUndoItem = ItemAt(fIndex-1); if (CurrentUndoItem!=NULL) { int32 c_length = CurrentUndoItem->Length; int32 c_offset = CurrentUndoItem->Offset; @@ -184,11 +152,13 @@ KUndoBuffer::AddUndo(const char *text, int32 length, int32 offset, undo_type his if ((c_offset + c_length) == offset) { CurrentUndoItem->Merge(text, length); } else { - status = NewUndo(text, length, offset, history, cursor_pos); + status = NewUndo(text, length, offset, history, + cursor_pos); } break; case K_DELETED: - status = NewUndo(text, length, offset, history, cursor_pos); + status = NewUndo(text, length, offset, history, + cursor_pos); break; } } else { @@ -200,37 +170,30 @@ KUndoBuffer::AddUndo(const char *text, int32 length, int32 offset, undo_type his return B_OK; } -// Enterを押した、矢印キーを押した等、Undoを一区切り起きたい場合に -// MakeNewUndoItem()を呼び出す。 -// (The Enter was pushed, one you divide the Undo and the MakeNewUndoItem () -// you call when we would like to occur e.g., the arrow key was pushed.) + status_t KUndoBuffer::MakeNewUndoItem() { - if (FIndex >= CountItems()) { - FNewItem = true; + if (fIndex >= CountItems()) { + fNewItem = true; return B_OK; } return B_ERROR; } -// Undo() Redo() は、FIndexをいったりきたりしながら -// 挿入位置、文字長、復元テキスト等の情報を返す。 -// (The Undo () the Redo (), the FIndex, while going back and forth, it -// returns the information of insertion position, letter length and the -// restoration text et cetera.) + status_t -KUndoBuffer::Undo(char **text, - int32 *length, - int32 *offset, - undo_type *history, - int32 *cursor_pos) +KUndoBuffer::Undo(char** text, + int32* length, + int32* offset, + undo_type* history, + int32* cursor_pos) { - KUndoItem *undoItem; + KUndoItem* undoItem; status_t status; - if (FIndex>0) { - undoItem = ItemAt(FIndex-1); + if (fIndex>0) { + undoItem = ItemAt(fIndex-1); if (undoItem!=NULL) { *text = undoItem->RedoText; *length = undoItem->Length; @@ -241,7 +204,7 @@ KUndoBuffer::Undo(char **text, } else { status = B_ERROR; } - FIndex--; + fIndex--; } else { status = B_ERROR; } @@ -249,26 +212,26 @@ KUndoBuffer::Undo(char **text, } status_t -KUndoBuffer::Redo(char **text, - int32 *length, - int32 *offset, - undo_type *history, - int32 *cursor_pos, - bool *replaced) +KUndoBuffer::Redo(char** text, + int32* length, + int32* offset, + undo_type* history, + int32* cursor_pos, + bool* replaced) { - KUndoItem *undoItem; + KUndoItem* undoItem; status_t status; - if (FIndex < CountItems()) { - undoItem = ItemAt(FIndex); + if (fIndex < CountItems()) { + undoItem = ItemAt(fIndex); if (undoItem!=NULL) { *text = undoItem->RedoText; *length = undoItem->Length; *offset = undoItem->Offset; *history = undoItem->History; *cursor_pos = undoItem->CursorPos; - if ((FIndex+1) < CountItems()) { - *replaced = ItemAt(FIndex+1)->History==K_REPLACED; + if ((fIndex+1) < CountItems()) { + *replaced = ItemAt(fIndex+1)->History==K_REPLACED; } else { *replaced = false; } @@ -276,22 +239,19 @@ KUndoBuffer::Redo(char **text, } else { status = B_ERROR; } - FIndex++; + fIndex++; } else { status = B_ERROR; } return status; } -// Undo/Redo 情報を標準出力に書きだす。 -// (It starts writing Undo/Redo information on standard output.) -// デバッグ時のみ。 -// (Only when debugging.) + void KUndoBuffer::PrintToStream() { for(int32 i=0; iHistory) { case K_INSERTED: @@ -319,3 +279,4 @@ KUndoBuffer::PrintToStream() printf("'\n"); } } + diff --git a/src/apps/mail/KUndoBuffer.h b/src/apps/mail/KUndoBuffer.h index 28bf6e5594..f1591cbe7d 100644 --- a/src/apps/mail/KUndoBuffer.h +++ b/src/apps/mail/KUndoBuffer.h @@ -1,77 +1,78 @@ +#ifndef _K_UNDOBUFFER_H +#define _K_UNDOBUFFER_H + + #include + enum undo_type{ - K_INSERTED, // 文字挿入時 (At the time of character insertion) - K_DELETED, // 削除時 (When deleting) - K_REPLACED // 置換、つまり削除→挿入の連続動作時 (Substitution, in other words deletion -> at the time of continuous action of insertion) + K_INSERTED, + K_DELETED, + K_REPLACED }; + class KUndoItem { public: - KUndoItem(const char *text, - int32 length, - int32 offset, - undo_type history, - int32 cursor_pos); - ~KUndoItem(); - void Merge(const char *text, int32 length); - status_t InitCheck(); + KUndoItem(const char* text, int32 length, + int32 offset, undo_type history, + int32 cursor_pos); + ~KUndoItem(); - int32 Offset; // 開始位置 (Start position) - int32 Length; // 文字長 (Letter length) - char *RedoText; // 復元すべきテキスト (The text which it should reconstruct) - undo_type History; // 操作区分 (Operation division) - int32 CursorPos; // カーソル位置 (Cursor position) + void Merge(const char* text, int32 length); + status_t InitCheck(); + + int32 Offset; + int32 Length; + char* RedoText; + undo_type History; + int32 CursorPos; private: - status_t Status; + status_t fStatus; }; -class KUndoBuffer:public BList + +class KUndoBuffer : public BList { public: - KUndoBuffer(); - ~KUndoBuffer(); + KUndoBuffer(); + ~KUndoBuffer(); - bool AddItem(KUndoItem *item, int32 index); - bool AddItem(KUndoItem *item); - void MakeEmpty(void); - KUndoItem *RemoveItem(int32 index); - KUndoItem *ItemAt(int32 index) const; + bool AddItem(KUndoItem* item, int32 index); + bool AddItem(KUndoItem* item); + void MakeEmpty(void); + KUndoItem* RemoveItem(int32 index); + KUndoItem* ItemAt(int32 index) const; + status_t AddUndo(const char* redo_text, int32 length, + int32 offset, undo_type history, + int32 cursor_pos); - status_t AddUndo(const char *redo_text, - int32 length, - int32 offset, - undo_type history, - int32 cursor_pos); - status_t MakeNewUndoItem(); - status_t Undo(char **text, - int32 *length, - int32 *offset, - undo_type *history, - int32 *cursor_pos); - status_t Redo(char **text, - int32 *length, - int32 *offset, - undo_type *history, - int32 *cursor_pos, - bool *replaced); + status_t MakeNewUndoItem(); - void PrintToStream(); + status_t Undo(char** text, int32* length, int32* offset, + undo_type* history, int32* cursor_pos); - void On(); - void Off(); + status_t Redo(char** text, int32* length, int32* offset, + undo_type* history, int32* cursor_pos, + bool* replaced); + + void PrintToStream(); + void On(); + void Off(); private: - int32 FIndex; - bool FNewItem; - bool FNoTouch; + int32 fIndex; + bool fNewItem; + bool fNoTouch; - status_t NewUndo(const char *text, - int32 length, - int32 offset, - undo_type history, - int32 cursor_pos); + status_t NewUndo(const char* text, int32 length, + int32 offset, undo_type history, + int32 cursor_pos); }; + + +#endif // _K_UNDOBUFFER_H + diff --git a/src/apps/mail/MailPopUpMenu.h b/src/apps/mail/MailPopUpMenu.h index 62c7a1a543..bec428d1fd 100644 --- a/src/apps/mail/MailPopUpMenu.h +++ b/src/apps/mail/MailPopUpMenu.h @@ -39,22 +39,23 @@ All rights reserved. class TMenu: public BPopUpMenu { - public: - TMenu(const char* name, const char* attribute, - int32 message, bool popup = false, - bool addRandom = true); - virtual ~TMenu(); +public: + TMenu(const char* name, const char* attribute, + int32 message, bool popup = false, + bool addRandom = true); + virtual ~TMenu(); - virtual BPoint ScreenLocation(void); - virtual void AttachedToWindow(); + virtual BPoint ScreenLocation(void); + virtual void AttachedToWindow(); - void BuildMenu(); + void BuildMenu(); - private: - char* fAttribute; - bool fPopup; - bool fAddRandom; - int32 fMessage; +private: + char* fAttribute; + bool fPopup; + bool fAddRandom; + int32 fMessage; }; #endif // _MAIL_POPUPMENU_H + diff --git a/src/apps/mail/MailWindow.cpp b/src/apps/mail/MailWindow.cpp index 9d3638713a..7372bffea9 100644 --- a/src/apps/mail/MailWindow.cpp +++ b/src/apps/mail/MailWindow.cpp @@ -3120,3 +3120,4 @@ TMailWindow::_UpdateReadButton() } UpdateViews(); } + diff --git a/src/apps/mail/MailWindow.h b/src/apps/mail/MailWindow.h index 3034c4e75d..fc509978d0 100644 --- a/src/apps/mail/MailWindow.h +++ b/src/apps/mail/MailWindow.h @@ -204,3 +204,4 @@ class TMailWindow : public BWindow { }; #endif // _MAIL_WINDOW_H + diff --git a/src/apps/mail/Messages.h b/src/apps/mail/Messages.h index a381bd2c92..746ff0c4b4 100644 --- a/src/apps/mail/Messages.h +++ b/src/apps/mail/Messages.h @@ -128,3 +128,4 @@ enum MENUS { }; #endif // _MESSAGES_H + diff --git a/src/apps/mail/Prefs.cpp b/src/apps/mail/Prefs.cpp index 7d5363b72f..37442444d0 100644 --- a/src/apps/mail/Prefs.cpp +++ b/src/apps/mail/Prefs.cpp @@ -919,4 +919,4 @@ TPrefsWindow::_BuildButtonBarMenu(uint8 show) return menu; } - + diff --git a/src/apps/mail/QueryMenu.h b/src/apps/mail/QueryMenu.h index b7ef62c93d..0a2695be33 100644 --- a/src/apps/mail/QueryMenu.h +++ b/src/apps/mail/QueryMenu.h @@ -86,3 +86,4 @@ class QueryMenu : public BPopUpMenu { }; #endif // #ifndef _QUERY_MENU + diff --git a/src/apps/mail/Status.h b/src/apps/mail/Status.h index 67c5a75f80..d4ca47f89b 100644 --- a/src/apps/mail/Status.h +++ b/src/apps/mail/Status.h @@ -63,3 +63,4 @@ class TStatusWindow : public BWindow { }; #endif // #ifndef _STATUS_H + diff --git a/src/apps/mail/Utilities.h b/src/apps/mail/Utilities.h index 122455be6e..d572d4c0c1 100644 --- a/src/apps/mail/Utilities.h +++ b/src/apps/mail/Utilities.h @@ -67,3 +67,4 @@ int32 linelen(char*, int32, bool); #endif #endif // #ifndef _UTILITIES_H + diff --git a/src/apps/mail/WIndex.h b/src/apps/mail/WIndex.h index 111aa843f8..add63f0642 100644 --- a/src/apps/mail/WIndex.h +++ b/src/apps/mail/WIndex.h @@ -104,3 +104,4 @@ protected: }; #endif // #ifndef _WORD_INDEX_H + diff --git a/src/apps/mail/Words.cpp b/src/apps/mail/Words.cpp index 62c6b169b3..45cd9bb6b3 100644 --- a/src/apps/mail/Words.cpp +++ b/src/apps/mail/Words.cpp @@ -862,3 +862,4 @@ void sort_word_list( BList *matches, const char *reference ) matches->SortItems( (int (*)(const void *, const void *))word_cmp ); } } + diff --git a/src/apps/mail/Words.h b/src/apps/mail/Words.h index 0e3e442b80..a6d5473b90 100644 --- a/src/apps/mail/Words.h +++ b/src/apps/mail/Words.h @@ -67,3 +67,4 @@ protected: }; #endif // #ifndef _WORDS_H +