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

0001 /* This file is part of the KDE project
0002    Copyright (C) 2008-2015 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 "KDefaultPropertyFactory.h"
0021 #include "KPropertyUtils_p.h"
0022 #include "config-kproperty.h"
0023 #include "editors/booledit.h"
0024 #include "editors/coloredit.h"
0025 #include "editors/combobox.h"
0026 #include "editors/cursoredit.h"
0027 #include "editors/dateedit.h"
0028 #include "editors/datetimeedit.h"
0029 // #include "editors/dummywidget.h"
0030 #include "editors/pixmapedit.h"
0031 #include "editors/pointedit.h"
0032 #include "editors/pointfedit.h"
0033 #include "editors/fontedit.h"
0034 #include "editors/rectedit.h"
0035 #include "editors/KPropertyRectFEditor.h"
0036 #include "editors/sizeedit.h"
0037 #include "editors/sizefedit.h"
0038 #include "editors/sizepolicyedit.h"
0039 #include "editors/spinbox.h"
0040 /*#include "stringlistedit.h"*/
0041 #include "editors/linestyleedit.h"
0042 #include "editors/KPropertyStringEditor.h"
0043 // #include "symbolcombo.h"
0044 #include "editors/timeedit.h"
0045 #include "editors/KPropertyUrlEditor.h"
0046 
0047 KDefaultPropertyFactory::KDefaultPropertyFactory()
0048  : KPropertyWidgetsFactory()
0049 {
0050     KPropertyUtilsPrivate::setupPrivateIconsResourceWithMessage(
0051         QString::fromLatin1("kproperty%1").arg(KPROPERTY_STABLE_VERSION_MAJOR),
0052         QString::fromLatin1("icons/kproperty_%1.rcc").arg(KPropertyUtilsPrivate::supportedIconTheme()), QtFatalMsg);
0053 
0054     addEditor( KProperty::Bool, new KPropertyBoolDelegate );
0055 //! @todo    addEditor( KProperty::ByteArray, new KPropertyByteArrayDelegate );
0056     addEditor( KProperty::Color, new KPropertyColorComboDelegate );
0057     addEditor( KProperty::Cursor, new KPropertyCursorDelegate );
0058     addEditor( KProperty::Date, new KPropertyDateDelegate );
0059     addEditor( KProperty::DateTime, new KPropertyDateTimeDelegate );
0060     addEditor( KProperty::Double, new KPropertyDoubleSpinBoxDelegate );
0061     addEditor( KProperty::Font, new KPropertyFontDelegate );
0062     addEditor( KProperty::Int, new KPropertyIntSpinBoxDelegate );
0063     addEditor( KProperty::LineStyle, new KPropertyLineStyleComboDelegate );
0064     addEditor( KProperty::LongLong, new KPropertyIntSpinBoxDelegate ); //!< @todo add more specialized delegate
0065     addEditor( KProperty::Pixmap, new KPropertyPixmapDelegate );
0066     addEditor( KProperty::Point, new KPropertyPointDelegate );
0067     addEditor( KProperty::PointF, new KPropertyPointFDelegate );
0068     addEditor( KProperty::Rect, new KPropertyRectDelegate );
0069     addEditor( KProperty::RectF, new KPropertyRectFDelegate );
0070     addEditor( KProperty::Size, new KPropertySizeDelegate );
0071     addEditor( KProperty::SizeF, new KPropertySizeFDelegate );
0072     addEditor( KProperty::SizePolicy, new KPropertySizePolicyDelegate );
0073     addEditor( KProperty::String, new KPropertyStringDelegate );
0074     addEditor( KProperty::Time, new KPropertyTimeDelegate );
0075     addEditor( KProperty::UInt, new KPropertyIntSpinBoxDelegate ); //!< @todo add more specialized delegate
0076     addEditor( KProperty::ULongLong, new KPropertyIntSpinBoxDelegate ); //!< @todo add more specialized delegate
0077     addEditor( KProperty::Url, new KPropertyUrlDelegate );
0078     addEditor( KProperty::ComposedUrl, new KPropertyUrlDelegate );
0079     addEditor( KProperty::ValueFromList, new KPropertyComboBoxDelegate );
0080 }
0081 
0082 KDefaultPropertyFactory::~KDefaultPropertyFactory()
0083 {
0084 }