• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • kdeui
 

kdeui

  • kdeui
kedittoolbar.h
1 // -*- mode: c++; c-basic-offset: 2 -*-
2 /* This file is part of the KDE libraries
3  Copyright (C) 2000 Kurt Granroth <granroth@kde.org>
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Library General Public
7  License version 2 as published by the Free Software Foundation.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Library General Public License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to
16  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  Boston, MA 02110-1301, USA.
18 */
19 #ifndef _KEDITTOOLBAR_H
20 #define _KEDITTOOLBAR_H
21 
22 #include <tqwidget.h>
23 #include <kxmlguiclient.h>
24 #include <kdialogbase.h>
25 
26 class KProcess;
27 class KActionCollection;
28 class TQComboBox;
29 class TQToolButton;
30 class KListView;
31 class TQListViewItem;
32 
33 class KEditToolbarWidget;
34 class KEditToolbarPrivate;
35 class KEditToolbarWidgetPrivate;
36 namespace KEditToolbarInternal
37 {
38  class ToolbarItem;
39  class ToolbarListView;
40 }
110 class KDEUI_EXPORT KEditToolbar : public KDialogBase
111 {
112  Q_OBJECT
113 public:
144  KEditToolbar(KActionCollection *collection,
145  const TQString& xmlfile = TQString::null, bool global = true,
146  TQWidget* parent = 0, const char* name = 0);
147 
148  //KDE 4.0: merge the two constructors
149  /* Constructor for apps that do not use components, which has an extra argument
150  * specifying the toolbar to be shown.
151  * @param defaultToolbar The toolbar with this name will appear for editing.
152  * @param collection The collection of actions to work on.
153  * @param xmlfile The application's local resource file.
154  * @param global If @p true, then the global resource file will also
155  * be parsed.
156  * @param parent The parent of the dialog.
157  * @param name An internal name.
158  * @since 3.2
159  */
160  KEditToolbar(const TQString& defaultToolbar, KActionCollection *collection,
161  const TQString& xmlfile = TQString::null, bool global = true,
162  TQWidget* parent = 0, const char* name = 0);
186  KEditToolbar(KXMLGUIFactory* factory, TQWidget* parent = 0, const char* name = 0);
187 
188  //KDE 4.0: merge the two constructors
198  KEditToolbar(const TQString& defaultToolbar, KXMLGUIFactory* factory,
199  TQWidget* parent = 0, const char* name = 0);
200 
202  ~KEditToolbar();
203 
209  static void setDefaultToolbar(const char *toolbarName);
210 
211 protected slots:
215  virtual void slotOk();
219  virtual void slotApply();
220 
224  void acceptOK(bool b);
225 
229  void slotDefault();
230 
231 signals:
237  void newToolbarConfig();
238 
239 private:
240  void init();
241  KEditToolbarWidget *m_widget;
242 protected:
243  virtual void virtual_hook( int id, void* data );
244 private:
245  KEditToolbarPrivate *d;
246 
247  static const char *s_defaultToolbar;
248 };
249 
250 
270 class KDEUI_EXPORT KEditToolbarWidget : public TQWidget, virtual public KXMLGUIClient
271 {
272  Q_OBJECT
273 public:
303  KEditToolbarWidget(KActionCollection *collection,
304  const TQString& xmlfile = TQString::null,
305  bool global = true, TQWidget *parent = 0L);
306 
307  //KDE 4.0: merge the two constructors
308  /* Same as above, with an extra agrument specifying the toolbar to be shown.
309  *
310  * @param defaultToolbar The toolbar with this name will appear for editing.
311  * @param collection The collection of actions to work on
312  * @param xmlfile The application's local resource file
313  * @param global If true, then the global resource file will also
314  * be parsed
315  * @param parent This widget's parent
316  * @since 3.2
317  */
318  KEditToolbarWidget(const TQString& defaultToolbar,
319  KActionCollection *collection,
320  const TQString& file = TQString::null,
321  bool global = true,
322  TQWidget *parent = 0L);
323 
344  KEditToolbarWidget(KXMLGUIFactory* factory, TQWidget *parent = 0L);
345 
346  //KDE 4.0: merge the two constructors
347  /* Same as above, with an extra agrument specifying the toolbar to be shown.
348  *
349  *
350  * @param defaultToolbar The toolbar with this name will appear for editing.
351  * @param factory Your application's factory object
352  * @param parent This widget's parent
353  * @since 3.2
354  */
355  KEditToolbarWidget(const TQString& defaultToolbar,
356  KXMLGUIFactory* factory,
357  TQWidget *parent = 0L);
358 
364  virtual ~KEditToolbarWidget();
365 
369  virtual KActionCollection *actionCollection() const;
370 
379  bool save();
380 
385  void rebuildKXMLGUIClients();
386 
387 signals:
391  void enableOk(bool);
392 
393 protected slots:
394  void slotToolbarSelected(const TQString& text);
395 
396  void slotInactiveSelected(TQListViewItem *item);
397  void slotActiveSelected(TQListViewItem *item);
398 
399  void slotDropped(KListView *list, TQDropEvent *e, TQListViewItem *after);
400 
401  void slotInsertButton();
402  void slotRemoveButton();
403  void slotUpButton();
404  void slotDownButton();
405 
406  void slotChangeIcon();
407 
408 private slots:
409  void slotProcessExited( KProcess* );
410 
411 protected: // KDE4: make private
412  void setupLayout();
413 
414  void insertActive(KEditToolbarInternal::ToolbarItem *item, TQListViewItem *before, bool prepend = false);
415  void removeActive(KEditToolbarInternal::ToolbarItem *item);
416  void moveActive(KEditToolbarInternal::ToolbarItem *item, TQListViewItem *before);
417  void initNonKPart(KActionCollection *collection, const TQString& file, bool global);
418  void initKPart(KXMLGUIFactory* factory);
419  void loadToolbarCombo(const TQString& defaultToolbar = TQString::null);
420  void loadActionList(TQDomElement& elem);
421  void updateLocal(TQDomElement& elem);
422 
423 private:
424  KEditToolbarInternal::ToolbarListView *m_inactiveList;
425  KEditToolbarInternal::ToolbarListView *m_activeList;
426  TQComboBox *m_toolbarCombo;
427 
428  TQToolButton *m_upAction;
429  TQToolButton *m_removeAction;
430  TQToolButton *m_insertAction;
431  TQToolButton *m_downAction;
432 
433 protected:
434  virtual void virtual_hook( int id, void* data );
435 private:
436  KEditToolbarWidgetPrivate *d;
437 };
438 
439 #endif // _KEDITTOOLBAR_H
KActionCollection
A managed set of KAction objects.
Definition: kactioncollection.h:79
KDialogBase
A dialog base class with standard buttons and predefined layouts.
Definition: kdialogbase.h:192
KDialogBase::slotApply
virtual void slotApply()
Activated when the Apply button has been clicked.
Definition: kdialogbase.cpp:1171
KDialogBase::slotDefault
virtual void slotDefault()
Activated when the Default button has been clicked.
Definition: kdialogbase.cpp:1102
KDialogBase::slotOk
virtual void slotOk()
Activated when the Ok button has been clicked.
Definition: kdialogbase.cpp:1164
KEditToolbarWidget
A widget used to customize or configure toolbars.
Definition: kedittoolbar.h:271
KEditToolbarWidget::enableOk
void enableOk(bool)
Emitted whenever any modifications are made by the user.
KEditToolbar
A dialog used to customize or configure toolbars.
Definition: kedittoolbar.h:111
KEditToolbar::newToolbarConfig
void newToolbarConfig()
Signal emitted when 'apply' or 'ok' is clicked or toolbars were resetted.
KListView
This Widget extends the functionality of TQListView to honor the system wide settings for Single Clic...
Definition: klistview.h:54
KProcess
KXMLGUIClient
A KXMLGUIClient can be used with KXMLGUIFactory to create a GUI from actions and an XML document,...
Definition: kxmlguiclient.h:44
KXMLGUIFactory
KXMLGUIFactory, together with KXMLGUIClient objects, can be used to create a GUI of container widgets...
Definition: kxmlguifactory.h:63

kdeui

Skip menu "kdeui"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdeui

Skip menu "kdeui"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for kdeui by doxygen 1.9.1
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |