.TH "KMultipleDrag" kde3 "11 Jun 2005" "Version Version 3.4.1" "kdecore Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KMultipleDrag \- This class makes it easy for applications to provide a drag object (for drag-n-drop or for clipboard) that has several representations of the same data, under different formats.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kmultipledrag.h>\fP
.PP
Inherits \fBQDragObject\fP.
.PP
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKMultipleDrag\fP (\fBQWidget\fP *dragSource=0L, const char *name=0L)"
.br
.ti -1c
.RI "void \fBaddDragObject\fP (\fBQDragObject\fP *dragObject)"
.br
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "virtual \fBQByteArray\fP \fBencodedData\fP (const char *mime) const "
.br
.ti -1c
.RI "virtual const char * \fBformat\fP (int i) const "
.br
.ti -1c
.RI "virtual void \fBvirtual_hook\fP (int id, void *data)"
.br
.in -1c
.SS "Protected Attributes"

.in +1c
.ti -1c
.RI "\fBQPtrList\fP< \fBQDragObject\fP > \fBm_dragObjects\fP"
.br
.ti -1c
.RI "\fBQValueList\fP< int > \fBm_numberFormats\fP"
.br
.in -1c
.SH "Detailed Description"
.PP 
This class makes it easy for applications to provide a drag object (for drag-n-drop or for clipboard) that has several representations of the same data, under different formats. 

Instead of creating a specific class for each case (as would otherwise be necessary), you can simply create independent drag objects (e.g. a \fBQImageDrag\fP object and a \fBKURLDrag\fP object), and bundle them together using KMultipleDrag.
.PP
Sample code for this:
.PP
.PP
.nf
 KMultipleDrag *drag = new KMultipleDrag( parentWidget );
 drag->addDragObject( new QImageDrag( someQImage, 0L ) );
 drag->addDragObject( new KURLDrag( someKURL, 0L ) );
 drag->drag();
.fi
.PP
.PP
Note that the drag objects added to the multiple drag become owned by it. For that reason their parent should be 0L.
.PP
\fBAuthor:\fP
.RS 4
David Faure <david@mandrakesoft.com> 
.RE
.PP

.PP
Definition at line 54 of file kmultipledrag.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KMultipleDrag::KMultipleDrag (\fBQWidget\fP * dragSource = \fC0L\fP, const char * name = \fC0L\fP)"
.PP
Create a new KMultipleDrag object. 
.PP
\fBParameters:\fP
.RS 4
\fIdragSource\fP the parent object which is the source of the data, 0 for a parent-less object 
.br
\fIname\fP the name of the object, can be 0 
.RE
.PP

.PP
Definition at line 25 of file kmultipledrag.cpp.
.PP
References QPtrList::setAutoDelete().
.SH "Member Function Documentation"
.PP 
.SS "void KMultipleDrag::addDragObject (\fBQDragObject\fP * dragObject)"
.PP
Call this to add each underlying drag object to the multiple drag object. 
.PP
The drag object should not have a parent because the multiple drag object will own it.
.PP
\fBParameters:\fP
.RS 4
\fIdragObject\fP the drag object to add. Should have no parent object. 
.RE
.PP

.PP
Definition at line 31 of file kmultipledrag.cpp.
.PP
References QValueList::append(), and QPtrList::append().
.SS "\fBQByteArray\fP KMultipleDrag::encodedData (const char * mime) const\fC [protected, virtual]\fP"
.PP
Returns the data of a drag object with that supports the given mime type. 
.PP
\fBParameters:\fP
.RS 4
\fImime\fP the mime type to search 
.RE
.PP
\fBReturns:\fP
.RS 4
the data, or a null byte array if not found 
.RE
.PP

.PP
Definition at line 42 of file kmultipledrag.cpp.
.PP
References QPtrListIterator::current().
.SS "const char * KMultipleDrag::format (int i) const\fC [protected, virtual]\fP"
.PP
Returns the \fCi'th\fP supported format, or 0. 
.PP
\fBParameters:\fP
.RS 4
\fIi\fP the number of the format to check 
.RE
.PP
\fBReturns:\fP
.RS 4
the format with the number \fCi\fP, or 0 otherwise 
.RE
.PP

.PP
Definition at line 58 of file kmultipledrag.cpp.
.PP
References QValueList::begin(), QPtrListIterator::current(), and QValueList::end().

.SH "Author"
.PP 
Generated automatically by Doxygen for kdecore Library from the source code.
