• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepim API Reference
  • KDE Home
  • Contact Us
 

kmail

  • sources
  • kde-4.12
  • kdepim
  • kmail
  • searchdialog
searchwindow.h
Go to the documentation of this file.
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 
22 #ifndef KMAIL_SEARCHWINDOW_H
23 #define KMAIL_SEARCHWINDOW_H
24 
25 #include "mailcommon/search/searchpattern.h"
26 #include "ui_searchwindow.h"
27 
28 #include <akonadi/collection.h>
29 #include <akonadi/item.h>
30 #include <kdialog.h>
31 #include <kxmlguiclient.h>
32 
33 #include <QtCore/QTimer>
34 
35 class QCloseEvent;
36 class QKeyEvent;
37 class KActionMenu;
38 class KJob;
39 class KMMainWidget;
40 class KMSearchMessageModel;
41 class QAbstractItemModel;
42 class QModelIndex;
43 
44 namespace MailCommon {
45 class SelectMultiCollectionDialog;
46 }
47 
48 namespace Akonadi {
49 class StandardMailActionManager;
50 }
51 
52 namespace KMime {
53 class Message;
54 }
55 
56 namespace KMail {
57 
64 class SearchPatternWarning;
65 class SearchWindow: public KDialog, public KXMLGUIClient
66 {
67  Q_OBJECT
68 
69 public:
77  explicit SearchWindow( KMMainWidget* parent, const Akonadi::Collection &collection = Akonadi::Collection() );
78 
82  ~SearchWindow();
83 
89  void activateFolder( const Akonadi::Collection &folder );
90 
96  Akonadi::Item::List selectedMessages() const;
97 
103  Akonadi::Item selectedMessage() const;
104 
108  void addRulesToSearchPattern( const MailCommon::SearchPattern &pattern );
109 
110 protected:
112  void keyPressEvent( QKeyEvent* );
113 
115  void closeEvent( QCloseEvent* );
116 
117  void createSearchModel();
118 
119  void childCollectionsFromSelectedCollection( const Akonadi::Collection& collection, KUrl::List &list );
120  void getChildren( const QAbstractItemModel *model, const QModelIndex &parentIndex, KUrl::List &list );
121 
122 
123 private Q_SLOTS:
124  void updateCollectionStatistic(Akonadi::Collection::Id,Akonadi::CollectionStatistics);
125 
126  void slotClose();
127  void slotSearch();
128  void slotStop();
129  void scheduleRename( const QString& );
130  void renameSearchFolder();
131  void openSearchFolder();
132  bool slotShowMsg( const Akonadi::Item& );
133  void slotViewSelectedMsg();
134  bool slotViewMsg( const Akonadi::Item& );
135  void slotCurrentChanged( const Akonadi::Item& );
136  void updateContextMenuActions();
137  void slotFolderActivated();
138  void slotClearSelection();
139  void slotReplyToMsg();
140  void slotReplyAllToMsg();
141  void slotReplyListToMsg();
142  void slotForwardMsg();
143  void slotForwardAttachedMsg();
144  void slotSaveMsg();
145  void slotSaveAttachments();
146  void slotPrintMsg();
147  void slotDebugQuery();
148 
150  void searchDone( KJob* );
151  void enableGUI();
152 
153  void setEnabledSearchButton( bool );
154  void slotSearchFolderRenameDone( KJob* );
155 
156  void slotContextMenuRequested( const QPoint& );
157  void slotSelectMultipleFolders();
158 
159 private:
160  QPointer<MailCommon::SelectMultiCollectionDialog> mSelectMultiCollectionDialog;
161  QList<Akonadi::Collection> mCollectionId;
162  QString mQuery;
163  bool mCloseRequested;
164  int mSortColumn;
165  Qt::SortOrder mSortOrder;
166  Akonadi::Collection mFolder;
167  KJob *mSearchJob;
168 
169  KMSearchMessageModel *mResultModel;
170  Ui_SearchWindow mUi;
171  KGuiItem mStartSearchGuiItem;
172  KGuiItem mStopSearchGuiItem;
173  KPushButton *mSearchButton;
174 
175  QAction *mReplyAction, *mReplyAllAction, *mReplyListAction, *mSaveAsAction,
176  *mForwardInlineAction, *mForwardAttachedAction, *mPrintAction, *mClearAction,
177  *mSaveAtchAction;
178  KActionMenu *mForwardActionMenu;
179  QTimer mRenameTimer;
180  QByteArray mHeaderState;
181  // not owned by us
182  KMMainWidget* mKMMainWidget;
183  MailCommon::SearchPattern mSearchPattern;
184  SearchPatternWarning *mSearchPatternWidget;
185 
186  Akonadi::StandardMailActionManager *mAkonadiStandardAction;
187 };
188 
189 }
190 
191 #endif
KMail::SearchWindow::selectedMessage
Akonadi::Item selectedMessage() const
Provides access to the currently selected message.
Definition: searchwindow.cpp:701
KXMLGUIClient
KDialog
KMail::SearchWindow::selectedMessages
Akonadi::Item::List selectedMessages() const
Provides access to the list of currently selected message in the listview.
Definition: searchwindow.cpp:688
KMail::SearchWindow::closeEvent
void closeEvent(QCloseEvent *)
Reimplemented to stop searching when the window is closed.
Definition: searchwindow.cpp:582
KMail::SearchWindow::createSearchModel
void createSearchModel()
Definition: searchwindow.cpp:324
KMMainWidget
Definition: kmmainwidget.h:83
KMail::SearchWindow::addRulesToSearchPattern
void addRulesToSearchPattern(const MailCommon::SearchPattern &pattern)
Loads a search pattern into the search window, appending its rules to the current one...
Definition: searchwindow.cpp:806
KMail::SearchWindow::~SearchWindow
~SearchWindow()
Destroys the search window.
Definition: searchwindow.cpp:296
KMail::SearchWindow::getChildren
void getChildren(const QAbstractItemModel *model, const QModelIndex &parentIndex, KUrl::List &list)
Definition: searchwindow.cpp:832
KMail::SearchPatternWarning
Definition: searchpatternwarning.h:25
KMail::SearchWindow::keyPressEvent
void keyPressEvent(QKeyEvent *)
Reimplemented to react to Escape.
Definition: searchwindow.cpp:373
KMSearchMessageModel
Definition: kmsearchmessagemodel.h:33
KMail::SearchWindow::SearchWindow
SearchWindow(KMMainWidget *parent, const Akonadi::Collection &collection=Akonadi::Collection())
Creates a new search window.
Definition: searchwindow.cpp:75
KMail::SearchWindow::childCollectionsFromSelectedCollection
void childCollectionsFromSelectedCollection(const Akonadi::Collection &collection, KUrl::List &list)
Definition: searchwindow.cpp:822
KJob
KMail::SearchWindow::activateFolder
void activateFolder(const Akonadi::Collection &folder)
Changes the base folder for search operations to a different folder.
Definition: searchwindow.cpp:388
KMail::SearchWindow
Definition: searchwindow.h:65
QList< Akonadi::Collection >
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:58:52 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kmail

Skip menu "kmail"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal