libkdepim Library API Documentation

maillistdrag.h

00001 /* 00002 This file is part of libkdepim. 00003 00004 Copyright (c) 2003 Don Sanders <sanders@kde.org> 00005 00006 This library is free software; you can redistribute it and/or 00007 modify it under the terms of the GNU Library General Public 00008 License as published by the Free Software Foundation; either 00009 version 2 of the License, or (at your option) any later version. 00010 00011 This library is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 Library General Public License for more details. 00015 00016 You should have received a copy of the GNU Library General Public License 00017 along with this library; see the file COPYING.LIB. If not, write to 00018 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00019 Boston, MA 02111-1307, USA. 00020 */ 00021 #ifndef maillistdrag_h 00022 #define maillistdrag_h 00023 00024 #include "qdragobject.h" 00025 #include "qvaluelist.h" 00026 #include "qglobal.h" 00027 #include "time.h" 00028 00042 namespace KPIM { 00043 00044 class MailSummary 00045 { 00046 public: 00047 MailSummary( Q_UINT32 serialNumber, QString messageId, QString subject, 00048 QString from, QString to, time_t date ); 00049 MailSummary() {}; 00050 ~MailSummary() {}; 00051 00052 /*** Set fields for this mail summary ***/ 00053 void set( Q_UINT32, QString, QString, QString, QString, time_t ); 00054 00055 /*** KMail unique identification number ***/ 00056 Q_UINT32 serialNumber(); 00057 00058 /*** MD5 checksum of message identification string ***/ 00059 QString messageId(); 00060 00061 /*** Subject of the message including prefixes ***/ 00062 QString subject(); 00063 00064 /*** Simplified from address ***/ 00065 QString from(); 00066 00068 QString to(); 00069 00070 /*** Date the message was sent ***/ 00071 time_t date(); 00072 00073 private: 00074 Q_UINT32 mSerialNumber; 00075 QString mMessageId, mSubject, mFrom, mTo; 00076 time_t mDate; 00077 }; 00078 00079 // List of mail summaries 00080 typedef QValueList<MailSummary> MailList; 00081 00082 // Drag and drop object for mails 00083 class MailListDrag : public QStoredDrag 00084 { 00085 public: 00086 MailListDrag( MailList, QWidget * parent = 0 ); 00087 ~MailListDrag() {}; 00088 00089 /* Reset the list of mail summaries */ 00090 void setMailList( MailList ); 00091 00092 /* The format for this drag - "x-kmail-drag/message-list" */ 00093 static const char* format(); 00094 00095 /* Returns TRUE if the information in e can be decoded into a QString; 00096 otherwsie returns FALSE */ 00097 static bool canDecode( QMimeSource* e ); 00098 00099 /* Attempts to decode the dropped information; 00100 Returns TRUE if successful; otherwise return false */ 00101 static bool decode( QDropEvent* e, MailList& s ); 00102 00103 /* Attempts to decode the serialNumbers of the dropped information; 00104 Returns TRUE if successful; otherwise return false */ 00105 static bool decode( QDropEvent* e, QByteArray& a ); 00106 00107 /* Attempts to decode the encoded MailList; 00108 Returns TRUE if successful; otherwise return false */ 00109 static bool decode( QByteArray& a, MailList& s ); 00110 }; 00111 00112 } 00113 #endif /*maillistdrag_h*/
KDE Logo
This file is part of the documentation for libkdepim Library Version 3.3.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Fri Oct 1 15:18:55 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003