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

tdeui

  • tdeui
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 TDEProcess;
27 class TDEActionCollection;
28 class TQComboBox;
29 class TQToolButton;
30 class TDEListView;
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 TDEUI_EXPORT KEditToolbar : public KDialogBase
111 {
112  Q_OBJECT
113 public:
144  KEditToolbar(TDEActionCollection *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, TDEActionCollection *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 TDEUI_EXPORT KEditToolbarWidget : public TQWidget, virtual public KXMLGUIClient
271 {
272  Q_OBJECT
273 public:
303  KEditToolbarWidget(TDEActionCollection *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  TDEActionCollection *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 TDEActionCollection *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(TDEListView *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( TDEProcess* );
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(TDEActionCollection *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

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.8.1.2
This website is maintained by Timothy Pearson.