libkonq Library API Documentation

konq_drag.h

00001 /*  This file is part of the KDE project
00002     Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
00003 
00004     This program is free software; you can redistribute it and/or modify
00005     it under the terms of the GNU General Public License as published by
00006     the Free Software Foundation; either version 2 of the License, or
00007     (at your option) any later version.
00008 
00009     This program is distributed in the hope that it will be useful,
00010     but WITHOUT ANY WARRANTY; without even the implied warranty of
00011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012     GNU General Public License for more details.
00013 
00014     You should have received a copy of the GNU General Public License
00015     along with this program; if not, write to the Free Software
00016     Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00017 */
00018 
00019 #ifndef __konqdrag_h__
00020 #define __konqdrag_h__
00021 
00022 #include <qdragobject.h>
00023 #include <qrect.h>
00024 #include <qstring.h>
00025 #include <qiconview.h>
00026 
00027 #include <kurl.h>
00028 
00029 /*****************************************************************************
00030  *
00031  * Class KonqIconDrag
00032  *
00033  *****************************************************************************/
00034 
00035 // Clipboard/dnd data for: Icons + URLS + isCut
00036 class KonqIconDrag : public QIconDrag
00037 {
00038     Q_OBJECT
00039 
00040 public:
00041     KonqIconDrag( QWidget * dragSource, const char* name = 0 );
00042     virtual ~KonqIconDrag() {}
00043 
00044     const char* format( int i ) const;
00045     QByteArray encodedData( const char* mime ) const;
00046 
00047     void append( const QIconDragItem &item, const QRect &pr,
00048                  const QRect &tr, const QString &url );
00049 
00050     void setMoveSelection( bool move ) { m_bCutSelection = move; }
00051 
00052     static bool canDecode( const QMimeSource* e );
00053 
00054 protected:
00055     QStringList urls;
00056     bool m_bCutSelection;
00057 };
00058 
00059 // Clipboard/dnd data for: URLS + isCut
00060 class KonqDrag : public QUriDrag
00061 {
00062 public:
00063     static KonqDrag * newDrag( const KURL::List & urls, bool move, QWidget * dragSource = 0, const char* name = 0 );
00064 
00065 protected:
00066     KonqDrag( const QStrList & urls, bool move, QWidget * dragSource, const char* name );
00067 
00068 public:
00069     virtual ~KonqDrag() {}
00070 
00071     virtual const char* format( int i ) const;
00072     virtual QByteArray encodedData( const char* mime ) const;
00073 
00074     void setMoveSelection( bool move ) { m_bCutSelection = move; }
00075 
00076     // Returns true if the data was cut (used for KonqIconDrag too)
00077     static bool decodeIsCutSelection( const QMimeSource *e );
00078 
00079 protected:
00080     bool m_bCutSelection;
00081     QStrList m_urls;
00082 };
00083 
00084 #endif
KDE Logo
This file is part of the documentation for libkonq Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Thu Apr 29 21:20:28 2004 by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2003