\section{KEdit\-Toolbar Class Reference}
\label{classKEditToolbar}\index{KEditToolbar@{KEditToolbar}}
A dialog used to customize or configure toolbars.  


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

Inheritance diagram for KEdit\-Toolbar:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=55pt]{classKEditToolbar__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KEdit\-Toolbar:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=116pt]{classKEditToolbar__coll__graph}
\end{center}
\end{figure}
\subsection*{Signals}
\begin{CompactItemize}
\item 
void {\bf new\-Toolbar\-Config} ()
\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KEdit\-Toolbar} ({\bf KAction\-Collection} $\ast$collection, const {\bf QString} \&xmlfile=QString::null, bool global=true, {\bf QWidget} $\ast$parent=0, const char $\ast$name=0)
\item 
{\bf KEdit\-Toolbar} (const {\bf QString} \&default\-Toolbar, {\bf KAction\-Collection} $\ast$collection, const {\bf QString} \&xmlfile=QString::null, bool global=true, {\bf QWidget} $\ast$parent=0, const char $\ast$name=0)\label{classKEditToolbar_a1}

\item 
{\bf KEdit\-Toolbar} ({\bf KXMLGUIFactory} $\ast$factory, {\bf QWidget} $\ast$parent=0, const char $\ast$name=0)
\item 
{\bf KEdit\-Toolbar} (const {\bf QString} \&default\-Toolbar, {\bf KXMLGUIFactory} $\ast$factory, {\bf QWidget} $\ast$parent=0, const char $\ast$name=0)
\item 
{\bf $\sim$KEdit\-Toolbar} ()
\end{CompactItemize}
\subsection*{Static Public Member Functions}
\begin{CompactItemize}
\item 
static void {\bf set\-Default\-Toolbar} (const char $\ast$toolbar\-Name)
\end{CompactItemize}
\subsection*{Protected Slots}
\begin{CompactItemize}
\item 
virtual void {\bf slot\-Ok} ()
\item 
virtual void {\bf slot\-Apply} ()
\item 
void {\bf accept\-OK} (bool b)
\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
virtual void {\bf virtual\_\-hook} (int id, void $\ast$data)\label{classKEditToolbar_b0}

\end{CompactItemize}


\subsection{Detailed Description}
A dialog used to customize or configure toolbars. 

This dialog only works if your application uses the XML UI framework for creating menus and toolbars. It depends on the XML files to describe the toolbar layouts and it requires the actions to determine which buttons are active.

Typically, you would include the {\bf KStd\-Action::configure\-Toolbars()}{\rm (p.\,\pageref{namespaceKStdAction_a120})} standard action in your application. In your slot to this action, you would have something like so:



\footnotesize\begin{verbatim} KEditToolbar dlg(actionCollection());
 if (dlg.exec())
 {
   createGUI();
 }
\end{verbatim}
\normalsize


That code snippet also takes care of redrawing the menu and toolbars if you have made any changes.

If you are using KMain\-Window's settings methods (either save/apply manually or auto\-Save\-Settings), you should write something like: 

\footnotesize\begin{verbatim} void MyClass::slotConfigureToolbars()
 {
   saveMainWindowSettings( KGlobal::config(), "MainWindow" );
   KEditToolbar dlg(actionCollection());
   connect(&dlg,SIGNAL(newToolbarConfig()),this,SLOT(slotNewToolbarConfig()));
   dlg.exec();
 }

 void MyClass::slotNewToolbarConfig() // This is called when OK or Apply is clicked
 {
    ...if you use any action list, use plugActionList on each here...
    createGUI();
    applyMainWindowSettings( KGlobal::config(), "MainWindow" );
 }
\end{verbatim}
\normalsize


Note that the procedure is a bit different for KParts applications. In this case, you need only pass along a pointer to your application's {\bf KXMLGUIFactory}{\rm (p.\,\pageref{classKXMLGUIFactory})} object. The editor will take care of finding all of the action collections and XML files. The editor aims to be semi-intelligent about where it assigns any modifications. In other words, it will not write out part specific changes to your shell's XML file.

An example would be:



\footnotesize\begin{verbatim} saveMainWindowSettings( KGlobal::config(), "MainWindow" );
 KEditToolbar dlg(factory());
 connect(&dlg,SIGNAL(newToolbarConfig()),this,SLOT(slotNewToolbarConfig()));
 dlg.exec();

 void MyClass::slotNewToolbarConfig() // This is called when OK or Apply is clicked
 {
    ...if you use any action list, use plugActionList on each here...
    // Do NOT call createGUI()!
    applyMainWindowSettings( KGlobal::config(), "MainWindow" );
 }
