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

messagelist

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

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