\section{KMacro\-Command Class Reference}
\label{classKMacroCommand}\index{KMacroCommand@{KMacroCommand}}
A Macro Command is a command that holds several sub-commands.  


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

Inheritance diagram for KMacro\-Command:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=72pt]{classKMacroCommand__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KMacro\-Command:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=179pt]{classKMacroCommand__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KMacro\-Command} (const  {\bf QString} \&name)
\begin{CompactList}\small\item\em Creates a macro command. \item\end{CompactList}\item 
void {\bf add\-Command} ({\bf KCommand} $\ast$command)
\begin{CompactList}\small\item\em Appends a command to this macro command. \item\end{CompactList}\item 
virtual void {\bf execute} ()
\begin{CompactList}\small\item\em Executes this command, i.e. \item\end{CompactList}\item 
virtual void {\bf unexecute} ()
\begin{CompactList}\small\item\em Undoes the execution of this command, i.e. \item\end{CompactList}\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
virtual void {\bf virtual\_\-hook} (int id, void $\ast$data)\label{classKMacroCommand_b0}

\end{CompactItemize}
\subsection*{Protected Attributes}
\begin{CompactItemize}
\item 
{\bf QPtr\-List}$<$ {\bf KCommand} $>$ {\bf m\_\-commands}\label{classKMacroCommand_p0}

\end{CompactItemize}


\subsection{Detailed Description}
A Macro Command is a command that holds several sub-commands. 

It will appear as one to the user and in the command history, but it can use the implementation of multiple commands internally. 



Definition at line 109 of file kcommand.h.

\subsection{Constructor \& Destructor Documentation}
\index{KMacroCommand@{KMacro\-Command}!KMacroCommand@{KMacroCommand}}
\index{KMacroCommand@{KMacroCommand}!KMacroCommand@{KMacro\-Command}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KMacro\-Command::KMacro\-Command (const {\bf QString} \& {\em name})}\label{classKMacroCommand_a0}


Creates a macro command. 

You will then need to call {\bf add\-Command}{\rm (p.\,\pageref{classKMacroCommand_a2})} for each subcommand to be added to this macro command. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em name}]the name of this command, translated, since it will appear in the menus. \end{description}
\end{Desc}


Definition at line 33 of file kcommand.cpp.

References KStd\-Accel::name(), and QPtr\-List$<$ KCommand $>$::set\-Auto\-Delete().

\subsection{Member Function Documentation}
\index{KMacroCommand@{KMacro\-Command}!addCommand@{addCommand}}
\index{addCommand@{addCommand}!KMacroCommand@{KMacro\-Command}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KMacro\-Command::add\-Command ({\bf KCommand} $\ast$ {\em command})}\label{classKMacroCommand_a2}


Appends a command to this macro command. 

The ownership is transfered to the macro command. 

Definition at line 38 of file kcommand.cpp.

References QPtr\-List$<$ KCommand $>$::append().\index{KMacroCommand@{KMacro\-Command}!execute@{execute}}
\index{execute@{execute}!KMacroCommand@{KMacro\-Command}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KMacro\-Command::execute ()\hspace{0.3cm}{\tt  [virtual]}}\label{classKMacroCommand_a3}


Executes this command, i.e. 

execute all the sub-commands in the order in which they were added. 

Implements {\bf KCommand} {\rm (p.\,\pageref{classKCommand_a1})}.

Definition at line 43 of file kcommand.cpp.

References QPtr\-List\-Iterator::current().\index{KMacroCommand@{KMacro\-Command}!unexecute@{unexecute}}
\index{unexecute@{unexecute}!KMacroCommand@{KMacro\-Command}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KMacro\-Command::unexecute ()\hspace{0.3cm}{\tt  [virtual]}}\label{classKMacroCommand_a4}


Undoes the execution of this command, i.e. 

{\bf unexecute}{\rm (p.\,\pageref{classKMacroCommand_a4})} all the sub-commands in the \_\-reverse\_\- order to the one in which they were added. 

Implements {\bf KCommand} {\rm (p.\,\pageref{classKCommand_a2})}.

Definition at line 50 of file kcommand.cpp.

References QPtr\-List\-Iterator::current(), and QPtr\-List\-Iterator::to\-Last().

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