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

messagelist

  • sources
  • kde-4.14
  • kdepim
  • messagelist
  • core
messageitem_p.h
Go to the documentation of this file.
1 /******************************************************************************
2  *
3  * Copyright 2008 Szymon Tomasz Stefanek <pragma@kvirc.net>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18  *
19  *******************************************************************************/
20 
21 #ifndef MESSAGELIST_MESSAGEITEM_P_H
22 #define MESSAGELIST_MESSAGEITEM_P_H
23 
24 #include "messageitem.h"
25 #include "item_p.h"
26 #include "messagecore/widgets/annotationdialog.h"
27 #include <Akonadi/Item>
28 #include <Akonadi/Monitor>
29 #include <Akonadi/Tag>
30 #include <KJob>
31 #include <QWeakPointer>
32 #include <QCache>
33 
34 namespace MessageList {
35 namespace Core {
36 
37 class MessageItemPrivate : public ItemPrivate
38 {
39 public:
40 
41  explicit MessageItemPrivate( MessageItem *qq );
42  ~MessageItemPrivate();
43 
49  const MessageItem::Tag *findTagInternal( const QString &szTagId ) const;
50 
52  QList<MessageItem::Tag*> getTagList() const;
53 
54  bool tagListInitialized() const;
55 
57  const MessageItem::Tag* bestTag() const;
58 
60  void invalidateTagCache();
61 
63  void invalidateAnnotationCache();
64 
65  // This creates mTagList and fills it with useful data
66  void fillTagList( const Akonadi::Tag::List &taglist );
67 
68  QByteArray mMessageIdMD5;
69  QByteArray mInReplyToIdMD5;
70  QByteArray mReferencesIdMD5;
71  QByteArray mStrippedSubjectMD5;
72  Akonadi::Item mAkonadiItem;
73  QWeakPointer<MessageCore::AnnotationEditDialog> mAnnotationDialog;
74  MessageItem::ThreadingStatus mThreadingStatus : 4;
75  MessageItem::EncryptionState mEncryptionState : 4;
76  MessageItem::SignatureState mSignatureState : 4;
77 
78  bool mAboutToBeRemoved : 1;
79  bool mSubjectIsPrefixed : 1;
80 
81 private:
82 
83  // List of all tags. If this is 0, it means we have not yet calculated this list. It is calculated
84  // on demand when needed.
85  mutable QList< MessageItem::Tag * > * mTagList;
86 };
87 
88 class FakeItemPrivate : public MessageItemPrivate
89 {
90  public:
91  explicit FakeItemPrivate( FakeItem *qq );
92  QList<MessageItem::Tag*> mFakeTags;
93 };
94 
98 class TagCache : public QObject
99 {
100  Q_OBJECT
101 public:
102  TagCache();
103  void retrieveTags(const Akonadi::Tag::List &tags, MessageItemPrivate *m);
104  void cancelRequest(MessageItemPrivate *m);
105 
106 private Q_SLOTS:
107  void onTagAdded(const Akonadi::Tag &);
108  void onTagChanged(const Akonadi::Tag &);
109  void onTagRemoved(const Akonadi::Tag &);
110  void onTagsFetched(KJob*);
111 
112 private:
113  QHash<KJob*, MessageItemPrivate*> mRequests;
114  QCache<Akonadi::Tag::Id, Akonadi::Tag> mCache;
115  Akonadi::Monitor *mMonitor;
116 };
117 
118 }
119 
120 }
121 
122 #endif
MessageList::Core::TagCache::cancelRequest
void cancelRequest(MessageItemPrivate *m)
Definition: messageitem.cpp:748
MessageList::Core::MessageItemPrivate::mStrippedSubjectMD5
QByteArray mStrippedSubjectMD5
set only if we're doing threading
Definition: messageitem_p.h:71
MessageList::Core::MessageItem::EncryptionState
EncryptionState
Definition: messageitem.h:80
QByteArray
MessageList::Core::MessageItem
Definition: messageitem.h:46
MessageList::Core::MessageItemPrivate::mMessageIdMD5
QByteArray mMessageIdMD5
always set
Definition: messageitem_p.h:68
MessageList::Core::TagCache
A tag cache.
Definition: messageitem_p.h:98
MessageList::Core::MessageItemPrivate::fillTagList
void fillTagList(const Akonadi::Tag::List &taglist)
Definition: messageitem.cpp:184
MessageList::Core::MessageItemPrivate::mAboutToBeRemoved
bool mAboutToBeRemoved
Set to true when this item is going to be deleted and shouldn't be selectable.
Definition: messageitem_p.h:78
MessageList::Core::MessageItemPrivate
Definition: messageitem_p.h:37
MessageList::Core::ItemPrivate
Definition: item_p.h:41
MessageList::Core::MessageItemPrivate::getTagList
QList< MessageItem::Tag * > getTagList() const
Returns the list of tags. This is calculated on demand and cached in mTagList.
Definition: messageitem.cpp:225
MessageList::Core::FakeItemPrivate
Definition: messageitem_p.h:88
MessageList::Core::MessageItemPrivate::mAnnotationDialog
QWeakPointer< MessageCore::AnnotationEditDialog > mAnnotationDialog
Definition: messageitem_p.h:73
MessageList::Core::MessageItemPrivate::mAkonadiItem
Akonadi::Item mAkonadiItem
Definition: messageitem_p.h:72
MessageList::Core::FakeItemPrivate::mFakeTags
QList< MessageItem::Tag * > mFakeTags
Definition: messageitem_p.h:92
MessageList::Core::TagCache::retrieveTags
void retrieveTags(const Akonadi::Tag::List &tags, MessageItemPrivate *m)
Definition: messageitem.cpp:722
MessageList::Core::MessageItemPrivate::bestTag
const MessageItem::Tag * bestTag() const
Returns the tag with the highest priority, or 0 if there are no tags.
Definition: messageitem.cpp:174
MessageList::Core::TagCache::TagCache
TagCache()
Definition: messageitem.cpp:695
MessageList::Core::MessageItemPrivate::MessageItemPrivate
MessageItemPrivate(MessageItem *qq)
Definition: messageitem.cpp:144
messageitem.h
QHash
MessageList::Core::MessageItemPrivate::mReferencesIdMD5
QByteArray mReferencesIdMD5
set only if we're doing threading
Definition: messageitem_p.h:70
QObject
MessageList::Core::MessageItemPrivate::mSignatureState
MessageItem::SignatureState mSignatureState
Definition: messageitem_p.h:76
MessageList::Core::MessageItemPrivate::tagListInitialized
bool tagListInitialized() const
Definition: messageitem.cpp:235
QString
QList
QCache< Akonadi::Tag::Id, Akonadi::Tag >
MessageList::Core::FakeItem
A message item that can have a fake tag list and a fake annotation.
Definition: messageitem.h:214
MessageList::Core::MessageItem::SignatureState
SignatureState
Definition: messageitem.h:88
MessageList::Core::MessageItemPrivate::mEncryptionState
MessageItem::EncryptionState mEncryptionState
Definition: messageitem_p.h:75
MessageList::Core::MessageItemPrivate::invalidateAnnotationCache
void invalidateAnnotationCache()
Deletes the cache of the annotation.
Definition: messageitem.cpp:170
MessageList::Core::MessageItemPrivate::findTagInternal
const MessageItem::Tag * findTagInternal(const QString &szTagId) const
Linear search in the list of tags.
Definition: messageitem.cpp:296
MessageList::Core::MessageItemPrivate::~MessageItemPrivate
~MessageItemPrivate()
Definition: messageitem.cpp:155
MessageList::Core::MessageItemPrivate::mSubjectIsPrefixed
bool mSubjectIsPrefixed
set only if we're doing subject based threading
Definition: messageitem_p.h:79
MessageList::Core::FakeItemPrivate::FakeItemPrivate
FakeItemPrivate(FakeItem *qq)
Definition: messageitem.cpp:665
QWeakPointer< MessageCore::AnnotationEditDialog >
MessageList::Core::MessageItemPrivate::invalidateTagCache
void invalidateTagCache()
Deletes the internal list of tags.
Definition: messageitem.cpp:161
MessageList::Core::MessageItem::Tag
Definition: messageitem.h:49
item_p.h
MessageList::Core::MessageItemPrivate::mThreadingStatus
MessageItem::ThreadingStatus mThreadingStatus
Definition: messageitem_p.h:74
MessageList::Core::MessageItem::ThreadingStatus
ThreadingStatus
Definition: messageitem.h:72
MessageList::Core::MessageItemPrivate::mInReplyToIdMD5
QByteArray mInReplyToIdMD5
set only if we're doing threading
Definition: messageitem_p.h:69
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:32:01 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

messagelist

Skip menu "messagelist"
  • 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