Warning, file /office/calligra/libs/widgets/KoDockWidgetTitleBar.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 /* This file is part of the KDE project 0002 Copyright (c) 2007 Marijn Kruisselbrink <mkruisselbrink@kde.org> 0003 0004 This library is free software; you can redistribute it and/or 0005 modify it under the terms of the GNU Library General Public 0006 License as published by the Free Software Foundation; either 0007 version 2 of the License, or (at your option) any later version. 0008 0009 This library is distributed in the hope that it will be useful, 0010 but WITHOUT ANY WARRANTY; without even the implied warranty of 0011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0012 Library General Public License for more details. 0013 0014 You should have received a copy of the GNU Library General Public License 0015 along with this library; see the file COPYING.LIB. If not, write to 0016 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 0017 Boston, MA 02110-1301, USA. 0018 */ 0019 #ifndef KODOCKWIDGETTITLEBAR_H_ 0020 #define KODOCKWIDGETTITLEBAR_H_ 0021 0022 #include "kowidgets_export.h" 0023 #include <QDockWidget> 0024 0025 /** 0026 * @short A custom title bar for dock widgets. 0027 * 0028 * Allow customization such as collapsable, or hidding text. 0029 * 0030 * @see KoDockWidgetTitleBarButton 0031 */ 0032 class KOWIDGETS_EXPORT KoDockWidgetTitleBar : public QWidget 0033 { 0034 Q_OBJECT 0035 public: 0036 explicit KoDockWidgetTitleBar(QDockWidget *dockWidget); 0037 ~KoDockWidgetTitleBar() override; 0038 0039 QSize minimumSizeHint() const override; ///< reimplemented from QWidget 0040 QSize sizeHint() const override; ///< reimplemented from QWidget 0041 0042 enum TextVisibilityMode {TextCanBeInvisible, FullTextAlwaysVisible}; 0043 /// Define whether the minimal width should ensure that the full text is visible. 0044 /// textVisibilityMode is FullTextAlwaysVisible by default 0045 void setTextVisibilityMode(TextVisibilityMode textVisibilityMode); 0046 0047 void updateIcons(); 0048 0049 public Q_SLOTS: 0050 void setCollapsed(bool collapsed); 0051 void setLocked(bool locked); 0052 void setCollapsable(bool collapsable); 0053 0054 protected: 0055 void paintEvent(QPaintEvent* event) override; ///< reimplemented from QWidget 0056 void resizeEvent(QResizeEvent* event) override; ///< reimplemented from QWidget 0057 private: 0058 Q_PRIVATE_SLOT(d, void toggleFloating()) 0059 Q_PRIVATE_SLOT(d, void toggleCollapsed()) 0060 Q_PRIVATE_SLOT(d, void topLevelChanged(bool topLevel)) 0061 Q_PRIVATE_SLOT(d, void featuresChanged(QDockWidget::DockWidgetFeatures)) 0062 0063 class Private; 0064 Private * const d; 0065 }; 0066 0067 #endif // KODOCKWIDGETTITLEBAR_H_