18#include "KReportScriptLabel.h"
25Label::Label(KReportItemLabel *l)
35QString Label::caption()
const
37 return m_label->text();
40void Label::setCaption(
const QString& c)
45int Label::horizontalAlignment()
const
47 const QString a = m_label->m_horizontalAlignment->value().toString().
toLower();
49 if (a == QLatin1String(
"left")) {
52 if (a == QLatin1String(
"center")) {
55 if (a == QLatin1String(
"right")) {
60void Label::setHorizonalAlignment(
int a)
64 m_label->m_horizontalAlignment->setValue(QLatin1String(
"left"));
67 m_label->m_horizontalAlignment->setValue(QLatin1String(
"center"));
70 m_label->m_horizontalAlignment->setValue(QLatin1String(
"right"));
73 m_label->m_horizontalAlignment->setValue(QLatin1String(
"left"));
78int Label::verticalAlignment()
const
80 const QString a = m_label->m_horizontalAlignment->value().toString().toLower();
82 if (a == QLatin1String(
"top")) {
85 if (a == QLatin1String(
"middle")) {
88 if (a == QLatin1String(
"bottom")) {
93void Label::setVerticalAlignment(
int a)
97 m_label->m_verticalAlignment->setValue(QLatin1String(
"top"));
100 m_label->m_verticalAlignment->setValue(QLatin1String(
"middle"));
103 m_label->m_verticalAlignment->setValue(QLatin1String(
"bottom"));
106 m_label->m_verticalAlignment->setValue(QLatin1String(
"middle"));
111QColor Label::backgroundColor()
const
113 return m_label->m_backgroundColor->value().value<QColor>();
115void Label::setBackgroundColor(
const QColor& c)
117 m_label->m_backgroundColor->setValue(c);
120QColor Label::foregroundColor()
const
122 return m_label->m_foregroundColor->value().value<QColor>();
124void Label::setForegroundColor(
const QColor& c)
126 m_label->m_foregroundColor->setValue(c);
129int Label::backgroundOpacity()
const
131 return m_label->m_backgroundOpacity->value().toInt();
133void Label::setBackgroundOpacity(
int o)
135 m_label->m_backgroundOpacity->setValue(o);
138QColor Label::lineColor()
const
140 return m_label->m_lineColor->value().value<QColor>();
142void Label::setLineColor(
const QColor& c)
144 m_label->m_lineColor->setValue(c);
147int Label::lineWeight()
const
149 return m_label->m_lineWeight->value().toInt();
151void Label::setLineWeight(
int w)
153 m_label->m_lineWeight->setValue(w);
156int Label::lineStyle()
const
158 return m_label->m_lineStyle->value().toInt();
160void Label::setLineStyle(
int s)
162 if (s < 0 || s > 5) {
165 m_label->m_lineStyle->setValue(s);
168QPointF Label::position()
const
170 return m_label->position();
172void Label::setPosition(
const QPointF &p)
174 m_label->setPosition(p);
177QSizeF Label::size()
const
179 return m_label->size();
181void Label::setSize(
const QSizeF &s)
Field item script interface.
QString toLower() const const