\section{KEdit\-Toolbar Class Reference}
\label{classKEditToolbar}\index{KEditToolbar@{KEditToolbar}}
This is a dialog used to customize or configure toolbars. 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=57pt]{classKEditToolbar__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KEdit\-Toolbar:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=123pt]{classKEditToolbar__coll__graph}
\end{center}
\end{figure}
\subsection*{Signals}
\begin{CompactItemize}
\item 
void {\bf new\-Toolbar\-Config} ()
\begin{CompactList}\small\item\em Signal emitted when 'apply' or 'ok' is clicked. \item\end{CompactList}\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)
\begin{CompactList}\small\item\em Constructor for apps that do not use components. \item\end{CompactList}\item 
{\bf KEdit\-Toolbar} ({\bf KXMLGUIFactory} $\ast$factory, {\bf QWidget} $\ast$parent=0, const  char $\ast$name=0)
\begin{CompactList}\small\item\em Constructor for KParts based apps. \item\end{CompactList}\item 
{\bf $\sim$KEdit\-Toolbar} ()
\begin{CompactList}\small\item\em destructor \item\end{CompactList}\end{CompactItemize}
\subsection*{Protected Slots}
\begin{CompactItemize}
\item 
virtual void {\bf slot\-Ok} ()
\begin{CompactList}\small\item\em Overridden in order to save any changes made to the toolbars. \item\end{CompactList}\item 
virtual void {\bf slot\-Apply} ()
\begin{CompactList}\small\item\em idem \item\end{CompactList}\item 
void {\bf accept\-OK} (bool b)
\begin{CompactList}\small\item\em should OK really save? \item\end{CompactList}\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}
This is a dialog used to customize or configure toolbars. 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_a116})}() standard action in your application. In your slot to this action, you would have something like so:

\small\begin{alltt}
 KEditToolbar dlg(actionCollection());
 if (dlg.exec())
 \{
   createGUI();
 \}
 \end{alltt}\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: \small\begin{alltt}
 void MyClass::slotConfigureToolbars()
 \{
   saveMainWindowSettings( {\bf KGlobal::config()}, "MainWindow" );
   KEditToolbar dlg(actionCollection());
   connect(\&dlg,SIGNAL({\bf newToolbarConfig()}{\rm (p.\,\pageref{classKEditToolbar_l0})}),this,SLOT(slotNewToolbarConfig()));
   if (dlg.exec())
   \{
      createGUI();
   \}
 \}\end{alltt}\normalsize 


\small\begin{alltt} void MyClass::slotNewToolbarConfig() // This is called when OK or Apply is clicked
 \{
    ...if you use any action list, use plugActionList on each here...
    applyMainWindowSettings( {\bf KGlobal::config()}, "MainWindow" );
 \}
 \end{alltt}\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:

\small\begin{alltt}
 saveMainWindowSettings( {\bf KGlobal::config()}, "MainWindow" );
 KEditToolbar dlg(factory());
 connect(\&dlg,SIGNAL({\bf newToolbarConfig()}{\rm (p.\,\pageref{classKEditToolbar_l0})}),this,SLOT(slotNewToolbarConfig()));
 dlg.exec(); // Note that you shouldn't call createGUI(), so if() might not be even needed anymore\end{alltt}\normalsize 


\small\begin{alltt} ... // See above for slotNewToolbarConfig
 \end{alltt}\normalsize 


\begin{Desc}
\item[Author:]Kurt Granroth $<${\tt granroth@kde.org}$>$  \begin{Desc}
\item[Id]{\bf kedittoolbar.h}{\rm (p.\,\pageref{kedittoolbar_8h})},v 1.25.4.2 2003/07/15 10:42:17 mueller Exp \end{Desc}
\end{Desc}




Definition at line 102 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} = QString::null, bool {\em global} = true, {\bf QWidget} $\ast$ {\em parent} = 0, const char $\ast$ {\em name} = 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 187 of file kedittoolbar.cpp.

References KStd\-Accel::name().\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} = 0, const char $\ast$ {\em name} = 0)}\label{classKEditToolbar_a1}


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: \small\begin{alltt}
 KEditToolbar edit(factory());
 if ( edit.exec() )
 ...
 \end{alltt}\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}


Definition at line 195 of file kedittoolbar.cpp.

References KStd\-Accel::name().\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_a2}


destructor 



Definition at line 216 of file kedittoolbar.cpp.

\subsection{Member Function Documentation}
\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 227 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 245 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 221 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}
