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

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) 2016-2018 Jarosław Staniek <staniek@kde.org>
0005    Copyright (C) 2018 Dmitry Baryshev <dmitrymq@gmail.com>
0006 
0007    This library is free software; you can redistribute it and/or
0008    modify it under the terms of the GNU Library General Public
0009    License as published by the Free Software Foundation; either
0010    version 2 of the License, or (at your option) any later version.
0011 
0012    This library is distributed in the hope that it will be useful,
0013    but WITHOUT ANY WARRANTY; without even the implied warranty of
0014    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0015    Library General Public License for more details.
0016 
0017    You should have received a copy of the GNU Library General Public License
0018    along with this library; see the file COPYING.LIB.  If not, write to
0019    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0020  * Boston, MA 02110-1301, USA.
0021 */
0022 
0023 #ifndef KPROPERTYCOMPOSEDURLEDITOR_H
0024 #define KPROPERTYCOMPOSEDURLEDITOR_H
0025 
0026 #include "KPropertyComposedUrl.h"
0027 #include "KPropertyGenericSelectionEditor.h"
0028 
0029 #include <QScopedPointer>
0030 
0031 class KProperty;
0032 class KPropertyUrlEditorPrivate;
0033 
0034 /**
0035  * Editor for ComposedUrl type
0036  *
0037  * @since 3.2
0038  */
0039 class KPROPERTYWIDGETS_EXPORT KPropertyComposedUrlEditor : public KPropertyGenericSelectionEditor
0040 {
0041     Q_PROPERTY(KPropertyComposedUrl value READ value WRITE setValue USER true)
0042     Q_OBJECT
0043 
0044 public:
0045     explicit KPropertyComposedUrlEditor(const KProperty &property, QWidget *parent = nullptr);
0046     ~KPropertyComposedUrlEditor() override;
0047 
0048     virtual KPropertyComposedUrl value() const;
0049 
0050 Q_SIGNALS:
0051     void commitData(QWidget * editor);
0052 
0053 public Q_SLOTS:
0054     virtual void setValue(const KPropertyComposedUrl &value);
0055 
0056 protected Q_SLOTS:
0057     void selectButtonClicked() override;
0058 
0059 protected:
0060     bool eventFilter(QObject *o, QEvent *event) override;
0061 
0062 private:
0063     Q_DISABLE_COPY(KPropertyComposedUrlEditor)
0064     QScopedPointer<KPropertyUrlEditorPrivate> const d;
0065 };
0066 
0067 #endif // KPROPERTYCOMPOSEDURLEDITOR_H