.TH "KEditToolbar" kde3 "11 Jun 2005" "Version Version 3.4.1" "kdeui Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KEditToolbar \- A dialog used to customize or configure toolbars.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kedittoolbar.h>\fP
.PP
Inherits \fBKDialogBase\fP.
.PP
.SS "Signals"

.in +1c
.ti -1c
.RI "void \fBnewToolbarConfig\fP ()"
.br
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKEditToolbar\fP (\fBKActionCollection\fP *collection, const \fBQString\fP &xmlfile=QString::null, bool global=true, \fBQWidget\fP *parent=0, const char *name=0)"
.br
.ti -1c
.RI "\fBKEditToolbar\fP (const \fBQString\fP &defaultToolbar, \fBKActionCollection\fP *collection, const \fBQString\fP &xmlfile=QString::null, bool global=true, \fBQWidget\fP *parent=0, const char *name=0)"
.br
.ti -1c
.RI "\fBKEditToolbar\fP (\fBKXMLGUIFactory\fP *factory, \fBQWidget\fP *parent=0, const char *name=0)"
.br
.ti -1c
.RI "\fBKEditToolbar\fP (const \fBQString\fP &defaultToolbar, \fBKXMLGUIFactory\fP *factory, \fBQWidget\fP *parent=0, const char *name=0)"
.br
.ti -1c
.RI "\fB~KEditToolbar\fP ()"
.br
.in -1c
.SS "Static Public Member Functions"

.in +1c
.ti -1c
.RI "static void \fBsetDefaultToolbar\fP (const char *toolbarName)"
.br
.in -1c
.SS "Protected Slots"

.in +1c
.ti -1c
.RI "virtual void \fBslotOk\fP ()"
.br
.ti -1c
.RI "virtual void \fBslotApply\fP ()"
.br
.ti -1c
.RI "void \fBacceptOK\fP (bool b)"
.br
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "virtual void \fBvirtual_hook\fP (int id, void *data)"
.br
.in -1c
.SH "Detailed Description"
.PP 
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.
.PP
Typically, you would include the \fBKStdAction::configureToolbars()\fP standard action in your application. In your slot to this action, you would have something like so:
.PP
.PP
.nf
 KEditToolbar dlg(actionCollection());
 if (dlg.exec())
 {
   createGUI();
 }
.fi
.PP
.PP
That code snippet also takes care of redrawing the menu and toolbars if you have made any changes.
.PP
If you are using KMainWindow's settings methods (either save/apply manually or autoSaveSettings), you should write something like: 
.PP
.nf
 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' );
 }

.fi
.PP
.PP
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 \fBKXMLGUIFactory\fP 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.
.PP
An example would be:
.PP
.PP
.nf
 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' );
 }
.fi
.PP
.PP
\fBAuthor:\fP
.RS 4
Kurt Granroth <granroth@kde.org> 
.RE
.PP
\fBVersion:\fP
.RS 4
\fBId\fP.RS 4
\fBkedittoolbar.h\fP 353275 2004-10-10 08:07:34Z bhards 
.RE
.PP
.RE
.PP

.PP
Definition at line 110 of file kedittoolbar.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KEditToolbar::KEditToolbar (\fBKActionCollection\fP * collection, const \fBQString\fP & xmlfile = \fCQString::null\fP, bool global = \fCtrue\fP, \fBQWidget\fP * parent = \fC0\fP, const char * name = \fC0\fP)"
.PP
Constructor for apps that do not use components. 
.PP
This is the only entry point to this class. You \fImust\fP pass along your collection of actions (some of which appear in your toolbars). The other two parameters are optional.
.PP
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 createGUI() function in \fBKMainWindow\fP so you're usually pretty safe in leaving it blank.
.PP
The third parameter, global(), controls whether or not the global resource file is used. If this is \fCtrue\fP, then you may edit all of the actions in your toolbars -- global ones and local one. If it is \fCfalse\fP, 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).
.PP
\fBParameters:\fP
.RS 4
\fIcollection\fP The collection of actions to work on. 
.br
\fIxmlfile\fP The application's local resource file. 
.br
\fIglobal\fP If \fCtrue\fP, then the global resource file will also be parsed. 
.br
\fIparent\fP The parent of the dialog. 
.br
\fIname\fP An internal name. 
.RE
.PP

