18#include "KReportRenderObjects.h"
19#include "KReportUtils_p.h"
21#include "kreport_debug.h"
26 return s1->position().
x() < s2->position().
x();
41 KReportPrivate::PageLayout pageLayout;
44ORODocument::Private::Private()
49ORODocument::Private::~Private()
56ORODocument::ORODocument(
const QString& title) : d(new Private())
61ORODocument::~ORODocument()
66void ORODocument::setTitle(
const QString &title)
73 return d->pages.
value(index);
78 return d->pages.
value(index);
87 if (p->document() !=
nullptr && p->document() !=
this) {
97 return d->sections.
value(pnum);
102 return d->sections.
value(index);
111 if (s->document() !=
nullptr && s->document() !=
this) {
114 s->setDocument(
this);
118void ORODocument::setPageLayout(
const QPageLayout & options)
120 d->pageLayout = options;
123void ORODocument::notifyChange(
int pageNo)
125 emit(updated(pageNo));
130 return d->pageLayout;
135 return d->pages.
count();
140 return d->sections.
count();
143QString ORODocument::title()
const
178class Q_DECL_HIDDEN
OROPage::Private
187OROPage::Private::Private()
191OROPage::Private::~Private()
193 qDeleteAll(primitives);
199 d->document = pDocument;
210int OROPage::pageNumber()
const
220 return d->primitives.
value(index);
225 return d->primitives.
value(index);
229void OROPage::insertPrimitive(
OROPrimitive* p,
int index)
239 d->primitives.
insert(index, p);
246 d->document->notifyChange(pageNumber());
262int OROPage::primitiveCount()
const
264 return d->primitives.
count();
296 KReportSectionData::Type
type = KReportSectionData::Type::None;
300OROSection::Private::Private()
305OROSection::Private::~Private()
307 qDeleteAll(primitives);
311OROSection::OROSection(
ORODocument* doc) : d(new Private())
316OROSection::~OROSection()
327 return d->primitives.
value(index);
330const OROPrimitive * OROSection::primitive(
int index)
const
332 return d->primitives.
value(index);
337 if (primitive ==
nullptr)
340 d->primitives.
append(primitive);
343void OROSection::setHeight(
int h)
348int OROSection::height()
const
353void OROSection::setBackgroundColor(
const QColor& color)
355 d->backgroundColor = color;
358QColor OROSection::backgroundColor()
const
360 return d->backgroundColor;
366 std::sort(d->primitives.
begin(), d->primitives.
end(), xLessThan);
381int OROSection::primitiveCount()
const
383 return d->primitives.
count();
386void OROSection::setType(KReportSectionData::Type type)
391KReportSectionData::Type OROSection::type()
const
413OROPrimitive::OROPrimitive()
418OROPrimitive::~OROPrimitive()
421 d->page->takePrimitive(
this);
427void OROPrimitive::setPosition(
const QPointF& pos)
432void OROPrimitive::setSize(
const QSizeF & s)
442const OROPage * OROPrimitive::page()
const
447QPointF OROPrimitive::position()
const
452QSizeF OROPrimitive::size()
const
457void OROPrimitive::setPage(
OROPage* page)
472 KReportTextStyleData textStyle;
478 bool requiresPostProcessing;
482OROTextBox::Private::Private()
487 requiresPostProcessing =
false;
490 lineStyle.setWeight(0);
494OROTextBox::Private::~Private()
498OROTextBox::OROTextBox() : d(new Private())
503OROTextBox::~OROTextBox()
508void OROTextBox::setText(
const QString & s)
513void OROTextBox::setTextStyle(
const KReportTextStyleData & ts)
523void OROTextBox::setFont(
const QFont & f)
525 d->textStyle.font = f;
528void OROTextBox::setFlags(
int f)
533bool OROTextBox::canGrow()
const
538int OROTextBox::flags()
const
548bool OROTextBox::requiresPostProcessing()
const
550 return d->requiresPostProcessing;
553void OROTextBox::setCanGrow(
bool grow)
558void OROTextBox::setRequiresPostProcessing(
bool pp)
560 d->requiresPostProcessing = pp;
563void OROTextBox::setWordWrap(
bool ww)
568QString OROTextBox::text()
const
573KReportTextStyleData OROTextBox::textStyle()
const
578bool OROTextBox::wordWrap()
const
586 theClone->setSize(size());
587 theClone->setPosition(position());
588 theClone->setText(text());
589 theClone->setTextStyle(textStyle());
590 theClone->setLineStyle(lineStyle());
591 theClone->setFlags(flags());
592 theClone->setCanGrow(canGrow());
593 theClone->setWordWrap(wordWrap());
594 theClone->setRequiresPostProcessing(requiresPostProcessing());
603class Q_DECL_HIDDEN
OROLine::Private
610OROLine::OROLine() : d(new Private())
620void OROLine::setStartPoint(
const QPointF & p)
625void OROLine::setEndPoint(
const QPointF & p)
632 d->lineStyle = style;
635QPointF OROLine::endPoint()
const
648 theClone->setStartPoint(position());
649 theClone->setEndPoint(endPoint());
650 theClone->setLineStyle(lineStyle());
658class Q_DECL_HIDDEN
OROImage::Private
667OROImage::OROImage() : d(new Private())
679void OROImage::setImage(
const QImage & img)
684void OROImage::setScaled(
bool b)
691 d->transformFlags = transformation;
696 d->aspectFlags = aspectRatioMode;
701 return d->aspectFlags;
704QImage OROImage::image()
const
709bool OROImage::isScaled()
const
716 return d->transformFlags;
722 theClone->setSize(size());
723 theClone->setPosition(position());
724 theClone->setImage(image());
725 theClone->setScaled(isScaled());
726 theClone->setTransformationMode(transformationMode());
727 theClone->setAspectRatioMode(aspectRatioMode());
741OROPicture::OROPicture() : d(new Private())
746OROPicture::~OROPicture()
754 theClone->setSize(size());
755 theClone->setPosition(position());
765void OROPicture::setPicture(
const QPicture& p)
774class Q_DECL_HIDDEN
ORORect::Private
781ORORect::ORORect() : d(new Private())
790void ORORect::setRect(
const QRectF & r)
796void ORORect::setPen(
const QPen & p)
801void ORORect::setBrush(
const QBrush & b)
806QBrush ORORect::brush()
const
811QPen ORORect::pen()
const
816QRectF ORORect::rect()
const
818 return QRectF(position(), size());
824 theClone->setSize(size());
825 theClone->setPosition(position());
826 theClone->setPen(pen());
827 theClone->setBrush(brush());
841OROEllipse::OROEllipse() : d(new Private())
845OROEllipse::~OROEllipse()
850void OROEllipse::setRect(
const QRectF & r)
856void OROEllipse::setPen(
const QPen & p)
861void OROEllipse::setBrush(
const QBrush & b)
866QBrush OROEllipse::brush()
const
871QPen OROEllipse::pen()
const
876QRectF OROEllipse::rect()
const
878 return QRectF(position(), size());
884 theClone->setSize(size());
885 theClone->setPosition(position());
886 theClone->setPen(pen());
887 theClone->setBrush(brush());
898 OROCheckBox::Type checkType;
904OROCheckBox::OROCheckBox() : d(new Private())
909OROCheckBox::~OROCheckBox()
914OROCheckBox::Type OROCheckBox::checkType()
const
919QColor OROCheckBox::foregroundColor()
const
921 return d->foregroundColor;
929void OROCheckBox::setForegroundColor(
const QColor& fg)
931 d->foregroundColor = fg;
939void OROCheckBox::setValue(
bool v)
944bool OROCheckBox::value()
const
949void OROCheckBox::setCheckType(Type type)
951 if (type == Type::Cross || type == Type::Tick || type == Type::Dot) {
954 d->checkType = Type::Cross;
961 theClone->setSize(size());
962 theClone->setPosition(position());
963 theClone->setLineStyle(lineStyle());
964 theClone->setForegroundColor(foregroundColor());
965 theClone->setValue(value());
966 theClone->setCheckType(checkType());
The KReportLineStyle class represents line style.
Represents a single document containing one or more OROPage elements.
void takePage(OROPage *page)
Takes the page from the document but does not delete it.
int pageCount() const
Return the total number of pages in the document.
void removePage(OROPage *page)
Removes the given page from the document.
void addPage(OROPage *page)
Adds the supplied page to this document.
void addSection(OROSection *section)
Adds the supplied sectin to the document.
int pageIndex(const OROPage *page) const
Returns the index of the supplied page in the document.
OROPage * page(int index)
Return a pointer to a given page.
OROSection * section(int index)
Return a pointer to a given section.
void removeSection(OROSection *section)
Removes the supplied section from the document.
void takeSection(OROSection *section)
Takes the section from the document but does not delete it.
int sectionCount() const
Return the total number of sections in the document.
Defines an image. An image is a bitmap.
Defines a line with a width/weight.
Represents a single page in a document and may contain zero or more OROPrimitive objects all of which...
Defines a picture. A picture is different to an image, in that it is drawn using commands.
Represents the basic primitive with a position and type. Other primitives are subclasses with a defin...
Represents a single a single row in a document and may contain zero or more OROPrimitives.
A text box primitive it defines a box region and text that will be rendered inside that region,...
Type type(const QSqlDatabase &db)
void append(QList< T > &&value)
qsizetype count() const const
qsizetype indexOf(const AT &value, qsizetype from) const const
iterator insert(const_iterator before, parameter_type value)
bool removeOne(const AT &t)
T value(qsizetype i) const const
QSizeF size() const const
QPointF topLeft() const const