File indexing completed on 2024-05-19 04:44:31
0001 /* This file is part of the KDE project 0002 * Copyright (C) 2010 by Adam Pigg (adam@piggz.co.uk) 0003 * 0004 * This library is free software; you can redistribute it and/or 0005 * modify it under the terms of the GNU Lesser General Public 0006 * License as published by the Free Software Foundation; either 0007 * version 2.1 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 * Lesser General Public License for more details. 0013 * 0014 * You should have received a copy of the GNU Lesser General Public 0015 * License along with this library. If not, see <http://www.gnu.org/licenses/>. 0016 */ 0017 0018 #ifndef KREPORTSCRIPTCHECK_H 0019 #define KREPORTSCRIPTCHECK_H 0020 0021 #include <QObject> 0022 0023 #include "KReportItemCheck.h" 0024 0025 namespace Scripting 0026 { 0027 /** 0028 @brief Checkbox item script interface 0029 0030 The user facing interface for scripting report checkbox items 0031 */ 0032 class CheckBox : public QObject 0033 { 0034 Q_OBJECT 0035 public: 0036 explicit CheckBox(KReportItemCheckBox *); 0037 0038 ~CheckBox() override; 0039 0040 public Q_SLOTS: 0041 0042 //! @return the value of the checkbox 0043 bool value() const; 0044 //! Set the value of the checkbox, defaults to checked if no value is given 0045 void setValue(bool val = true); 0046 0047 //! @return the style of the checkbox as Cross, Tick or Dot 0048 QString checkStyle() const; 0049 //!Sets the style of the checkbox, valid values are Cross, Tick or Dot 0050 void setCheckStyle(const QString&); 0051 0052 //! @return the foreground (text) color of the text-item 0053 QColor foregroundColor() const; 0054 0055 //! Sets the foreground (text) color of the text-item to the given color 0056 void setForegroundColor(const QColor&); 0057 0058 //! @return the border line color of the text-item 0059 QColor lineColor() const; 0060 0061 //! Sets the border line color of the text-item to the given color 0062 void setLineColor(const QColor&); 0063 0064 //! @return the border line weight (thickness) of the text-item 0065 int lineWeight() const; 0066 0067 //! Sets the border line weight (thickness) of the text-item 0068 void setLineWeight(int); 0069 0070 //! @return the border line style of the text-item. Values are from Qt::Penstyle range 0-5 0071 int lineStyle() const; 0072 0073 //! Sets the border line style of the text-item to the given style in the range 0-5 0074 void setLineStyle(int); 0075 0076 //! @returns the position of the text-item in points 0077 QPointF position() const; 0078 0079 //! Sets the position of the text-item to the given point coordinates 0080 void setPosition(const QPointF&); 0081 0082 //! @returns the size of the text-item in points 0083 QSizeF size() const; 0084 0085 //! Sets the size of the text-item to the given size in points 0086 void setSize(const QSizeF&); 0087 0088 private: 0089 KReportItemCheckBox *m_check; 0090 }; 0091 0092 } 0093 #endif // KREPORTSCRIPTCHECK_H