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

libkdepim

maillistdrag.h

Go to the documentation of this file.
00001 /*
00002     This file is part of libkdepim.
00003 
00004     Copyright (c) 2003 Don Sanders <sanders@kde.org>
00005     Copyright (c) 2005 George Staikos <staikos@kde.org.
00006     Copyright (c) 2005 Rafal Rzepecki <divide@users.sourceforge.net>
00007     Copyright (c) 2008 Thomas McGuire <mcguire@kde.org>
00008 
00009     This library is free software; you can redistribute it and/or
00010     modify it under the terms of the GNU Library General Public
00011     License as published by the Free Software Foundation; either
00012     version 2 of the License, or (at your option) any later version.
00013 
00014     This library is distributed in the hope that it will be useful,
00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00017     Library General Public License for more details.
00018 
00019     You should have received a copy of the GNU Library General Public License
00020     along with this library; see the file COPYING.LIB.  If not, write to
00021     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00022     Boston, MA 02110-1301, USA.
00023 */
00024 #ifndef KDEPIM_MAILLISTDRAG_H
00025 #define KDEPIM_MAILLISTDRAG_H
00026 
00027 #include "kdepim_export.h"
00028 
00029 #include <QList>
00030 #include <QMimeData>
00031 #include <QString>
00032 
00033 #include <time.h>
00034 
00035 class KUrl;
00036 
00037 namespace KPIM {
00038 
00059 class KDEPIM_EXPORT MailSummary
00060 {
00061 public:
00062     MailSummary( quint32 serialNumber, const QString &messageId, const QString &subject,
00063                  const QString &from, const QString &to, time_t date );
00064     MailSummary() {}
00065     ~MailSummary() {}
00066 
00068     void set( quint32, const QString&, const QString&, const QString&, const QString&, time_t );
00069 
00071     quint32 serialNumber() const;
00072 
00074     QString messageId() const;
00075 
00077     QString subject() const;
00078 
00080     QString from() const;
00081 
00083     QString to() const;
00084 
00086     time_t date() const;
00087 
00089 #ifdef Q_CC_MSVC
00090     operator KUrl() const;
00091 #endif
00092 
00093     KDE_DUMMY_COMPARISON_OPERATOR(MailSummary)
00094 private:
00095     quint32 mSerialNumber;
00096     QString mMessageId, mSubject, mFrom, mTo;
00097     time_t mDate;
00098 };
00099 #ifdef MAKE_KDEPIM_LIBS
00100 KDE_DUMMY_QHASH_FUNCTION(MailSummary)
00101 #endif
00102 
00106 class KDEPIM_EXPORT MailTextSource {
00107 public:
00108     MailTextSource() {}
00109     virtual ~MailTextSource() {}
00110 
00111     virtual QByteArray text(quint32 serialNumber) const = 0;
00112 };
00113 
00117 class KDEPIM_EXPORT MailList : public QList<MailSummary>
00118 {
00119   public:
00120     static QString mimeDataType();
00121     static bool canDecode( const QMimeData*md );
00122     static MailList fromMimeData( const QMimeData*md );
00123     static QByteArray serialsFromMimeData( const QMimeData *md );
00124     static MailList decode( const QByteArray& payload );
00125     void populateMimeData( QMimeData*md );
00126 };
00127 
00142 class KDEPIM_EXPORT MailListMimeData : public QMimeData
00143 {
00144   public:
00145 
00152     MailListMimeData( MailTextSource *src = 0 );
00153 
00154     ~MailListMimeData();
00155 
00156   protected:
00157 
00162     virtual QVariant retrieveData( const QString & mimeType,
00163                                    QVariant::Type type ) const;
00164 
00165     virtual bool hasFormat ( const QString & mimeType ) const;
00166 
00167     virtual QStringList formats () const;
00168 
00169   private:
00170 
00171     MailTextSource *mMailTextSource;
00172 
00173     // Acts as a cache for the mail text because retrieveData() can be called
00174     // multiple times.
00175     mutable QByteArray mMails;
00176 };
00177 
00178 } // namespace KPIM
00179 
00180 #endif /*maillistdrag_h*/

libkdepim

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

kdepim

Skip menu "kdepim"
  • akonadi
  •   clients
  •   kabc
  •   kcal
  •   kcm
  • akregator
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt
  • kdgantt1
  • kjots
  • kleopatra
  • kmail
  • kmobiletools
  • knode
  • knotes
  • kontact
  • kontactinterfaces
  • korganizer
  •   korgac
  • kpilot
  • ktimetracker
  •   doc
  • libkdepim
  • libkholidays
  • libkleo
  • libkpgp
  • maildir
Generated for kdepim by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal