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 <libkonq_export.h>
00028 
00029 #include <kurl.h>
00030 
00031 /*****************************************************************************
00032  *
00033  * Class KonqIconDrag
00034  *
00035  *****************************************************************************/
00036 
00037 // Clipboard/dnd data for: Icons + URLS + isCut
00038 class LIBKONQ_EXPORT KonqIconDrag : public QIconDrag
00039 {
00040     Q_OBJECT
00041 
00042 public:
00043     KonqIconDrag( QWidget * dragSource, const char* name = 0 );
00044     virtual ~KonqIconDrag() {}
00045 
00046     const char* format( int i ) const;
00047     QByteArray encodedData( const char* mime ) const;
00048 
00049     void append( const QIconDragItem &item, const QRect &pr,
00050                  const QRect &tr, const QString &url );
00051 
00052     void setMoveSelection( bool move ) { m_bCutSelection = move; }
00053 
00054     static bool canDecode( const QMimeSource* e );
00055 
00056 protected:
00057     QStringList urls;
00058     bool m_bCutSelection;
00059 };
00060 
00061 // Clipboard/dnd data for: URLS + isCut
00062 class LIBKONQ_EXPORT KonqDrag : public QUriDrag
00063 {
00064 public:
00065     static KonqDrag * newDrag( const KURL::List & urls, bool move, QWidget * dragSource = 0, const char* name = 0 );
00066 
00067 protected:
00068     KonqDrag( const QStrList & urls, bool move, QWidget * dragSource, const char* name );
00069 
00070 public:
00071     virtual ~KonqDrag() {}
00072 
00073     virtual const char* format( int i ) const;
00074     virtual QByteArray encodedData( const char* mime ) const;
00075 
00076     void setMoveSelection( bool move ) { m_bCutSelection = move; }
00077 
00078     // Returns true if the data was cut (used for KonqIconDrag too)
00079     static bool decodeIsCutSelection( const QMimeSource *e );
00080 
00081 protected:
00082     bool m_bCutSelection;
00083     QStrList m_urls;
00084 };
00085 
00086 #endif
KDE Logo
This file is part of the documentation for libkonq Library Version 3.4.1.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Jun 13 19:27:50 2006 by doxygen 1.4.3 written by Dimitri van Heesch, © 1997-2003