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

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 TIKZUI_PROPERTY_BROWSER_H
0021 #define TIKZUI_PROPERTY_BROWSER_H
0022 
0023 #include "tikzui_export.h"
0024 
0025 #include <tikz/core/Value.h>
0026 #include <tikz/core/Uid.h>
0027 
0028 #include <QComboBox>
0029 
0030 
0031 class QtProperty;
0032 
0033 namespace tikz {
0034 namespace ui {
0035 
0036 class PropertyBrowserPrivate;
0037 class View;
0038 
0039 /**
0040  * todo
0041  */
0042 class TIKZKITUI_EXPORT PropertyBrowser : public QWidget
0043 {
0044     Q_OBJECT
0045 
0046 public:
0047     /**
0048      * Constructor with optional @p parennt widget.
0049      */
0050     explicit PropertyBrowser(QWidget *parent = nullptr);
0051 
0052     /**
0053      * Virtual destructor.
0054      */
0055     virtual ~PropertyBrowser();
0056 
0057     /**
0058      * Set the scene item to be modified to @p uid.
0059      */
0060     void setItem(const tikz::core::Uid & uid);
0061 
0062     void setView(tikz::ui::View * view);
0063 
0064 protected Q_SLOTS:
0065     void valueChanged(QtProperty *property, const tikz::Value & val);
0066     void valueChanged(QtProperty *property, bool val);
0067     void valueChanged(QtProperty *property, const QColor & val);
0068     void valueChanged(QtProperty *property, int val);
0069     void valueChanged(QtProperty *property, double val);
0070     void doubleValueChanged(QtProperty *property, double val);
0071     void enumValueChanged(QtProperty *property, int val);
0072     void valueChanged(QtProperty *property, const QString & val);
0073 
0074     void updateCurrentItem();
0075 
0076 private:
0077     PropertyBrowserPrivate * const d;
0078 };
0079 
0080 }
0081 }
0082 
0083 #endif // TIKZUI_PROPERTY_BROWSER_H
0084 
0085 // kate: indent-width 4; replace-tabs on;