\section{KMultiple\-Drag Class Reference}
\label{classKMultipleDrag}\index{KMultipleDrag@{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.  


{\tt \#include $<$kmultipledrag.h$>$}

Inheritance diagram for KMultiple\-Drag:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=61pt]{classKMultipleDrag__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KMultiple\-Drag:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=218pt]{classKMultipleDrag__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KMultiple\-Drag} ({\bf QWidget} $\ast$drag\-Source=0L, const  char $\ast$name=0L)
\begin{CompactList}\small\item\em Create a new KMultiple\-Drag object. \item\end{CompactList}\item 
void {\bf add\-Drag\-Object} ({\bf QDrag\-Object} $\ast$drag\-Object)
\begin{CompactList}\small\item\em Call this to add each underlying drag object to the multiple drag object. \item\end{CompactList}\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
virtual {\bf QByte\-Array} {\bf encoded\-Data} (const  char $\ast$mime) const 
\begin{CompactList}\small\item\em Returns the data of a drag object with that supports the given mime type. \item\end{CompactList}\item 
virtual const  char $\ast$ {\bf format} (int i) const 
\begin{CompactList}\small\item\em Returns the {\tt i'th} supported format, or 0. \item\end{CompactList}\item 
virtual void {\bf virtual\_\-hook} (int id, void $\ast$data)\label{classKMultipleDrag_b2}

\end{CompactItemize}
\subsection*{Protected Attributes}
\begin{CompactItemize}
\item 
{\bf QPtr\-List}$<$ {\bf QDrag\-Object} $>$ {\bf m\_\-drag\-Objects}\label{classKMultipleDrag_p0}

\item 
{\bf QValue\-List}$<$ int $>$ {\bf m\_\-number\-Formats}\label{classKMultipleDrag_p1}

\end{CompactItemize}


\subsection{Detailed Description}
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 {\bf QImage\-Drag} object and a {\bf KURLDrag}{\rm (p.\,\pageref{classKURLDrag})} object), and bundle them together using KMultiple\-Drag.

Sample code for this:

\small\begin{alltt}
 KMultipleDrag *drag = new KMultipleDrag( parentWidget );
 drag-$>$addDragObject( new QImageDrag( someQImage, 0L ) );
 drag-$>$addDragObject( KURLDrag::newDrag( someKURL, 0L ) );
 drag-$>${\bf drag()};
 \end{alltt}\normalsize 


Note that the drag objects added to the multiple drag become owned by it. For that reason their parent should be 0L.

\begin{Desc}
\item[Author:]David Faure $<${\tt david@mandrakesoft.com}$>$ \end{Desc}




Definition at line 53 of file kmultipledrag.h.

\subsection{Constructor \& Destructor Documentation}
\index{KMultipleDrag@{KMultiple\-Drag}!KMultipleDrag@{KMultipleDrag}}
\index{KMultipleDrag@{KMultipleDrag}!KMultipleDrag@{KMultiple\-Drag}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KMultiple\-Drag::KMultiple\-Drag ({\bf QWidget} $\ast$ {\em drag\-Source} = 0L, const char $\ast$ {\em name} = 0L)}\label{classKMultipleDrag_a0}


Create a new KMultiple\-Drag object. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em drag\-Source}]the parent object which is the source of the data, 0 for a parent-less object \item[{\em name}]the name of the object, can be 0 \end{description}
\end{Desc}


Definition at line 25 of file kmultipledrag.cpp.

References KStd\-Action::name(), and QPtr\-List$<$ QDrag\-Object $>$::set\-Auto\-Delete().

\subsection{Member Function Documentation}
\index{KMultipleDrag@{KMultiple\-Drag}!addDragObject@{addDragObject}}
\index{addDragObject@{addDragObject}!KMultipleDrag@{KMultiple\-Drag}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KMultiple\-Drag::add\-Drag\-Object ({\bf QDrag\-Object} $\ast$ {\em drag\-Object})}\label{classKMultipleDrag_a1}


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.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em drag\-Object}]the drag object to add. Should have no parent object. \end{description}
\end{Desc}


Definition at line 31 of file kmultipledrag.cpp.

References QValue\-List$<$ int $>$::append(), and QPtr\-List$<$ QDrag\-Object $>$::append().\index{KMultipleDrag@{KMultiple\-Drag}!encodedData@{encodedData}}
\index{encodedData@{encodedData}!KMultipleDrag@{KMultiple\-Drag}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QByte\-Array} KMultiple\-Drag::encoded\-Data (const char $\ast$ {\em mime}) const\hspace{0.3cm}{\tt  [protected, virtual]}}\label{classKMultipleDrag_b0}


Returns the data of a drag object with that supports the given mime type. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em mime}]the mime type to search \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]the data, or a null byte array if not found \end{Desc}


Definition at line 42 of file kmultipledrag.cpp.

References QPtr\-List\-Iterator::current().\index{KMultipleDrag@{KMultiple\-Drag}!format@{format}}
\index{format@{format}!KMultipleDrag@{KMultiple\-Drag}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const  char $\ast$ KMultiple\-Drag::format (int {\em i}) const\hspace{0.3cm}{\tt  [protected, virtual]}}\label{classKMultipleDrag_b1}


Returns the {\tt i'th} supported format, or 0. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em i}]the number of the format to check \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]the format with the number {\tt i}, or 0 otherwise \end{Desc}


Definition at line 58 of file kmultipledrag.cpp.

References QValue\-List$<$ int $>$::begin(), QPtr\-List\-Iterator::current(), and QValue\-List$<$ int $>$::end().

The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
kmultipledrag.h\item 
kmultipledrag.cpp\end{CompactItemize}
