.TH "KMultipleDrag" 3 "28 Jan 2004" "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
.RI "\fICreate a new KMultipleDrag object. \fP"
.ti -1c
.RI "void \fBaddDragObject\fP (\fBQDragObject\fP *dragObject)"
.br
.RI "\fICall this to add each underlying drag object to the multiple drag object. \fP"
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "virtual \fBQByteArray\fP \fBencodedData\fP (const  char *mime) const "
.br
.RI "\fIReturns the data of a drag object with that supports the given mime type. \fP"
.ti -1c
.RI "virtual const  char * \fBformat\fP (int i) const "
.br
.RI "\fIReturns the \fCi'th\fP supported format, or 0. \fP"
.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( KURLDrag::newDrag( someKURL, 0L ) );
 drag->\fBdrag()\fP;
 
.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 53 of file kmultipledrag.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KMultipleDrag::KMultipleDrag (\fBQWidget\fP * dragSource = 0L, const char * name = 0L)"
.PP
Create a new KMultipleDrag object. \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
Definition at line 25 of file kmultipledrag.cpp.
.PP
References KStdAction::name(), and QPtrList< QDragObject >::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. 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
Definition at line 31 of file kmultipledrag.cpp.
.PP
References QValueList< int >::append(), and QPtrList< QDragObject >::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. \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
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. \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
Definition at line 58 of file kmultipledrag.cpp.
.PP
References QValueList< int >::begin(), QPtrListIterator::current(), and QValueList< int >::end().

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