• 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.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_CORE_MESSAGEITEM_H__
22 #define __MESSAGELIST_CORE_MESSAGEITEM_H__
23 
24 #include <messagelist/core/item.h>
25 #include <messagelist/core/modelinvariantindex.h>
26 
27 #include <QPixmap>
28 #include <QString>
29 #include <QColor>
30 
31 #include <messagelist/messagelist_export.h>
32 #include "theme.h"
33 
34 namespace Akonadi {
35 class Item;
36 }
37 
38 namespace MessageList
39 {
40 
41 namespace Core
42 {
43 
44 class MessageItemPrivate;
45 
46 class MESSAGELIST_EXPORT MessageItem : public Item, public ModelInvariantIndex
47 {
48 public:
49  class MESSAGELIST_EXPORT Tag
50  {
51  public:
52  explicit Tag( const QPixmap &pix, const QString &tagName, const QString &tagId );
53  ~Tag();
54  QPixmap pixmap() const;
55  QString name() const;
56  QString id() const;
57  QColor textColor() const;
58  QColor backgroundColor() const;
59  QFont font() const;
60  int priority() const;
61 
62  void setTextColor( const QColor &textColor );
63  void setBackgroundColor( const QColor &backgroundColor );
64  void setFont( const QFont &font );
65  void setPriority( int priority );
66 
67  private:
68  class Private;
69  Private * const d;
70  };
71 
72  enum ThreadingStatus
73  {
74  PerfectParentFound,
75  ImperfectParentFound,
76  ParentMissing,
77  NonThreadable
78  };
79 
80  enum EncryptionState
81  {
82  NotEncrypted,
83  PartiallyEncrypted,
84  FullyEncrypted,
85  EncryptionStateUnknown
86  };
87 
88  enum SignatureState
89  {
90  NotSigned,
91  PartiallySigned,
92  FullySigned,
93  SignatureStateUnknown
94  };
95 
96  explicit MessageItem();
97  virtual ~MessageItem();
98 
99 public:
100 
102  virtual QList< Tag * > tagList() const;
103 
105  virtual bool hasAnnotation() const;
106 
108  QString annotation() const;
109 
111  void editAnnotation();
112 
117  const Tag * findTag( const QString &szTagId ) const;
118 
119  QString tagListDescription() const;
120 
123  void invalidateTagCache();
124 
126  void invalidateAnnotationCache();
127 
128  QColor textColor() const;
129 
130  QColor backgroundColor() const;
131 
132  QFont font() const;
133 
134  QString fontKey() const;
135 
136  SignatureState signatureState() const;
137 
138  void setSignatureState( SignatureState state );
139 
140  EncryptionState encryptionState() const;
141 
142  void setEncryptionState( EncryptionState state );
143 
144  QByteArray messageIdMD5() const;
145 
146  void setMessageIdMD5( const QByteArray &md5 );
147 
148  QByteArray inReplyToIdMD5() const;
149 
150  void setInReplyToIdMD5( const QByteArray &md5 );
151 
152  QByteArray referencesIdMD5() const;
153 
154  void setReferencesIdMD5( const QByteArray &md5 );
155 
156  void setSubjectIsPrefixed( bool subjectIsPrefixed );
157 
158  bool subjectIsPrefixed() const;
159 
160  QByteArray strippedSubjectMD5() const;
161 
162  void setStrippedSubjectMD5( const QByteArray &md5 );
163 
164  bool aboutToBeRemoved() const;
165 
166  void setAboutToBeRemoved( bool aboutToBeRemoved );
167 
168  ThreadingStatus threadingStatus() const;
169 
170  void setThreadingStatus( ThreadingStatus threadingStatus );
171 
172  unsigned long uniqueId() const;
173 
174  Akonadi::Item akonadiItem() const;
175  void setAkonadiItem( const Akonadi::Item &item );
176 
177  MessageItem * topmostMessage();
178 
179  QString accessibleText( const MessageList::Core::Theme* theme, int columnIndex );
180 
185  void subTreeToList( QList< MessageItem * > &list );
186 
187  //
188  // Colors and fonts shared by all message items.
189  // textColor() and font() will take the message status into account and return
190  // one of these.
191  // Call these setters only once when reading the colors from the config file.
192  //
193  static void setUnreadMessageColor( const QColor &color );
194  static void setImportantMessageColor( const QColor &color );
195  static void setToDoMessageColor( const QColor &color );
196  static void setGeneralFont( const QFont &font );
197  static void setUnreadMessageFont( const QFont &font );
198  static void setImportantMessageFont( const QFont &font );
199  static void setToDoMessageFont( const QFont &font );
200 
201 protected:
202  explicit MessageItem( MessageItemPrivate* dd );
203 private:
204 
205  QString accessibleTextForField( Theme::ContentItem::Type field );
206 
207  Q_DECLARE_PRIVATE( MessageItem )
208 };
209 
210 
211 class FakeItemPrivate;
212 
214 class MESSAGELIST_EXPORT FakeItem : public MessageItem
215 {
216 public:
217 
218  explicit FakeItem();
219  ~FakeItem();
220 
222  virtual QList< Tag * > tagList() const;
223 
225  void setFakeTags( const QList< Tag* > &tagList );
226 
228  virtual bool hasAnnotation() const;
229 
230 private:
231  Q_DECLARE_PRIVATE( FakeItem )
232 };
233 
234 } // namespace Core
235 
236 } // namespace MessageList
237 
238 #endif
modelinvariantindex.h
messagelist_export.h
MessageList::Core::MessageItem::EncryptionState
EncryptionState
Definition: messageitem.h:80
MessageList::Core::MessageItem::PartiallySigned
Definition: messageitem.h:91
QByteArray
MessageList::Core::MessageItem
Definition: messageitem.h:46
QFont
MessageList::Core::MessageItemPrivate
Definition: messageitem_p.h:37
theme.h
MessageList::Core::MessageItem::ParentMissing
this message might belong to a thread but its parent is actually missing
Definition: messageitem.h:76
MessageList::Core::MessageItem::PartiallyEncrypted
Definition: messageitem.h:83
MessageList::Core::MessageItem::ImperfectParentFound
this message found an imperfect parent to attach to (might be fixed later)
Definition: messageitem.h:75
MessageList::Core::MessageItem::PerfectParentFound
this message found a perfect parent to attach to
Definition: messageitem.h:74
QString
QList
QColor
MessageList::Core::Theme::ContentItem::Type
Type
The available ContentItem types.
Definition: theme.h:125
QPixmap
MessageList::Core::Item
A single item of the MessageList tree managed by MessageList::Model.
Definition: item.h:52
item.h
MessageList::Core::FakeItem
A message item that can have a fake tag list and a fake annotation.
Definition: messageitem.h:214
MESSAGELIST_EXPORT
#define MESSAGELIST_EXPORT
Definition: messagelist_export.h:34
MessageList::Core::MessageItem::NotSigned
Definition: messageitem.h:90
MessageList::Core::MessageItem::SignatureState
SignatureState
Definition: messageitem.h:88
MessageList::Core::MessageItem::NotEncrypted
Definition: messageitem.h:82
MessageList::Core::Theme
The Theme class defines the visual appearance of the MessageList.
Definition: theme.h:65
MessageList::Core::MessageItem::FullyEncrypted
Definition: messageitem.h:84
MessageList::Core::ModelInvariantIndex
An invariant index that can be ALWAYS used to reference an item inside a QAbstractItemModel.
Definition: modelinvariantindex.h:44
MessageList::Core::MessageItem::Tag
Definition: messageitem.h:49
MessageList::Core::MessageItem::ThreadingStatus
ThreadingStatus
Definition: messageitem.h:72
MessageList::Core::MessageItem::FullySigned
Definition: messageitem.h:92
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