kdeui
kedittoolbar.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef _KEDITTOOLBAR_H
00020 #define _KEDITTOOLBAR_H
00021
00022 #include <qwidget.h>
00023 #include <kxmlguiclient.h>
00024 #include <kdialogbase.h>
00025
00026 class KProcess;
00027 class KActionCollection;
00028 class QComboBox;
00029 class QToolButton;
00030 class KListView;
00031 class QListViewItem;
00032
00033 class KEditToolbarWidget;
00034 class KEditToolbarPrivate;
00035 class KEditToolbarWidgetPrivate;
00036 namespace
00037 {
00038 class ToolbarItem;
00039 class ToolbarListView;
00040 }
00110 class KDEUI_EXPORT KEditToolbar : public KDialogBase
00111 {
00112 Q_OBJECT
00113 public:
00144 KEditToolbar(KActionCollection *collection,
00145 const QString& xmlfile = QString::null, bool global = true,
00146 QWidget* parent = 0, const char* name = 0);
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160 KEditToolbar(const QString& defaultToolbar, KActionCollection *collection,
00161 const QString& xmlfile = QString::null, bool global = true,
00162 QWidget* parent = 0, const char* name = 0);
00186 KEditToolbar(KXMLGUIFactory* factory, QWidget* parent = 0, const char* name = 0);
00187
00188
00198 KEditToolbar(const QString& defaultToolbar, KXMLGUIFactory* factory,
00199 QWidget* parent = 0, const char* name = 0);
00200
00202 ~KEditToolbar();
00203
00209 static void setDefaultToolbar(const char *toolbarName);
00210
00211 protected slots:
00215 virtual void slotOk();
00219 virtual void slotApply();
00220
00224 void acceptOK(bool b);
00225
00229 void slotDefault();
00230
00231 signals:
00237 void newToolbarConfig();
00238
00239 private:
00240 void init();
00241 KEditToolbarWidget *m_widget;
00242 protected:
00243 virtual void virtual_hook( int id, void* data );
00244 private:
00245 KEditToolbarPrivate *d;
00246
00247 static const char *s_defaultToolbar;
00248 };
00249
00250
00270 class KDEUI_EXPORT KEditToolbarWidget : public QWidget, virtual public KXMLGUIClient
00271 {
00272 Q_OBJECT
00273 public:
00303 KEditToolbarWidget(KActionCollection *collection,
00304 const QString& xmlfile = QString::null,
00305 bool global = true, QWidget *parent = 0L);
00306
00307
00308
00309
00310
00311
00312
00313
00314
00315
00316
00317
00318 KEditToolbarWidget(const QString& defaultToolbar,
00319 KActionCollection *collection,
00320 const QString& file = QString::null,
00321 bool global = true,
00322 QWidget *parent = 0L);
00323
00344 KEditToolbarWidget(KXMLGUIFactory* factory, QWidget *parent = 0L);
00345
00346
00347
00348
00349
00350
00351
00352
00353
00354
00355 KEditToolbarWidget(const QString& defaultToolbar,
00356 KXMLGUIFactory* factory,
00357 QWidget *parent = 0L);
00358
00364 virtual ~KEditToolbarWidget();
00365
00369 virtual KActionCollection *actionCollection() const;
00370
00379 bool save();
00380
00385 void rebuildKXMLGUIClients();
00386
00387 signals:
00391 void enableOk(bool);
00392
00393 protected slots:
00394 void slotToolbarSelected(const QString& text);
00395
00396 void slotInactiveSelected(QListViewItem *item);
00397 void slotActiveSelected(QListViewItem *item);
00398
00399 void slotDropped(KListView *list, QDropEvent *e, QListViewItem *after);
00400
00401 void slotInsertButton();
00402 void slotRemoveButton();
00403 void slotUpButton();
00404 void slotDownButton();
00405
00406 void slotChangeIcon();
00407
00408 private slots:
00409 void slotProcessExited( KProcess* );
00410
00411 protected:
00412 void setupLayout();
00413
00414 void insertActive(ToolbarItem *item, QListViewItem *before, bool prepend = false);
00415 void removeActive(ToolbarItem *item);
00416 void moveActive(ToolbarItem *item, QListViewItem *before);
00417 void initNonKPart(KActionCollection *collection, const QString& file, bool global);
00418 void initKPart(KXMLGUIFactory* factory);
00419 void loadToolbarCombo(const QString& defaultToolbar = QString::null);
00420 void loadActionList(QDomElement& elem);
00421 void updateLocal(QDomElement& elem);
00422
00423 private:
00424 ToolbarListView *m_inactiveList;
00425 ToolbarListView *m_activeList;
00426 QComboBox *m_toolbarCombo;
00427
00428 QToolButton *m_upAction;
00429 QToolButton *m_removeAction;
00430 QToolButton *m_insertAction;
00431 QToolButton *m_downAction;
00432
00433 protected:
00434 virtual void virtual_hook( int id, void* data );
00435 private:
00436 KEditToolbarWidgetPrivate *d;
00437 };
00438
00439 #endif // _KEDITTOOLBAR_H