.PP
Definition at line 371 of file kedittoolbar.cpp.
.SS "KEditToolbar::KEditToolbar (\fBKXMLGUIFactory\fP * factory, \fBQWidget\fP * parent = \fC0\fP, const char * name = \fC0\fP)"
.PP
Constructor for KParts based apps. 
.PP
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.
.PP
Use this like so: 
.PP
.nf
 KEditToolbar edit(factory());
 if ( edit.exec() )
 ...

.fi
.PP
.PP
\fBParameters:\fP
.RS 4
\fIfactory\fP Your application's factory object 
.br
\fIparent\fP The usual parent for the dialog. 
.br
\fIname\fP An internal name.
.RE
.PP
Some people seem tempted to use this also in non-KParts apps, using KMainWindow::guiFactory(). This works, but only _if_ setting conserveMemory to false when calling \fBKMainWindow::createGUI()\fP! If not, use the other KEditToolbar constructor. 
.PP
Definition at line 388 of file kedittoolbar.cpp.
.SS "KEditToolbar::KEditToolbar (const \fBQString\fP & defaultToolbar, \fBKXMLGUIFactory\fP * factory, \fBQWidget\fP * parent = \fC0\fP, const char * name = \fC0\fP)"
.PP
Constructor for KParts based apps, which has an extra argument specifying the toolbar to be shown. 
.PP
\fBParameters:\fP
.RS 4
\fIdefaultToolbar\fP The toolbar with this name will appear for editing. 
.br
\fIfactory\fP Your application's factory object 
.br
\fIparent\fP The usual parent for the dialog. 
.br
\fIname\fP An internal name. 
.RE
.PP
\fBSince:\fP
.RS 4
3.2 
.RE
.PP

.PP
Definition at line 395 of file kedittoolbar.cpp.
.SS "KEditToolbar::~\fBKEditToolbar\fP ()"
.PP
destructor 
.PP
Definition at line 418 of file kedittoolbar.cpp.
.SH "Member Function Documentation"
.PP 
.SS "void KEditToolbar::setDefaultToolbar (const char * toolbarName)\fC [static]\fP"
.PP
Sets the default toolbar, which will be auto-selected when the constructor without the defaultToolbar argument is used. 
.PP
\fBParameters:\fP
.RS 4
\fItoolbarName\fP the name of the toolbar 
.RE
.PP
\fBSince:\fP
.RS 4
3.3 
.RE
.PP

.PP
Definition at line 454 of file kedittoolbar.cpp.
.SS "void KEditToolbar::slotOk ()\fC [protected, virtual, slot]\fP"
.PP
Overridden in order to save any changes made to the toolbars. 
.PP
Reimplemented from \fBKDialogBase\fP.
.PP
Definition at line 429 of file kedittoolbar.cpp.
.PP
References QDialog::accept(), newToolbarConfig(), QDialog::reject(), and KEditToolbarWidget::save().
.SS "void KEditToolbar::slotApply ()\fC [protected, virtual, slot]\fP"
.PP
idem 
.PP
Reimplemented from \fBKDialogBase\fP.
.PP
Definition at line 447 of file kedittoolbar.cpp.
.PP
References KDialogBase::enableButtonApply(), newToolbarConfig(), and KEditToolbarWidget::save().
.SS "void KEditToolbar::acceptOK (bool b)\fC [protected, slot]\fP"
.PP
should OK really save? 
.PP
Definition at line 423 of file kedittoolbar.cpp.
.PP
References KDialogBase::enableButtonOK().
.SS "void KEditToolbar::newToolbarConfig ()\fC [signal]\fP"
.PP
Signal emitted when 'apply' or 'ok' is clicked. 
.PP
Connect to it, to plug action lists and to call applyMainWindowSettings (see sample code in this class's documentation) 
.PP
Referenced by slotApply(), and slotOk().

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