libtdepim

kvcarddrag.h
1/*
2 This file is part of libtdepim.
3
4 Copyright (c) 2002 Tobias Koenig <tokoe@kde.org>
5
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public
8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later version.
10
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details.
15
16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 Boston, MA 02110-1301, USA.
20*/
21
22#ifndef KVCARDDRAG_H
23#define KVCARDDRAG_H
24
25#include <tqdragobject.h>
26#include <tqstring.h>
27
28#include <tdeabc/addressee.h>
29#include <tdeabc/vcardparser.h> // for KABC_VCARD_ENCODING_FIX define
30#include <tdemacros.h>
31
32class KVCardDragPrivate;
33
40class TDE_EXPORT KVCardDrag : public TQStoredDrag
41{
42 TQ_OBJECT
43
44
45 public:
49 KVCardDrag( TQWidget *dragsource = 0, const char *name = 0 );
50
54#if defined(KABC_VCARD_ENCODING_FIX)
55 KVCardDrag( const TQByteArray &content, TQWidget *dragsource = 0, const char *name = 0 );
56#else
57 KVCardDrag( const TQString &content, TQWidget *dragsource = 0, const char *name = 0 );
58#endif
59 virtual ~KVCardDrag() {}
60
64#if defined(KABC_VCARD_ENCODING_FIX)
65 void setVCard( const TQByteArray &content );
66#else
67 void setVCard( const TQString &content );
68#endif
72 static bool canDecode( TQMimeSource *e );
73
77#if defined(KABC_VCARD_ENCODING_FIX)
78 static bool decode( TQMimeSource *e, TQByteArray &content );
79#else
80 static bool decode( TQMimeSource *e, TQString &content );
81#endif
82
86 static bool decode( TQMimeSource *e, TDEABC::Addressee::List& addressees );
87
88 protected:
89 virtual void virtual_hook( int id, void* data );
90
91 private:
92 KVCardDragPrivate *d;
93};
94
95#endif // KVCARDDRAG_H
A drag-and-drop object for vcards.
Definition: kvcarddrag.h:41