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

kmail

  • sources
  • kde-4.14
  • kdepim
  • kmail
  • tag
tagactionmanager.h
Go to the documentation of this file.
1 /* Copyright 2010 Thomas McGuire <mcguire@kde.org>
2 
3  Copyright 2011-2015 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 class KJob;
29 class KActionCollection;
30 class KXMLGUIClient;
31 class KToggleAction;
32 class QAction;
33 class QSignalMapper;
34 class KAction;
35 namespace Akonadi {
36 class Item;
37 class Monitor;
38 class Tag;
39 }
40 
41 namespace KMail {
42 
43 class MessageActions;
44 
55 class KMAIL_EXPORT TagActionManager : public QObject
56 {
57  Q_OBJECT
58 public:
59 
68  TagActionManager( QObject *parent, KActionCollection *actionCollection,
69  MessageActions *messageActions, KXMLGUIClient *guiClient );
70 
71  ~TagActionManager();
72 
76  void clearActions();
77 
81  void createActions();
82 
92  void updateActionStates( int numberOfSelectedMessages,
93  const Akonadi::Item &selectedItem );
94 
95 
96 Q_SIGNALS:
97 
102  void tagActionTriggered( const Akonadi::Tag &tag );
106  void tagMoreActionClicked();
107 
108 private Q_SLOTS:
109  void finishedTagListing(KJob *job);
110  void newTagActionClicked();
111  void onSignalMapped(const QString &tag);
112  void onTagAdded(const Akonadi::Tag &);
113  void onTagRemoved(const Akonadi::Tag &);
114  void onTagChanged(const Akonadi::Tag &);
115 
116 private:
117  void fillTagList();
118  void createTagAction( const MailCommon::Tag::Ptr &tag, bool addToMenu );
119  void createTagActions( const QList<MailCommon::Tag::Ptr> &);
120  void checkTags(const QList<qint64>& tags);
121  QList<qint64> checkedTags() const;
122 
123  KActionCollection *mActionCollection;
124  MessageActions *mMessageActions;
125  QSignalMapper *mMessageTagToggleMapper;
126  KXMLGUIClient *mGUIClient;
127 
128  QAction *mSeparatorMoreAction;
129  QAction *mSeparatorNewTagAction;
130  KAction *mMoreAction;
131  KAction *mNewTagAction;
132  // Maps the id of a tag to the action of a tag.
133  // Contains all existing tags
134  QMap<qint64,KToggleAction*> mTagActions;
135 
136  // The actions of all tags that are in the toolbar
137  QList<QAction*> mToolbarActions;
138 
139  // A sorted list of all tags
140  QList<MailCommon::Tag::Ptr> mTags;
141 
142  // Uri of a newly created tag
143  qint64 mNewTagId;
144  bool mTagFetchInProgress;
145  Akonadi::Monitor *mMonitor;
146 };
147 }
148 
149 #endif
KXMLGUIClient
kmail_export.h
QMap< qint64, KToggleAction * >
KMail::MessageActions
Manages common actions that can be performed on one or more messages.
Definition: messageactions.h:50
KMail::TagActionManager
Creates actions related to the existing Akonadi tags and plugs them into the GUI. ...
Definition: tagactionmanager.h:55
QObject
QString
QList< MailCommon::Tag::Ptr >
KMAIL_EXPORT
#define KMAIL_EXPORT
Definition: kmail_export.h:35
QAction
KJob
QSignalMapper
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:34:33 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
  • pimprint

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