/usr/include/openrpt/OpenRPT/renderer/crosstab.h is in libopenrpt-dev 3.3.10-4.
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 | /*
* 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 __RENDERER_CROSSTAB_H__
#define __RENDERER_CROSSTAB_H__
// Storage structure
typedef QPair <QString, QString> CrossTabStorageKey;
typedef QMap <CrossTabStorageKey, QString> CrossTabStorage;
//////////////////////////////////////////////////////////////////////////////
// Helper class for row properties
//////////////////////////////////////////////////////////////////////////////
class CrossTabRow
{
public:
CrossTabRow (): m_rowMaxHeight(0), m_rowVAlign(Qt::AlignVCenter) {};
~CrossTabRow (){};
int m_rowMaxHeight;
Qt::AlignmentFlag m_rowVAlign;
};
typedef QString CrossTabRowIndexKey;
typedef QMap <CrossTabRowIndexKey, CrossTabRow> CrossTabRowIndex;
//////////////////////////////////////////////////////////////////////////////
// Helper class for column properties
//////////////////////////////////////////////////////////////////////////////
class CrossTabColumn
{
public:
CrossTabColumn (): m_columnMaxWidth(0), m_columnHAlign(Qt::AlignHCenter) {};
~CrossTabColumn (){};
int m_columnMaxWidth;
Qt::AlignmentFlag m_columnHAlign;
};
typedef QString CrossTabColumnIndexKey;
typedef QMap <CrossTabColumnIndexKey, CrossTabColumn> CrossTabColumnIndex;
//////////////////////////////////////////////////////////////////////////////
// Helper class for table properties
//////////////////////////////////////////////////////////////////////////////
class CrossTabTable
{
public:
CrossTabTable (): m_tableMaxHeight(0), m_tableMaxWidth(0), m_tableVAlign(Qt::AlignLeft) {};
~CrossTabTable (){};
int m_tableMaxHeight;
int m_tableMaxWidth;
Qt::AlignmentFlag m_tableVAlign;
};
//////////////////////////////////////////////////////////////////////////////
// Wrap policy:
// First all columns than all rows. Left to right, top to bottom.
//////////////////////////////////////////////////////////////////////////////
class CrossTab
{
public:
CrossTab(const QFont&);
virtual ~CrossTab();
void Initialize(ORCrossTabData&, const QMap<QString,QColor>&);
void Iterate();
void SetTableWrappingPolicy(const bool& displayAllColumnsFirst);
bool GetTableWrappingPolicy();
void SetAutoRepaint(bool &);
bool AutoRepaint();
void SetValue(const QString&, const QString&, const QString&);
QString GetValue(const QString&, const QString&);
void SetFont(const QFont&);
QFont GetFont() const;
void PopulateFromQuery(XSqlQuery*);
void CalculateCrossTabMeasurements(void);
void CalculateDisplayedRowsAndColumns(int& lastColumn, int& lastRow, QRect& rect);
void CalculateSize(QRect& rect);
void CalculateTableSize(QRect& rect);
void CalculateNextRowSize(int& height);
void clear();
bool AllDataRendered();
void SetRect(const QRect& boundedRectangle);
QRect rect();
void SetWidth(const int& width);
int width();
void SetHeight(const int& height);
int height();
void repaint(void);
virtual void Draw(QPainter &);
protected:
QRect m_boundedRectangle;
ORCrossTabData m_crossTabData;
QMap<QString,QColor> m_colorMap;
QMap<QString,Qt::Alignment> m_hAlignMap;
QMap<QString,Qt::Alignment> m_vAlignMap;
QFont m_commonFont;
CrossTabStorage m_data;
CrossTabRowIndex m_rowIndex;
CrossTabColumnIndex m_columnIndex;
CrossTabTable m_tableProperties;
int m_cellLeftMargin;
int m_cellRightMargin;
int m_cellTopMargin;
int m_cellBottomMargin;
bool m_autoRepaint;
int m_rowIndexStored; // See CrossTab::Iterate
int m_columnIndexStored; // See CrossTab::Iterate
int m_columnIndexStoredIteration; // See CrossTab::Iterate
int m_rowIndexStoredIteration; // See CrossTab::Iterate
int m_columnIndexStoredLast; // See CrossTab::Iterate
int m_rowIndexStoredLast; // See CrossTab::Iterate
bool m_columnHeaderEachPage;
bool m_rowHeaderEachPage;
bool m_tableWrapDisplayAllColumnsFirst;
bool m_populated;
int m_dpiX;
int m_dpiY;
QRect m_rect;
};
#endif //__RENDERER_CROSSTAB_H__
|