/usr/include/openrpt/OpenRPT/wrtembed/documentscene.h is in libopenrpt-dev 3.3.7-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 | /*
* OpenRPT report writer and rendering engine
* Copyright (C) 2001-2014 by OpenMFG, LLC
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Please contact info@openmfg.com with any questions on this license.
*/
#ifndef __DOCUMENTSCENE_H__
#define __DOCUMENTSCENE_H__
#include <QtGui>
#include <QGraphicsScene>
#include <QDomDocument>
#include "querylist.h"
#include "parsexmlutils.h"
#include "graphicssection.h"
class ReportPageOptions;
class ReportGridOptions;
class ReportHandler;
class DocumentScene : public QGraphicsScene
{
Q_OBJECT
public:
DocumentScene(bool newDoc, ReportHandler * handler, QObject * parent = 0);
~DocumentScene();
ReportPageOptions * pageOptions() { return _pageOptions; }
ReportGridOptions * gridOptions() { return _gridOptions; }
void setGridOptions(ReportGridOptions * rgo);
ReportHandler * handler() { return _handler; }
QuerySourceList * qsList;
QMap<QString, QColor> _colorMap;
void sectionEditor(QWidget * parent = 0);
void colorList(QWidget * parent = 0);
void docInfoEditor(QWidget * parent = 0);
void docPageSetup(QWidget * parent = 0);
void querySourceList(QWidget * parent = 0);
// Label Definitions
void editLabelDefinitions(QWidget * parent = 0);
ORGraphicsSectionItem * getReportHead();
void removeReportHead();
void insertReportHead();
ORGraphicsSectionItem * getReportFoot();
void removeReportFoot();
void insertReportFoot();
ORGraphicsSectionItem * getPageHeadFirst();
void removePageHeadFirst();
void insertPageHeadFirst();
ORGraphicsSectionItem * getPageHeadOdd();
void removePageHeadOdd();
void insertPageHeadOdd();
ORGraphicsSectionItem * getPageHeadEven();
void removePageHeadEven();
void insertPageHeadEven();
ORGraphicsSectionItem * getPageHeadLast();
void removePageHeadLast();
void insertPageHeadLast();
ORGraphicsSectionItem * getPageHeadAny();
void removePageHeadAny();
void insertPageHeadAny();
ORGraphicsSectionItem * getPageFootFirst();
void removePageFootFirst();
void insertPageFootFirst();
ORGraphicsSectionItem * getPageFootOdd();
void removePageFootOdd();
void insertPageFootOdd();
ORGraphicsSectionItem * getPageFootEven();
void removePageFootEven();
void insertPageFootEven();
ORGraphicsSectionItem * getPageFootLast();
void removePageFootLast();
void insertPageFootLast();
ORGraphicsSectionItem * getPageFootAny();
void removePageFootAny();
void insertPageFootAny();
int detailSectionCount();
ORGraphicsSectionDetail * getSection(int i);
void insertSection(int idx, ORGraphicsSectionDetail * rsd);
int findSection(const QString & name);
void removeSection(int idx, bool del = false);
void setReportTitle(const QString &);
void setReportDescription(const QString &);
void setReportName(const QString &);
QString reportTitle() const { return _title; }
QString reportDescription() const { return _descr; }
QString reportName() const { return _name; }
bool save(QWidget * parent = 0);
bool save(QIODevice * iod, QWidget * parent = 0);
bool saveAs(QWidget * parent = 0);
bool saveToDb(QWidget * parent = 0);
QDomDocument document();
QString filename;
bool lastSaveToDb;
QString dbRecordName;
int dbRecordGrade;
void addColorDef(QString, QColor);
// Watermark Properties
int watermarkOpacity() const { return _wmOpacity; }
QFont watermarkFont() const { return _wmFont; }
bool watermarkUseDefaultFont() const { return _wmUseDefaultFont; }
bool watermarkUseStaticText() const { return _wmUseStaticText; }
QString watermarkText() const { return _wmText; }
QString watermarkColumn() const { return _wmColumn; }
QString watermarkQuery() const { return _wmQuery; }
void setWatermarkOpacity(int);
void setWatermarkFont(QFont);
void setWatermarkUseDefaultFont(bool);
void setWatermarkUseStaticText(bool);
void setWatermarkText(QString);
void setWatermarkColumn(QString);
void setWatermarkQuery(QString);
// Background Properties
bool bgEnabled() const { return _bgEnabled; }
bool bgStatic() const { return _bgStatic; }
QString bgImage() const { return _bgImage; }
QString bgQuery() const { return _bgQuery; }
QString bgColumn() const { return _bgColumn; }
QString bgResizeMode() const { return _bgResizeMode; }
int bgAlign() const { return _bgAlign; }
int bgBoundsX() const { return _bgBoundsX; }
int bgBoundsY() const { return _bgBoundsY; }
int bgBoundsWidth() const { return _bgBoundsWidth; }
int bgBoundsHeight() const { return _bgBoundsHeight; }
int bgOpacity() const { return _bgOpacity; }
void setBgEnabled(bool);
void setBgStatic(bool);
void setBgImage(QString);
void setBgQuery(QString);
void setBgColumn(QString);
void setBgResizeMode(QString);
void setBgAlign(int);
void setBgBoundsX(int);
void setBgBoundsY(int);
void setBgBoundsWidth(int);
void setBgBoundsHeight(int);
void setBgOpacity(int);
qreal scaledTo() { return _scaledTo; }
void setScaledTo(qreal v) { _scaledTo = v; }
void addDefinedParameter(const QString &, const ORParameter &);
void editDefinedParameters(QWidget * parent = 0);
bool isModified() const { return _modified; }
void repositionSections();
ORGraphicsSectionItem * getSection(QPointF scenePos) const;
ORGraphicsSectionItem * getSection(QString title) const;
void highlightSectionTitles();
QList<ORGraphicsSectionItem *> sectionsList() const;
bool undo();
bool redo();
void loadDocument(const QDomElement &root, QWidget *parent, bool loadFromfile=true);
void updateSectionsOfMovedItems(Qt::KeyboardModifiers keyModifiers);
void setSectionsColors(QGraphicsItem *item, QPointF lastPos, QPointF newPos, Qt::KeyboardModifiers keyModifiers);
void highlightSections(ORGraphicsSectionItem::Highlight color);
void checkValidity(QWidget * parent = 0);
public slots:
void setModified(bool = true);
void deleteSelected();
void refreshFontToolBox();
void onSelChanged();
signals:
void modified();
protected:
void contextMenuEvent(QGraphicsSceneContextMenuEvent * contextMenuEvent);
void drawForeground(QPainter * painter, const QRectF & rect);
ReportPageOptions * _pageOptions;
ReportGridOptions * _gridOptions;
QString _title;
QString _name;
QString _descr;
ORGraphicsSectionItem * rptHead;
ORGraphicsSectionItem * pageHeadFirst;
ORGraphicsSectionItem * pageHeadOdd;
ORGraphicsSectionItem * pageHeadEven;
ORGraphicsSectionItem * pageHeadLast;
ORGraphicsSectionItem * pageHeadAny;
ORGraphicsSectionItem * pageFootFirst;
ORGraphicsSectionItem * pageFootOdd;
ORGraphicsSectionItem * pageFootEven;
ORGraphicsSectionItem * pageFootLast;
ORGraphicsSectionItem * pageFootAny;
ORGraphicsSectionItem * rptFoot;
QList<ORGraphicsSectionDetail*> detailList;
QMap<QString,ORParameter> _definedParams;
// Watermark variables
bool _wmUseStaticText;
QString _wmText;
QString _wmColumn;
QString _wmQuery;
bool _wmUseDefaultFont;
QFont _wmFont;
int _wmOpacity;
// background variables
bool _bgEnabled;
bool _bgStatic;
QString _bgImage;
QString _bgQuery;
QString _bgColumn;
QString _bgResizeMode;
int _bgAlign;
int _bgBoundsX;
int _bgBoundsY;
int _bgBoundsWidth;
int _bgBoundsHeight;
int _bgOpacity;
void mousePressEvent(QGraphicsSceneMouseEvent *mouseEvent);
protected slots:
virtual void pageOptionsChanged();
private:
void initData();
void clear();
void recordSnapshot();
QList<QDomDocument> _snapshots;
int _undoIndex;
QGraphicsRectItem * _page;
QGraphicsRectItem * _pageShadow;
QGraphicsRectItem * _pageMargin;
qreal _scaledTo;
ReportHandler * _handler;
QWidget * _parentWindow;
bool _modified;
int _maxSnaphots;
bool _loadingInProgress;
};
#endif
|