1 /* This file is part of the KDE project 2 Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 3 Copyright (C) 2011 Jarosław Staniek <staniek@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 as published by the Free Software Foundation; either 8 version 2 of the License, or (at your option) any later version. 9 10 This library is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 Library General Public License for more details. 14 15 You should have received a copy of the GNU Library General Public License 16 along with this library; see the file COPYING.LIB. If not, write to 17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 * Boston, MA 02110-1301, USA. 19 */ 20 21 #ifndef KEXICOMMANDLINKBUTTON_H 22 #define KEXICOMMANDLINKBUTTON_H 23 24 #include <kexiutils/kexiutils_export.h> 25 26 #include <kexiutils/KexiPushButton.h> 27 28 class KexiCommandLinkButtonPrivate; 29 30 class KEXIUTILS_EXPORT KexiCommandLinkButton : public KexiPushButton 31 { 32 Q_OBJECT 33 34 Q_PROPERTY(QString description READ description WRITE setDescription) 35 Q_PROPERTY(bool flat READ isFlat WRITE setFlat DESIGNABLE false) 36 Q_PROPERTY(bool arrowVisible READ isArrowVisible WRITE setArrowVisible) 37 38 public: 39 explicit KexiCommandLinkButton(QWidget *parent=0); 40 explicit KexiCommandLinkButton(const QString &text, QWidget *parent=0); 41 KexiCommandLinkButton(const QString &text, const QString &description, QWidget *parent=0); 42 virtual ~KexiCommandLinkButton(); 43 44 QString description() const; 45 void setDescription(const QString &description); 46 bool isArrowVisible() const; 47 void setArrowVisible(bool visible); 48 49 protected: 50 QSize sizeHint() const; 51 int heightForWidth(int) const; 52 QSize minimumSizeHint() const; 53 bool event(QEvent *e); 54 void paintEvent(QPaintEvent *); 55 56 private: 57 Q_DISABLE_COPY(KexiCommandLinkButton) 58 friend class KexiCommandLinkButtonPrivate; 59 KexiCommandLinkButtonPrivate * const d; 60 }; 61 62 #endif // KEXICOMMANDLINKBUTTON 63