1 | // -*- c-basic-offset:4; indent-tabs-mode:nil -*- |
2 | // vim: set ts=4 sts=4 sw=4 et: |
3 | /* This file is part of the KDE libraries |
4 | Copyright (C) 2000 David Faure <faure@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 version 2 as published by the Free Software Foundation. |
9 | |
10 | This library is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Library General Public License for more details. |
14 | |
15 | You should have received a copy of the GNU Library General Public License |
16 | along with this library; see the file COPYING.LIB. If not, write to |
17 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
18 | Boston, MA 02110-1301, USA. |
19 | */ |
20 | |
21 | #ifndef K3BOOKMARKDRAG_H |
22 | #define K3BOOKMARKDRAG_H |
23 | |
24 | #include <kde3support_export.h> |
25 | |
26 | #include <kbookmark.h> |
27 | #include <Qt3Support/Q3ColorDrag> |
28 | #include <Qt3Support/Q3ValueList> |
29 | |
30 | // Clipboard/dnd data : URLs + XML for bookmarks |
31 | class KDE3SUPPORT_EXPORT K3BookmarkDrag : public Q3UriDrag |
32 | { |
33 | public: |
34 | static K3BookmarkDrag * newDrag( const Q3ValueList<KBookmark> & bookmarks, |
35 | QWidget * dragSource = 0, |
36 | const char * name = 0 ); |
37 | static K3BookmarkDrag * newDrag( const KBookmark & bookmark, |
38 | QWidget * dragSource = 0, |
39 | const char * name = 0 ); |
40 | protected: |
41 | K3BookmarkDrag( const Q3ValueList<KBookmark> & bookmarks, |
42 | const Q3StrList & urls, |
43 | QWidget * dragSource, |
44 | const char * name ); |
45 | public: |
46 | virtual ~K3BookmarkDrag() {} |
47 | |
48 | virtual const char* format( int i ) const; |
49 | virtual QByteArray encodedData( const char* mime ) const; |
50 | |
51 | static bool canDecode( const QMimeSource * e ); |
52 | static Q3ValueList<KBookmark> decode( const QMimeSource * e ); |
53 | |
54 | protected: |
55 | Q3ValueList<KBookmark> m_bookmarks; |
56 | QDomDocument m_doc; |
57 | }; |
58 | #endif |
59 | |