libkdepim

kvcarddrag.h

00001 /*
00002     This file is part of libkdepim.
00003 
00004     Copyright (c) 2002 Tobias Koenig <tokoe@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., 51 Franklin Street, Fifth Floor,
00019     Boston, MA 02110-1301, USA.
00020 */
00021 
00022 #ifndef KVCARDDRAG_H
00023 #define KVCARDDRAG_H
00024 
00025 #include <qdragobject.h>
00026 #include <qstring.h>
00027 
00028 #include <kabc/addressee.h>
00029 #include <kabc/vcardparser.h> // for KABC_VCARD_ENCODING_FIX define
00030 #include <kdepimmacros.h>
00031 
00032 class KVCardDragPrivate;
00033 
00040 class KDE_EXPORT KVCardDrag : public QStoredDrag
00041 {
00042   Q_OBJECT
00043 
00044   public:
00048     KVCardDrag( QWidget *dragsource = 0, const char *name = 0 );
00049 
00053 #if defined(KABC_VCARD_ENCODING_FIX)
00054     KVCardDrag( const QByteArray &content, QWidget *dragsource = 0, const char *name = 0 );
00055 #else
00056     KVCardDrag( const QString &content, QWidget *dragsource = 0, const char *name = 0 );
00057 #endif
00058     virtual ~KVCardDrag() {}
00059 
00063 #if defined(KABC_VCARD_ENCODING_FIX)
00064     void setVCard( const QByteArray &content );
00065 #else
00066     void setVCard( const QString &content );
00067 #endif
00068 
00071     static bool canDecode( QMimeSource *e );
00072 
00076 #if defined(KABC_VCARD_ENCODING_FIX)
00077     static bool decode( QMimeSource *e, QByteArray &content );
00078 #else
00079     static bool decode( QMimeSource *e, QString &content );
00080 #endif
00081 
00085     static bool decode( QMimeSource *e, KABC::Addressee::List& addressees );
00086 
00087   protected:
00088      virtual void virtual_hook( int id, void* data );
00089 
00090   private:
00091      KVCardDragPrivate *d;
00092 };
00093 
00094 #endif // KVCARDDRAG_H
KDE Home | KDE Accessibility Home | Description of Access Keys