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 00168 #ifndef KDE_NO_DEPRECATED 00169 KDE_DEPRECATED void setXMLGUIClient( KXMLGUIClient *client ); 00170 #endif 00171 00176 void addXMLGUIClient( KXMLGUIClient *client ); 00177 00182 void removeXMLGUIClient( KXMLGUIClient *client ); 00183 00187 void loadState( const QDomElement &element ); 00188 00192 void saveState( QDomElement &element ) const; 00193 00197 bool eventFilter( QObject* watched, QEvent* event ); 00198 00203 static Qt::ToolButtonStyle toolButtonStyleSetting(); // KDE5: make private and file-static, nobody is calling this 00204 00208 static bool toolBarsEditable(); 00209 00215 static void setToolBarsEditable( bool editable ); 00216 00220 static bool toolBarsLocked(); 00221 00225 static void setToolBarsLocked( bool locked ); 00226 00227 protected Q_SLOTS: 00228 virtual void slotMovableChanged(bool movable); 00229 00230 protected: 00231 virtual void contextMenuEvent( QContextMenuEvent* ); 00232 virtual void actionEvent( QActionEvent* ); 00233 00234 // Draggable toolbar configuration 00235 virtual void dragEnterEvent( QDragEnterEvent* ); 00236 virtual void dragMoveEvent( QDragMoveEvent* ); 00237 virtual void dragLeaveEvent( QDragLeaveEvent* ); 00238 virtual void dropEvent( QDropEvent* ); 00239 virtual void mousePressEvent( QMouseEvent* ); 00240 virtual void mouseMoveEvent( QMouseEvent* ); 00241 virtual void mouseReleaseEvent( QMouseEvent* ); 00242 00243 private: 00244 class Private; 00245 Private* const d; 00246 00247 Q_PRIVATE_SLOT( d, void slotAppearanceChanged() ) 00248 Q_PRIVATE_SLOT( d, void slotContextAboutToShow() ) 00249 Q_PRIVATE_SLOT( d, void slotContextAboutToHide() ) 00250 Q_PRIVATE_SLOT( d, void slotContextLeft() ) 00251 Q_PRIVATE_SLOT( d, void slotContextRight() ) 00252 Q_PRIVATE_SLOT( d, void slotContextShowText() ) 00253 Q_PRIVATE_SLOT( d, void slotContextTop() ) 00254 Q_PRIVATE_SLOT( d, void slotContextBottom() ) 00255 Q_PRIVATE_SLOT( d, void slotContextIcons() ) 00256 Q_PRIVATE_SLOT( d, void slotContextText() ) 00257 Q_PRIVATE_SLOT( d, void slotContextTextRight() ) 00258 Q_PRIVATE_SLOT( d, void slotContextTextUnder() ) 00259 Q_PRIVATE_SLOT( d, void slotContextIconSize() ) 00260 Q_PRIVATE_SLOT( d, void slotLockToolBars( bool ) ) 00261 }; 00262 00263 #endif
This file is part of the KDE documentation.
Documentation copyright © 1996-2019 The KDE developers.
Generated on Mon Jan 21 2019 12:32:45 by doxygen 1.7.5.1 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2019 The KDE developers.
Generated on Mon Jan 21 2019 12:32:45 by doxygen 1.7.5.1 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.