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

0001 /* This file is part of the KDE project
0002    Copyright (C) 2018 Jarosław Staniek <staniek@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 
0020 #include "KPropertyEditorItemEvent.h"
0021 
0022 class Q_DECL_HIDDEN KPropertyEditorItemEvent::Private
0023 {
0024 public:
0025     Private()
0026     {
0027     }
0028     const KProperty *property;
0029     QString name;
0030     QVariantMap parameters;
0031     QVariant result;
0032     bool hasResult = false;
0033 };
0034 
0035 KPropertyEditorItemEvent::KPropertyEditorItemEvent(const KProperty &property, const QString &name,
0036                                                    const QVariantMap &parameters)
0037     : d(new Private)
0038 {
0039     d->property = &property;
0040     d->name = name;
0041     d->parameters = parameters;
0042 }
0043 
0044 KPropertyEditorItemEvent::~KPropertyEditorItemEvent()
0045 {
0046 }
0047 
0048 const KProperty *KPropertyEditorItemEvent::property() const
0049 {
0050     return d->property;
0051 }
0052 
0053 QString KPropertyEditorItemEvent::name() const
0054 {
0055     return d->name;
0056 }
0057 
0058 QVariantMap KPropertyEditorItemEvent::parameters() const
0059 {
0060     return d->parameters;
0061 }
0062 
0063 void KPropertyEditorItemEvent::setResult(const QVariant &result)
0064 {
0065     d->hasResult = true;
0066     d->result = result;
0067 }
0068 
0069 QVariant KPropertyEditorItemEvent::result() const
0070 {
0071     return d->result;
0072 }
0073 
0074 bool KPropertyEditorItemEvent::hasResult() const
0075 {
0076     return d->hasResult;
0077 }