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

tdeui

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

tdeui

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

tdeui

Skip menu "tdeui"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeui by doxygen 1.9.1
This website is maintained by Timothy Pearson.