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

libkdepim

  • sources
  • kde-4.14
  • kdepim
  • libkdepim
  • misc
maillistdrag.h
Go to the documentation of this file.
1 /*
2  This file is part of libkdepim.
3 
4  Copyright (c) 2003 Don Sanders <sanders@kde.org>
5  Copyright (c) 2005 George Staikos <staikos@kde.org.
6  Copyright (c) 2005 Rafal Rzepecki <divide@users.sourceforge.net>
7  Copyright (c) 2008 Thomas McGuire <mcguire@kde.org>
8 
9  This library is free software; you can redistribute it and/or
10  modify it under the terms of the GNU Library General Public
11  License as published by the Free Software Foundation; either
12  version 2 of the License, or (at your option) any later version.
13 
14  This library is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  Library General Public License for more details.
18 
19  You should have received a copy of the GNU Library General Public License
20  along with this library; see the file COPYING.LIB. If not, write to
21  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22  Boston, MA 02110-1301, USA.
23 */
24 #ifndef KDEPIM_MAILLISTDRAG_H
25 #define KDEPIM_MAILLISTDRAG_H
26 
27 #include "kdepim_export.h"
28 
29 #include <QList>
30 #include <QMimeData>
31 #include <QString>
32 
33 #include <time.h>
34 
35 class KUrl;
36 
37 namespace KPIM {
38 
59 class KDEPIM_EXPORT MailSummary
60 {
61 public:
62  MailSummary( quint32 serialNumber, const QString &messageId, const QString &subject,
63  const QString &from, const QString &to, time_t date );
64  MailSummary() {}
65  ~MailSummary() {}
66 
68  void set( quint32, const QString&, const QString&, const QString&, const QString&, time_t );
69 
71  quint32 serialNumber() const;
72 
74  QString messageId() const;
75 
77  QString subject() const;
78 
80  QString from() const;
81 
83  QString to() const;
84 
86  time_t date() const;
87 
89 #ifdef Q_CC_MSVC
90  operator KUrl() const;
91 #endif
92 
93  KDE_DUMMY_COMPARISON_OPERATOR(MailSummary)
94  private:
95  quint32 mSerialNumber;
96  QString mMessageId, mSubject, mFrom, mTo;
97  time_t mDate;
98 };
99 #ifdef MAKE_KDEPIM_LIBS
100 KDE_DUMMY_QHASH_FUNCTION(MailSummary)
101 #endif
102 
106 class KDEPIM_EXPORT MailTextSource {
107  public:
108  MailTextSource() {}
109  virtual ~MailTextSource() {}
110 
111  virtual QByteArray text(quint32 serialNumber) const = 0;
112 };
113 
117 class KDEPIM_EXPORT MailList : public QList<MailSummary>
118 {
119 public:
120  static QString mimeDataType();
121  static bool canDecode( const QMimeData*md );
122  static MailList fromMimeData( const QMimeData*md );
123  static QByteArray serialsFromMimeData( const QMimeData *md );
124  static MailList decode( const QByteArray& payload );
125  void populateMimeData( QMimeData*md );
126 };
127 
142 class KDEPIM_EXPORT MailListMimeData : public QMimeData
143 {
144 public:
145 
152  explicit MailListMimeData( MailTextSource *src = 0 );
153 
154  ~MailListMimeData();
155 
156 protected:
157 
162  virtual QVariant retrieveData( const QString & mimeType,
163  QVariant::Type type ) const;
164 
165  virtual bool hasFormat ( const QString & mimeType ) const;
166 
167  virtual QStringList formats () const;
168 
169 private:
170 
171  MailTextSource *mMailTextSource;
172 
173  // Acts as a cache for the mail text because retrieveData() can be called
174  // multiple times.
175  mutable QByteArray mMails;
176 };
177 
178 } // namespace KPIM
179 
180 #endif /*maillistdrag_h*/
kdepim_export.h
QByteArray
KPIM::MailTextSource::MailTextSource
MailTextSource()
Definition: maillistdrag.h:108
KPIM::MailListMimeData
This special QMimeData has the ability to be associated with a MailTextSource.
Definition: maillistdrag.h:142
KPIM::MailTextSource::~MailTextSource
virtual ~MailTextSource()
Definition: maillistdrag.h:109
KPIM::MailTextSource
Object for the drag object to call-back for message fulltext.
Definition: maillistdrag.h:106
QMimeData
KPIM::MailSummary::~MailSummary
~MailSummary()
Definition: maillistdrag.h:65
QString
QList
QStringList
KPIM::MailSummary
Represents a single dragged mail.
Definition: maillistdrag.h:59
KPIM::MailList
List of mail summaries.
Definition: maillistdrag.h:117
KDEPIM_EXPORT
#define KDEPIM_EXPORT
Definition: kdepim_export.h:35
KPIM::MailSummary::MailSummary
MailSummary()
Definition: maillistdrag.h:64
QVariant
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:33:50 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

libkdepim

Skip menu "libkdepim"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules

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