File indexing completed on 2024-05-19 04:36:37

0001 /* This file is part of the TikZKit project.
0002  *
0003  * Copyright (C) 2014 Dominik Haumann <dhaumann@kde.org>
0004  *
0005  * This library is free software; you can redistribute it and/or modify
0006  * it under the terms of the GNU Library General Public License as published
0007  * by the Free Software Foundation, either version 2 of the License, or
0008  * (at your option) any later version.
0009  *
0010  * This library is distributed in the hope that it will be useful,
0011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0013  * GNU Library General Public License for more details.
0014  *
0015  * You should have received a copy of the GNU Library General Public License
0016  * along with this library; see the file COPYING.LIB.  If not, see
0017  * <http://www.gnu.org/licenses/>.
0018  */
0019 
0020 #ifndef TIKZ_UI_VALUE_SPINBOX_FACTORY_H
0021 #define TIKZ_UI_VALUE_SPINBOX_FACTORY_H
0022 
0023 #include "ValuePropertyManager.h"
0024 
0025 #include <qteditorfactory.h>
0026 #include <tikz/core/Value.h>
0027 
0028 namespace tikz {
0029 namespace ui {
0030 
0031 class ValueSpinBoxFactoryPrivate;
0032 
0033 class ValueSpinBoxFactory : public QtAbstractEditorFactory<ValuePropertyManager>
0034 {
0035     Q_OBJECT
0036 public:
0037     ValueSpinBoxFactory(QObject *parent = nullptr);
0038     ~ValueSpinBoxFactory();
0039 protected:
0040     void connectPropertyManager(ValuePropertyManager *manager) override;
0041     QWidget *createEditor(ValuePropertyManager *manager, QtProperty *property,
0042                 QWidget *parent) override;
0043     void disconnectPropertyManager(ValuePropertyManager *manager) override;
0044 private:
0045     ValueSpinBoxFactoryPrivate *d_ptr;
0046     Q_DECLARE_PRIVATE(ValueSpinBoxFactory)
0047     Q_DISABLE_COPY(ValueSpinBoxFactory)
0048     Q_PRIVATE_SLOT(d_func(), void slotPropertyChanged(QtProperty *, const tikz::Value &))
0049     Q_PRIVATE_SLOT(d_func(), void slotRangeChanged(QtProperty *, const tikz::Value &, const tikz::Value &))
0050     Q_PRIVATE_SLOT(d_func(), void slotSingleStepChanged(QtProperty *, double))
0051     Q_PRIVATE_SLOT(d_func(), void slotDecimalsChanged(QtProperty *, int))
0052     Q_PRIVATE_SLOT(d_func(), void slotReadOnlyChanged(QtProperty *, bool))
0053     Q_PRIVATE_SLOT(d_func(), void slotSetValue(const tikz::Value &))
0054     Q_PRIVATE_SLOT(d_func(), void slotEditorDestroyed(QObject *))
0055 };
0056 
0057 }
0058 }
0059 
0060 #endif // TIKZ_UI_VALUE_SPINBOX_FACTORY_H
0061 
0062 // kate: indent-width 4; replace-tabs on;