KDEUI
ktoolbar.h
Go to the documentation of this file.
00001 /* This file is part of the KDE libraries 00002 Copyright (C) 2000 Reginald Stadlbauer (reggie@kde.org) 00003 (C) 1997, 1998 Stephan Kulow (coolo@kde.org) 00004 (C) 1997, 1998 Sven Radej (radej@kde.org) 00005 (C) 1997, 1998 Mark Donohoe (donohoe@kde.org) 00006 (C) 1997, 1998 Matthias Ettrich (ettrich@kde.org) 00007 (C) 1999, 2000 Kurt Granroth (granroth@kde.org) 00008 (C) 2005-2006 Hamish Rodda (rodda@kde.org) 00009 00010 This library is free software; you can redistribute it and/or 00011 modify it under the terms of the GNU Library General Public 00012 License version 2 as published by the Free Software Foundation. 00013 00014 This library is distributed in the hope that it will be useful, 00015 but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00017 Library General Public License for more details. 00018 00019 You should have received a copy of the GNU Library General Public License 00020 along with this library; see the file COPYING.LIB. If not, write to 00021 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00022 Boston, MA 02110-1301, USA. 00023 */ 00024 00025 #ifndef KTOOLBAR_H 00026 #define KTOOLBAR_H 00027 00028 #include <kdeui_export.h> 00029 00030 #include <QtGui/QToolBar> 00031 00032 class QDomElement; 00033 00034 class KConfigGroup; 00035 class KConfig; 00036 class KMainWindow; 00037 class KXMLGUIClient; 00038 00053 class KDEUI_EXPORT KToolBar : public QToolBar 00054 { 00055 Q_OBJECT 00056 00057 public: 00072 explicit KToolBar(QWidget *parent, bool isMainToolBar = false, bool readConfig = true); 00073 // KDE5: remove. The one below is preferred so that all debug output from init() shows the right objectName already, 00074 // and so that isMainToolBar() and iconSizeDefault() return correct values during loading too. 00075 00091 explicit KToolBar(const QString& objectName, QWidget* parent, bool readConfig = true); 00092 00105 KToolBar(const QString& objectName, QMainWindow* parentWindow, Qt::ToolBarArea area, bool newLine = false, 00106 bool isMainToolBar = false, bool readConfig = true); // KDE5: remove, I don't think anyone is using this. 00107 00111 virtual ~KToolBar(); 00112 00116 KMainWindow* mainWindow() const; 00117 00121 void setIconDimensions( int size ); 00122 00128 int iconSizeDefault() const; // KDE5: hide from public API. Doesn't make sense to export this, and it isn't used. 00129 00136 #ifndef KDE_NO_DEPRECATED 00137 KDE_DEPRECATED void setContextMenuEnabled( bool enable = true ); 00138 #endif 00139 00145 #ifndef KDE_NO_DEPRECATED 00146 KDE_DEPRECATED bool contextMenuEnabled() const; 00147 #endif 00148 00152 void saveSettings( KConfigGroup &cg ); 00153 00162 void applySettings( const KConfigGroup &cg, bool forceGlobal = false ); 00163 00167 void setXMLGUIClient( KXMLGUIClient *client ); 00168 00172 void loadState( const QDomElement &element ); 00173 00177 void saveState( QDomElement &element ) const; 00178 00182 bool eventFilter( QObject* watched, QEvent* event ); 00183 00188 static Qt::ToolButtonStyle toolButtonStyleSetting(); // KDE5: make private and file-static, nobody is calling this 00189 00193 static bool toolBarsEditable(); 00194 00200 static void setToolBarsEditable( bool editable ); 00201 00205 static bool toolBarsLocked(); 00206 00210 static void setToolBarsLocked( bool locked ); 00211 00212 protected Q_SLOTS: 00213 virtual void slotMovableChanged(bool movable); 00214 00215 protected: 00216 virtual void contextMenuEvent( QContextMenuEvent* ); 00217 virtual void actionEvent( QActionEvent* ); 00218 00219 // Draggable toolbar configuration 00220 virtual void dragEnterEvent( QDragEnterEvent* ); 00221 virtual void dragMoveEvent( QDragMoveEvent* ); 00222 virtual void dragLeaveEvent( QDragLeaveEvent* ); 00223 virtual void dropEvent( QDropEvent* ); 00224 virtual void mousePressEvent( QMouseEvent* ); 00225 virtual void mouseMoveEvent( QMouseEvent* ); 00226 virtual void mouseReleaseEvent( QMouseEvent* ); 00227 00228 private: 00229 class Private; 00230 Private* const d; 00231 00232 Q_PRIVATE_SLOT( d, void slotAppearanceChanged() ) 00233 Q_PRIVATE_SLOT( d, void slotContextAboutToShow() ) 00234 Q_PRIVATE_SLOT( d, void slotContextAboutToHide() ) 00235 Q_PRIVATE_SLOT( d, void slotContextLeft() ) 00236 Q_PRIVATE_SLOT( d, void slotContextRight() ) 00237 Q_PRIVATE_SLOT( d, void slotContextTop() ) 00238 Q_PRIVATE_SLOT( d, void slotContextBottom() ) 00239 Q_PRIVATE_SLOT( d, void slotContextIcons() ) 00240 Q_PRIVATE_SLOT( d, void slotContextText() ) 00241 Q_PRIVATE_SLOT( d, void slotContextTextRight() ) 00242 Q_PRIVATE_SLOT( d, void slotContextTextUnder() ) 00243 Q_PRIVATE_SLOT( d, void slotContextIconSize() ) 00244 Q_PRIVATE_SLOT( d, void slotLockToolBars( bool ) ) 00245 }; 00246 00247 #endif
KDE 4.6 API Reference