• 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
  • tag
tagactionmanager.h
Go to the documentation of this file.
1 /* Copyright 2010 Thomas McGuire <mcguire@kde.org>
2 
3  Copyright 2011 Laurent Montel <montel@kde.org>
4 
5  This program is free software; you can redistribute it and/or
6  modify it under the terms of the GNU General Public License as
7  published by the Free Software Foundation; either version 2 of
8  the License or (at your option) version 3 or any later version
9  accepted by the membership of KDE e.V. (or its successor approved
10  by the membership of KDE e.V.), which shall act as a proxy
11  defined in Section 14 of version 3 of the license.
12 
13  This program is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with this program. If not, see <http://www.gnu.org/licenses/>.
20 */
21 #ifndef TAGACTIONMANAGER_H
22 #define TAGACTIONMANAGER_H
23 
24 #include "kmail_export.h"
25 #include "tag.h"
26 #include <QMap>
27 
28 namespace Nepomuk2
29 {
30 class Resource;
31 namespace Query
32 {
33 class QueryServiceClient;
34 class Result;
35 }
36 }
37 
38 class KActionCollection;
39 class KXMLGUIClient;
40 class KToggleAction;
41 class QAction;
42 class QSignalMapper;
43 class KAction;
44 namespace Akonadi {
45 class Item;
46 }
47 
48 namespace MessageCore {
49 class AsyncNepomukResourceRetriever;
50 }
51 
52 namespace KMail {
53 
54 class MessageActions;
55 
66 class KMAIL_EXPORT TagActionManager : public QObject
67 {
68  Q_OBJECT
69 public:
70 
79  TagActionManager( QObject *parent, KActionCollection *actionCollection,
80  MessageActions *messageActions, KXMLGUIClient *guiClient );
81 
82  ~TagActionManager();
83 
87  void clearActions();
88 
92  void createActions();
93 
103  void updateActionStates( int numberOfSelectedMessages,
104  const Akonadi::Item &selectedItem );
105 
106 
107 Q_SIGNALS:
108 
113  void tagActionTriggered( const QString &tagLabel );
117  void tagMoreActionClicked();
118 
119 private Q_SLOTS:
120  void newTagEntries(const QList<Nepomuk2::Query::Result>& results);
121  void finishedTagListing();
122  void tagsChanged();
123  void resourceCreated(const Nepomuk2::Resource&,const QList<QUrl>&);
124  void resourceRemoved(const QUrl&,const QList<QUrl>&);
125  void propertyChanged(const Nepomuk2::Resource&);
126  void newTagActionClicked();
127 
128  void slotLoadedResourceForUpdateActionStates(const QUrl& uri, const Nepomuk2::Resource& res);
129 
130 private:
131  void createTagAction( const MailCommon::Tag::Ptr &tag, bool addToMenu );
132  void createTagActions();
133 
134  QList<QUrl> checkedTags() const;
135  void checkTags( const QList<QUrl> &tags );
136 
137  KActionCollection *mActionCollection;
138  MessageActions *mMessageActions;
139  QSignalMapper *mMessageTagToggleMapper;
140  KXMLGUIClient *mGUIClient;
141 
142  QAction *mSeparatorMoreAction;
143  QAction *mSeparatorNewTagAction;
144  KAction *mMoreAction;
145  KAction *mNewTagAction;
146  // Maps the resource URI or a tag to the action of a tag.
147  // Contains all existing tags
148  QMap<QString,KToggleAction*> mTagActions;
149 
150  // The actions of all tags that are in the toolbar
151  QList<QAction*> mToolbarActions;
152 
153  // Cache of the tags to avoid expensive Nepomuk queries
154  QList<MailCommon::Tag::Ptr> mTags;
155 
156  Nepomuk2::Query::QueryServiceClient *mTagQueryClient;
157  MessageCore::AsyncNepomukResourceRetriever *mAsyncNepomukRetriver;
158 
159  // Uri of a newly created tag
160  QString mNewTagUri;
161 };
162 }
163 
164 #endif
KXMLGUIClient
kmail_export.h
KMail::MessageActions
Manages common actions that can be performed on one or more messages.
Definition: messageactions.h:59
QObject
KMail::TagActionManager
Creates actions related to the existing Nepomuk tags and plugs them into the GUI. ...
Definition: tagactionmanager.h:66
KMAIL_EXPORT
#define KMAIL_EXPORT
Definition: kmail_export.h:35
QMap< QString, KToggleAction * >
QList
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