kmail

searchwindow.h
1 /*
2  * kmail: KDE mail client
3  * Copyright (c) 1996-1998 Stefan Taferner <taferner@kde.org>
4  * Copyright (c) 2001 Aaron J. Seigo <aseigo@kde.org>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19  *
20  */
21 #ifndef searchwindow_h
22 #define searchwindow_h
23 
24 #include <tqvaluelist.h>
25 #include <tqptrlist.h>
26 #include <tqstringlist.h>
27 #include <tqguardedptr.h>
28 #include <tqtimer.h>
29 
30 #include <kdialogbase.h>
31 #include <kxmlguiclient.h>
32 
33 class TQCheckBox;
34 class TQComboBox;
35 class TQGridLayout;
36 class TQLabel;
37 class TQLineEdit;
38 class TDEListView;
39 class TQListViewItem;
40 class TQPushButton;
41 class TQRadioButton;
42 class TDEAction;
43 class TDEActionMenu;
44 class KMFolder;
45 class KMFolderSearch;
46 class KMFolderImap;
47 class KMFolderMgr;
48 class KMMainWidget;
49 class KMMessage;
50 class KMSearchPattern;
52 class KStatusBar;
53 class DwBoyerMoore;
54 namespace KMail {
55  class FolderRequester;
56 }
57 
58 typedef TQPtrList<KMMsgBase> KMMessageList;
59 
60 namespace KMail {
61 
68 class SearchWindow: public KDialogBase, virtual public KXMLGUIClient
69 {
70  TQ_OBJECT
71 
72 
73 public:
82  SearchWindow( KMMainWidget* parent, const char* name=0,
83  KMFolder *curFolder=0, bool modal=false );
84  virtual ~SearchWindow();
85 
90  void activateFolder( KMFolder* curFolder );
91 
96  KMMessageList selectedMessages();
97 
102  KMMessage* message();
103 
104  void setSearchPattern( const KMSearchPattern& pattern );
105 
106 protected slots:
108  virtual void updStatus(void);
109 
110  virtual void slotClose();
111  virtual void slotSearch();
112  virtual void slotStop();
113  void scheduleRename( const TQString &);
114  void renameSearchFolder();
115  void openSearchFolder();
116  void folderInvalidated(KMFolder *);
117  virtual bool slotShowMsg( TQListViewItem * );
118  void slotViewSelectedMsg();
119  virtual bool slotViewMsg( TQListViewItem * );
120  void slotCurrentChanged( TQListViewItem * );
121  virtual void updateContextMenuActions();
122  virtual void slotContextMenuRequested( TQListViewItem*, const TQPoint &, int );
123  virtual void copySelectedToFolder( int menuId );
124  virtual void moveSelectedToFolder( int menuId );
125  virtual void slotFolderActivated();
126  void slotClearSelection();
127  void slotReplyToMsg();
128  void slotReplyAllToMsg();
129  void slotReplyListToMsg();
130  void slotForwardInlineMsg();
131  void slotForwardAttachedMsg();
132  void slotForwardDigestMsg();
133  void slotRedirectMsg();
134  void slotSaveMsg();
135  void slotSaveAttachments();
136  void slotPrintMsg();
137  void slotCopyMsgs();
138  void slotCutMsgs();
139 
141  virtual void searchDone();
142  virtual void slotAddMsg(int idx);
143  virtual void slotRemoveMsg(KMFolder *, TQ_UINT32 serNum);
144  void enableGUI();
145 
146  void setEnabledSearchButton(bool);
147 
148 protected:
149 
151  virtual void keyPressEvent(TQKeyEvent*);
152 
154  virtual void closeEvent(TQCloseEvent*);
155 
156 protected:
157  bool mStopped;
158  bool mCloseRequested;
159  int mFetchingInProgress;
160  int mSortColumn;
161  SortOrder mSortOrder;
162  TQGuardedPtr<KMFolderSearch> mFolder;
163  TQTimer *mTimer;
164 
165  // GC'd by TQt
166  TQRadioButton *mChkbxAllFolders;
167  TQRadioButton *mChkbxSpecificFolders;
168  KMail::FolderRequester *mCbxFolders;
169  TQPushButton *mBtnSearch;
170  TQPushButton *mBtnStop;
171  TQCheckBox *mChkSubFolders;
172  TDEListView* mLbxMatches;
173  TQLabel *mSearchFolderLbl;
174  TQLineEdit *mSearchFolderEdt;
175  TQPushButton *mSearchFolderOpenBtn;
176  TQPushButton *mSearchResultOpenBtn;
177  KStatusBar* mStatusBar;
178  TQWidget* mLastFocus; // to remember the position of the focus
179  TQMap<int,KMFolder*> mMenuToFolder;
180  TDEAction *mReplyAction, *mReplyAllAction, *mReplyListAction, *mSaveAsAction,
181  *mForwardInlineAction, *mForwardAttachedAction, *mForwardDigestAction,
182  *mRedirectAction, *mPrintAction, *mClearAction, *mSaveAtchAction,
183  *mCopyAction, *mCutAction;
184  TDEActionMenu *mForwardActionMenu;
185  TQValueList<TQGuardedPtr<KMFolder> > mFolders;
186  TQTimer mRenameTimer;
187 
188  // not owned by us
189  KMMainWidget* mKMMainWidget;
190  KMSearchPatternEdit *mPatternEdit;
191  KMSearchPattern *mSearchPattern;
192 
193  static const int MSGID_COLUMN;
194 
195 private:
196  KMMessage *indexToMessage( TQListViewItem *item );
197 };
198 
199 } // namespace KMail
200 #endif /*searchwindow_h*/
Mail folder.
Definition: kmfolder.h:69
This is a Mime Message.
Definition: kmmessage.h:68
This widget is intended to be used in the filter configuration as well as in the message search dialo...
This class is an abstraction of a search over messages.
A widget that contains a KLineEdit which shows the current folder and a button that fires a KMFolderS...
The SearchWindow class provides a dialog for triggering a search on folders and storing that search a...
Definition: searchwindow.h:69
virtual void searchDone()
GUI cleanup after search.
KMMessage * message()
Provides access to the currently selected message.
virtual void updStatus(void)
Update status line widget.
virtual void keyPressEvent(TQKeyEvent *)
Reimplemented to react to Escape.
SearchWindow(KMMainWidget *parent, const char *name=0, KMFolder *curFolder=0, bool modal=false)
Creates a new search window.
virtual void closeEvent(TQCloseEvent *)
Reimplemented to stop searching when the window is closed.
KMMessageList selectedMessages()
Provides access to the list of currently selected message in the listview.
void activateFolder(KMFolder *curFolder)
Changes the base folder for search operations to a different folder.
folderdiaquotatab.h
Definition: aboutdata.cpp:40