File indexing completed on 2024-05-12 15:59:14
0001 /* This file is part of the KDE project 0002 * SPDX-FileCopyrightText: 2012 Dan Leinir Turthra Jensen <admin@leinir.dk> 0003 * 0004 * SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #include "PropertyContainer.h" 0008 0009 PropertyContainer::PropertyContainer(QString name, QObject* parent) 0010 : QObject(parent) 0011 , m_name(name) 0012 { 0013 } 0014 0015 PropertyContainer::~PropertyContainer() 0016 { 0017 } 0018 0019 void PropertyContainer::writeProperty(QString name, QVariant value) 0020 { 0021 setProperty(name.toLatin1(), value); 0022 } 0023 0024 QVariant PropertyContainer::readProperty(QString name) 0025 { 0026 return property(name.toLatin1()); 0027 } 0028 0029 const KisCubicCurve& PropertyContainer::curve() const 0030 { 0031 return m_curve; 0032 } 0033 0034 void PropertyContainer::setCurve(const KisCubicCurve& curve) 0035 { 0036 m_curve = curve; 0037 } 0038 0039 QList< KisCubicCurve >& PropertyContainer::curves() const 0040 { 0041 return m_curves; 0042 } 0043 0044 void PropertyContainer::setCurves(const QList< KisCubicCurve >& curves) 0045 { 0046 m_curves.clear(); 0047 m_curves = curves; 0048 } 0049 0050 int PropertyContainer::curveCount() const 0051 { 0052 return m_curves.count(); 0053 } 0054 0055 KisCubicCurve PropertyContainer::specificCurve(int index) const 0056 { 0057 if(index > -1 && index < m_curves.count()) 0058 { 0059 return KisCubicCurve(m_curves[index]); 0060 } 0061 return KisCubicCurve(); 0062 } 0063 0064 QString PropertyContainer::specificCurveName(int index) const 0065 { 0066 if(index > -1 && index < m_curves.count()) 0067 { 0068 return m_curves[index].name(); 0069 } 0070 return QString(); 0071 } 0072 0073 void PropertyContainer::setSpecificCurve(int index, const KisCubicCurve& curve) const 0074 { 0075 0076 m_curves[index] = curve; 0077 } 0078 0079 QString PropertyContainer::name() 0080 { 0081 return m_name; 0082 }