\end{verbatim}
\normalsize


\begin{Desc}
\item[Author:]Kurt Granroth $<${\tt granroth@kde.org}$>$ \end{Desc}
\begin{Desc}
\item[Version:]\begin{Desc}
\item[Id]{\bf kedittoolbar.h}{\rm (p.\,\pageref{kedittoolbar_8h})} 353275 2004-10-10 08:07:34Z bhards \end{Desc}
\end{Desc}




Definition at line 110 of file kedittoolbar.h.

\subsection{Constructor \& Destructor Documentation}
\index{KEditToolbar@{KEdit\-Toolbar}!KEditToolbar@{KEditToolbar}}
\index{KEditToolbar@{KEditToolbar}!KEditToolbar@{KEdit\-Toolbar}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KEdit\-Toolbar::KEdit\-Toolbar ({\bf KAction\-Collection} $\ast$ {\em collection}, const {\bf QString} \& {\em xmlfile} = {\tt QString::null}, bool {\em global} = {\tt true}, {\bf QWidget} $\ast$ {\em parent} = {\tt 0}, const char $\ast$ {\em name} = {\tt 0})}\label{classKEditToolbar_a0}


Constructor for apps that do not use components. 

This is the only entry point to this class. You {\em must\/} pass along your collection of actions (some of which appear in your toolbars). The other two parameters are optional.

The second parameter, xmlfile(), is the name (absolute or relative) of your application's UI resource file. If it is left blank, then the resource file: share/apps/appname/appnameui.rc is used. This is the same resource file that is used by the default create\-GUI() function in {\bf KMain\-Window}{\rm (p.\,\pageref{classKMainWindow})} so you're usually pretty safe in leaving it blank.

The third parameter, global(), controls whether or not the global resource file is used. If this is {\tt true}, then you may edit all of the actions in your toolbars -- global ones and local one. If it is {\tt false}, then you may edit only your application's entries. The only time you should set this to false is if your application does not use the global resource file at all (very rare).

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em collection}]The collection of actions to work on. \item[{\em xmlfile}]The application's local resource file. \item[{\em global}]If {\tt true}, then the global resource file will also be parsed. \item[{\em parent}]The parent of the dialog. \item[{\em name}]An internal name. \end{description}
\end{Desc}


Definition at line 371 of file kedittoolbar.cpp.\index{KEditToolbar@{KEdit\-Toolbar}!KEditToolbar@{KEditToolbar}}
\index{KEditToolbar@{KEditToolbar}!KEditToolbar@{KEdit\-Toolbar}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KEdit\-Toolbar::KEdit\-Toolbar ({\bf KXMLGUIFactory} $\ast$ {\em factory}, {\bf QWidget} $\ast$ {\em parent} = {\tt 0}, const char $\ast$ {\em name} = {\tt 0})}\label{classKEditToolbar_a2}


Constructor for KParts based apps. 

The main parameter, factory(), is a pointer to the XML GUI factory object for your application. It contains a list of all of the GUI clients (along with the action collections and xml files) and the toolbar editor uses that.

Use this like so: 

\footnotesize\begin{verbatim} KEditToolbar edit(factory());
 if ( edit.exec() )
 ...
\end{verbatim}
\normalsize


\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em factory}]Your application's factory object \item[{\em parent}]The usual parent for the dialog. \item[{\em name}]An internal name.\end{description}
\end{Desc}
Some people seem tempted to use this also in non-KParts apps, using KMain\-Window::gui\-Factory(). This works, but only \_\-if\_\- setting conserve\-Memory to false when calling {\bf KMain\-Window::create\-GUI()}{\rm (p.\,\pageref{classKMainWindow_a9})}! If not, use the other KEdit\-Toolbar constructor. 

Definition at line 388 of file kedittoolbar.cpp.\index{KEditToolbar@{KEdit\-Toolbar}!KEditToolbar@{KEditToolbar}}
\index{KEditToolbar@{KEditToolbar}!KEditToolbar@{KEdit\-Toolbar}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KEdit\-Toolbar::KEdit\-Toolbar (const {\bf QString} \& {\em default\-Toolbar}, {\bf KXMLGUIFactory} $\ast$ {\em factory}, {\bf QWidget} $\ast$ {\em parent} = {\tt 0}, const char $\ast$ {\em name} = {\tt 0})}\label{classKEditToolbar_a3}


