File indexing completed on 2024-04-14 04:36:10

0001 /* This file is part of the KDE project
0002    Copyright (C) 2004 Cedric Pasteur <cedric.pasteur@free.fr>
0003    Copyright (C) 2004 Alexander Dymo <cloudtemple@mskat.net>
0004    Copyright (C) 2008-2015 Jarosław Staniek <staniek@kde.org>
0005 
0006    This library is free software; you can redistribute it and/or
0007    modify it under the terms of the GNU Library General Public
0008    License as published by the Free Software Foundation; either
0009    version 2 of the License, or (at your option) any later version.
0010 
0011    This library is distributed in the hope that it will be useful,
0012    but WITHOUT ANY WARRANTY; without even the implied warranty of
0013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0014    Library General Public License for more details.
0015 
0016    You should have received a copy of the GNU Library General Public License
0017    along with this library; see the file COPYING.LIB.  If not, write to
0018    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0019  * Boston, MA 02110-1301, USA.
0020 */
0021 
0022 #ifndef KPROPERTY_CURSOREDIT_H
0023 #define KPROPERTY_CURSOREDIT_H
0024 
0025 #include "combobox.h"
0026 
0027 class KPROPERTYWIDGETS_EXPORT KPropertyCursorEditor : public KPropertyComboBoxEditor
0028 {
0029     Q_OBJECT
0030     Q_PROPERTY(QCursor value READ cursorValue WRITE setCursorValue USER true)
0031 
0032 public:
0033     explicit KPropertyCursorEditor(QWidget *parent = nullptr);
0034     ~KPropertyCursorEditor() override;
0035 
0036     virtual QCursor cursorValue() const;
0037 
0038 public Q_SLOTS:
0039     virtual void setCursorValue(const QCursor &value);
0040 
0041 private:
0042     Q_DISABLE_COPY(KPropertyCursorEditor)
0043     class Private;
0044     Private * const d;
0045 };
0046 
0047 class KPROPERTYWIDGETS_EXPORT KPropertyCursorDelegate : public KPropertyEditorCreatorInterface,
0048                                                         public KPropertyValuePainterInterface,
0049                                                         public KPropertyValueDisplayInterface
0050 {
0051 public:
0052     KPropertyCursorDelegate();
0053 
0054     QWidget *createEditor(int type, QWidget *parent, const QStyleOptionViewItem &option,
0055                           const QModelIndex &index) const override;
0056 
0057     void paint(QPainter *painter, const QStyleOptionViewItem &option,
0058                const QModelIndex &index) const override;
0059 
0060     QString valueToString(const QVariant &value, const QLocale &locale) const override;
0061 };
0062 
0063 #endif