# kdeui Library API Documentation

Overview | Class Hierarchy | Classes | Classes (annotated) | Members | Namespaces | Source Files

# kedittoolbar.h

    00001 // -*- mode: c++; c-basic-offset: 2 -*-
    00002 /* This file is part of the KDE libraries
    00003    Copyright (C) 2000 Kurt Granroth <granroth@kde.org>
    00004
    00005    This library is free software; you can redistribute it and/or
    00006    modify it under the terms of the GNU Library General Public
    00007    License version 2 as published by the Free Software Foundation.
    00008
    00009    This library is distributed in the hope that it will be useful,
    00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
    00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00012    Library General Public License for more details.
    00013
    00014    You should have received a copy of the GNU Library General Public License
    00015    along with this library; see the file COPYING.LIB.  If not, write to
    00016    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    00017    Boston, MA 02111-1307, USA.
    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   //KDE 4.0: merge the two constructors
    00149   /* Constructor for apps that do not use components, which has an extra argument
    00150    * specifying the toolbar to be shown.
    00151    * @param defaultToolbar The toolbar with this name will appear for editing.
    00152    * @param collection The collection of actions to work on.
    00153    * @param xmlfile The application's local resource file.
    00154    * @param global If @p true, then the global resource file will also
    00155    *               be parsed.
    00156    * @param parent The parent of the dialog.
    00157    * @param name An internal name.
    00158    * @since 3.2
    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   //KDE 4.0: merge the two constructors
    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
    00226 signals:
    00232   void newToolbarConfig();
    00233
    00234 private:
    00235   void init();
    00236   KEditToolbarWidget *m_widget;
    00237 protected:
    00238   virtual void virtual_hook( int id, void* data );
    00239 private:
    00240   KEditToolbarPrivate *d;
    00241
    00242   static const char *s_defaultToolbar;
    00243 };
    00244
    00245
    00265 class KDEUI_EXPORT KEditToolbarWidget : public QWidget, virtual public KXMLGUIClient
    00266 {
    00267   Q_OBJECT
    00268 public:
    00298   KEditToolbarWidget(KActionCollection *collection,
    00299                      const QString& xmlfile = QString::null,
    00300                      bool global = true, QWidget *parent = 0L);
    00301
    00302    //KDE 4.0: merge the two constructors
    00303    /* Same as above, with an extra agrument specifying the toolbar to be shown.
    00304    *
    00305    * @param defaultToolbar The toolbar with this name will appear for editing.
    00306    * @param collection The collection of actions to work on
    00307    * @param xmlfile The application's local resource file
    00308    * @param global If true, then the global resource file will also
    00309    *               be parsed
    00310    * @param parent This widget's parent
    00311    * @since 3.2
    00312    */
    00313   KEditToolbarWidget(const QString& defaultToolbar,
    00314                      KActionCollection *collection,
    00315                      const QString& file = QString::null,
    00316                      bool global = true,
    00317                      QWidget *parent = 0L);
    00318
    00339   KEditToolbarWidget(KXMLGUIFactory* factory, QWidget *parent = 0L);
    00340
    00341    //KDE 4.0: merge the two constructors
    00342    /* Same as above, with an extra agrument specifying the toolbar to be shown.
    00343    *
    00344    *
    00345    * @param defaultToolbar The toolbar with this name will appear for editing.
    00346    * @param factory Your application's factory object
    00347    * @param parent This widget's parent
    00348    * @since 3.2
    00349    */
    00350   KEditToolbarWidget(const QString& defaultToolbar,
    00351                      KXMLGUIFactory* factory,
    00352                      QWidget *parent = 0L);
    00353
    00359   virtual ~KEditToolbarWidget();
    00360
    00364   virtual KActionCollection *actionCollection() const;
    00365
    00374   bool save();
    00375
    00376 signals:
    00380   void enableOk(bool);
    00381
    00382 protected slots:
    00383   void slotToolbarSelected(const QString& text);
    00384
    00385   void slotInactiveSelected(QListViewItem *item);
    00386   void slotActiveSelected(QListViewItem *item);
    00387
    00388   void slotDropped(KListView *list, QDropEvent *e, QListViewItem *after);
    00389
    00390   void slotInsertButton();
    00391   void slotRemoveButton();
    00392   void slotUpButton();
    00393   void slotDownButton();
    00394
    00395   void slotChangeIcon();
    00396
    00397 private slots:
    00398   void slotProcessExited( KProcess* );
    00399
    00400 protected:
    00401   void setupLayout();
    00402
    00403   void insertActive(ToolbarItem *item, QListViewItem *before, bool prepend = false);
    00404   void removeActive(ToolbarItem *item);
    00405   void initNonKPart(KActionCollection *collection, const QString& file, bool global);
    00406   void initKPart(KXMLGUIFactory* factory);
    00407   void loadToolbarCombo(const QString& defaultToolbar = QString::null);
    00408   void loadActionList(QDomElement& elem);
    00409   void updateLocal(QDomElement& elem);
    00410
    00411 private:
    00412   ToolbarListView *m_inactiveList;
    00413   ToolbarListView *m_activeList;
    00414   QComboBox *m_toolbarCombo;
    00415
    00416   QToolButton *m_upAction;
    00417   QToolButton *m_removeAction;
    00418   QToolButton *m_insertAction;
    00419   QToolButton *m_downAction;
    00420
    00421 protected:
    00422   virtual void virtual_hook( int id, void* data );
    00423 private:
    00424   KEditToolbarWidgetPrivate *d;
    00425 };
    00426
    00427 #endif // _KEDITTOOLBAR_H

This file is part of the documentation for kdeui Library Version 3.4.1.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat Jun 11 20:20:17 2005 by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2003