Constructor for KParts based apps, which has an extra argument specifying the toolbar to be shown. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em default\-Toolbar}]The toolbar with this name will appear for editing. \item[{\em factory}]Your application's factory object \item[{\em parent}]The usual parent for the dialog. \item[{\em name}]An internal name. \end{description}
\end{Desc}
\begin{Desc}
\item[Since:]3.2 \end{Desc}


Definition at line 395 of file kedittoolbar.cpp.\index{KEditToolbar@{KEdit\-Toolbar}!~KEditToolbar@{$\sim$KEditToolbar}}
\index{~KEditToolbar@{$\sim$KEditToolbar}!KEditToolbar@{KEdit\-Toolbar}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KEdit\-Toolbar::$\sim${\bf KEdit\-Toolbar} ()}\label{classKEditToolbar_a4}


destructor 



Definition at line 418 of file kedittoolbar.cpp.

\subsection{Member Function Documentation}
\index{KEditToolbar@{KEdit\-Toolbar}!setDefaultToolbar@{setDefaultToolbar}}
\index{setDefaultToolbar@{setDefaultToolbar}!KEditToolbar@{KEdit\-Toolbar}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KEdit\-Toolbar::set\-Default\-Toolbar (const char $\ast$ {\em toolbar\-Name})\hspace{0.3cm}{\tt  [static]}}\label{classKEditToolbar_e0}


Sets the default toolbar, which will be auto-selected when the constructor without the default\-Toolbar argument is used. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em toolbar\-Name}]the name of the toolbar \end{description}
\end{Desc}
\begin{Desc}
\item[Since:]3.3 \end{Desc}


Definition at line 454 of file kedittoolbar.cpp.\index{KEditToolbar@{KEdit\-Toolbar}!slotOk@{slotOk}}
\index{slotOk@{slotOk}!KEditToolbar@{KEdit\-Toolbar}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KEdit\-Toolbar::slot\-Ok ()\hspace{0.3cm}{\tt  [protected, virtual, slot]}}\label{classKEditToolbar_j0}


Overridden in order to save any changes made to the toolbars. 



Reimplemented from {\bf KDialog\-Base} {\rm (p.\,\pageref{classKDialogBase_j6})}.

Definition at line 429 of file kedittoolbar.cpp.

References QDialog::accept(), new\-Toolbar\-Config(), QDialog::reject(), and KEdit\-Toolbar\-Widget::save().\index{KEditToolbar@{KEdit\-Toolbar}!slotApply@{slotApply}}
\index{slotApply@{slotApply}!KEditToolbar@{KEdit\-Toolbar}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KEdit\-Toolbar::slot\-Apply ()\hspace{0.3cm}{\tt  [protected, virtual, slot]}}\label{classKEditToolbar_j1}


idem 



Reimplemented from {\bf KDialog\-Base} {\rm (p.\,\pageref{classKDialogBase_j7})}.

Definition at line 447 of file kedittoolbar.cpp.

References KDialog\-Base::enable\-Button\-Apply(), new\-Toolbar\-Config(), and KEdit\-Toolbar\-Widget::save().\index{KEditToolbar@{KEdit\-Toolbar}!acceptOK@{acceptOK}}
\index{acceptOK@{acceptOK}!KEditToolbar@{KEdit\-Toolbar}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KEdit\-Toolbar::accept\-OK (bool {\em b})\hspace{0.3cm}{\tt  [protected, slot]}}\label{classKEditToolbar_j2}


should OK really save? 



Definition at line 423 of file kedittoolbar.cpp.

References KDialog\-Base::enable\-Button\-OK().\index{KEditToolbar@{KEdit\-Toolbar}!newToolbarConfig@{newToolbarConfig}}
\index{newToolbarConfig@{newToolbarConfig}!KEditToolbar@{KEdit\-Toolbar}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KEdit\-Toolbar::new\-Toolbar\-Config ()\hspace{0.3cm}{\tt  [signal]}}\label{classKEditToolbar_l0}


Signal emitted when 'apply' or 'ok' is clicked. 

Connect to it, to plug action lists and to call apply\-Main\-Window\-Settings (see sample code in this class's documentation) 

Referenced by slot\-Apply(), and slot\-Ok().

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