diff --git a/3rdparty/dark_style_sheet/qdarkstyle/style.qss b/3rdparty/dark_style_sheet/qdarkstyle/style.qss
index e0a8fe1..95d255e 100644
--- a/3rdparty/dark_style_sheet/qdarkstyle/style.qss
+++ b/3rdparty/dark_style_sheet/qdarkstyle/style.qss
@@ -24,10 +24,10 @@
QToolTip
{
border: 1px solid #2b2b2b;
- background-color: rgb(90, 102, 117);;
+ background-color: #383838;
color: white;
padding: 5px;
- opacity: 200;
+\\ opacity: 200;
}
QWidget
@@ -82,63 +82,6 @@ QGroupBox::indicator
margin-left: 2px;
}
-\\QCheckBox::indicator:unchecked
-\\{
-\\ image: url(:/qss_icons/rc/checkbox_unchecked.png);
-\\}
-
-\\QCheckBox::indicator:unchecked:hover,
-\\QCheckBox::indicator:unchecked:focus,
-\\QCheckBox::indicator:unchecked:pressed,
-\\QGroupBox::indicator:unchecked:hover,
-\\QGroupBox::indicator:unchecked:focus,
-\\QGroupBox::indicator:unchecked:pressed
-\\{
-\\ border: none;
-\\ image: url(:/qss_icons/rc/checkbox_unchecked_focus.png);
-\\}
-
-\\QCheckBox::indicator:checked
-\\{
-\\ image: url(:/qss_icons/rc/checkbox_checked.png);
-\\}
-
-\\QCheckBox::indicator:checked:hover,
-\\QCheckBox::indicator:checked:focus,
-\\QCheckBox::indicator:checked:pressed,
-\\QGroupBox::indicator:checked:hover,
-\\QGroupBox::indicator:checked:focus,
-\\QGroupBox::indicator:checked:pressed
-\\{
-\\ border: none;
-\\ image: url(:/qss_icons/rc/checkbox_checked_focus.png);
-\\}
-
-
-\\QCheckBox::indicator:indeterminate
-\\{
-\\ image: url(:/qss_icons/rc/checkbox_indeterminate.png);
-\\}
-
-\\QCheckBox::indicator:indeterminate:focus,
-\\QCheckBox::indicator:indeterminate:hover,
-\\QCheckBox::indicator:indeterminate:pressed
-\\{
-\\ image: url(:/qss_icons/rc/checkbox_indeterminate_focus.png);
-\\}
-
-\\QCheckBox::indicator:checked:disabled,
-\\QGroupBox::indicator:checked:disabled
-\\{
-\\ image: url(:/qss_icons/rc/checkbox_checked_disabled.png);
-\\}
-
-\\QCheckBox::indicator:unchecked:disabled,
-\\QGroupBox::indicator:unchecked:disabled
-\\{
-\\ image: url(:/qss_icons/rc/checkbox_unchecked_disabled.png);
-\\}
-
QRadioButton
{
spacing: 5px;
@@ -157,52 +100,11 @@ QRadioButton::indicator
height: 16px;
}
-\\QRadioButton::indicator:unchecked
-\\{
-\\ image: url(:/qss_icons/rc/radio_unchecked.png);
-\\}
-
-
-\\QRadioButton::indicator:unchecked:hover,
-\\QRadioButton::indicator:unchecked:focus,
-\\QRadioButton::indicator:unchecked:pressed
-\\{
-\\ border: none;
-\\ outline: none;
-\\ image: url(:/qss_icons/rc/radio_unchecked_focus.png);
-\\}
-
-\\QRadioButton::indicator:checked
-\\{
-\\ border: none;
-\\ outline: none;
-\\ image: url(:/qss_icons/rc/radio_checked.png);
-\\}
-
-\\QRadioButton::indicator:checked:hover,
-\\QRadioButton::indicator:checked:focus,
-\\QRadioButton::indicator:checked:pressed
-\\{
-\\ border: none;
-\\ outline: none;
-\\ image: url(:/qss_icons/rc/radio_checked_focus.png);
-\\}
-
-\\QRadioButton::indicator:checked:disabled
-\\{
-\\ outline: none;
-\\ image: url(:/qss_icons/rc/radio_checked_disabled.png);
-\\}
-
-\\QRadioButton::indicator:unchecked:disabled
-\\{
-\\ image: url(:/qss_icons/rc/radio_unchecked_disabled.png);
-\\}
-
QMenuBar
{
- background-color: #383838;
+ background-color: #2f2f2f;
color: #eff0f1;
+ border-bottom: 1px solid #2b2b2b;
}
QMenuBar::item
@@ -213,13 +115,15 @@ QMenuBar::item
QMenuBar::item:selected
{
background: transparent;
+ background-color: #8fa876;
border: 1px solid #2b2b2b;
}
QMenuBar::item:pressed
{
border: 1px solid #2b2b2b;
- background-color: #2e2e2e;
+\\ background-color: #2e2e2e;
+ background-color: #8fa876;
color: #eff0f1;
margin-bottom:-1px;
padding-bottom:1px;
@@ -328,7 +232,11 @@ QTabWidget:focus, QCheckBox:focus, QRadioButton:focus, QSlider:focus
QLineEdit
{
background-color: #232629;
- padding: 5px;
+ padding-right: 5px;
+ padding-left: 5px;
+ padding-top: 1px;
+ padding-bottom: 1px;
+ margin: 1px;
border-style: solid;
border: 1px solid #2b2b2b;
border-radius: 2px;
@@ -490,7 +398,6 @@ QScrollBar::up-arrow:vertical, QScrollBar::down-arrow:vertical
background: none;
}
-
QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical
{
background: none;
@@ -579,8 +486,9 @@ QStackedWidget
QToolBar {
border: 1px transparent #2b2b2b;
- background: 1px solid #383838;
+\\ background: 1px solid #383838;
font-weight: bold;
+ border-bottom: 1px solid #2b2b2b;
}
QToolBar::handle:horizontal {
@@ -648,7 +556,11 @@ QComboBox
border-style: solid;
border: 1px solid #2b2b2b;
border-radius: 2px;
- padding: 5px;
+ padding-right: 5px;
+ padding-left: 5px;
+ padding-top: 1px;
+ padding-bottom: 1px;
+ margin: 1px;
min-width: 75px;
}
@@ -703,7 +615,11 @@ QComboBox::down-arrow:focus
}
QAbstractSpinBox {
- padding: 5px;
+ padding-right: 5px;
+ padding-left: 5px;
+ padding-top: 1px;
+ padding-bottom: 1px;
+ margin: 1px;
border: 1px solid #2b2b2b;
background-color: #232629;
color: #eff0f1;
@@ -964,7 +880,8 @@ QTreeView::branch:selected{
}
QTreeView::branch:!selected:hover, QTreeView::item:!selected:hover{
- background-color: #287399;
+\\ background-color: #287399;
+ background-color: #819a67;
}
QTreeView::branch:has-siblings:!adjoins-item {
@@ -1036,7 +953,7 @@ QSlider::handle:vertical {
QToolButton {
background-color: #383838;
color : white;
- border: 1px transparent #2b2b2b;
+ border: 1px solid #383838;
border-radius: 2px;
margin: 2px;
padding: 2px;
@@ -1059,42 +976,43 @@ QToolButton:text{
QToolButton:disabled{
background-color: transparent;
-}
-
-QToolButton[popupMode="1"] { /* only for MenuButtonPopup */
- padding-right: 20px; /* make way for the popup button */
- border: 1px #2b2b2b;
- border-radius: 5px;
-}
-
-QToolButton[popupMode="2"] { /* only for InstantPopup */
- padding-right: 10px; /* make way for the popup button */
- border: 1px #2b2b2b;
-}
-
-/* the subcontrol below is used only in the InstantPopup or DelayedPopup mode */
-QToolButton::menu-indicator {
- image: url(:/qss_icons/rc/down_arrow.png);
- top: -7px; left: -2px; /* shift it a bit */
-}
-
-/* the subcontrols below are used only in the MenuButtonPopup mode */
-QToolButton::menu-button {
border: 1px transparent #2b2b2b;
- border-top-right-radius: 6px;
- border-bottom-right-radius: 6px;
- /* 16px width + 4px for border = 20px allocated above */
- width: 16px;
- outline: none;
-}
-
-QToolButton::menu-arrow {
- image: url(:/qss_icons/rc/down_arrow.png);
-}
-
-QToolButton::menu-arrow:open {
- border: 1px solid #2b2b2b;
}
+\\
+\\QToolButton[popupMode="1"] { /* only for MenuButtonPopup */
+\\ padding-right: 20px; /* make way for the popup button */
+\\ border: 1px #2b2b2b;
+\\ border-radius: 5px;
+\\}
+\\
+\\QToolButton[popupMode="2"] { /* only for InstantPopup */
+\\ padding-right: 10px; /* make way for the popup button */
+\\ border: 1px #2b2b2b;
+\\}
+\\
+\\/* the subcontrol below is used only in the InstantPopup or DelayedPopup mode */
+\\QToolButton::menu-indicator {
+\\ image: url(:/qss_icons/rc/down_arrow.png);
+\\ top: -7px; left: -2px; /* shift it a bit */
+\\}
+\\
+\\/* the subcontrols below are used only in the MenuButtonPopup mode */
+\\QToolButton::menu-button {
+\\ border: 1px transparent #2b2b2b;
+\\ border-top-right-radius: 6px;
+\\ border-bottom-right-radius: 6px;
+\\ /* 16px width + 4px for border = 20px allocated above */
+\\ width: 16px;
+\\ outline: none;
+\\}
+\\
+\\QToolButton::menu-arrow {
+\\ image: url(:/qss_icons/rc/down_arrow.png);
+\\}
+\\
+\\QToolButton::menu-arrow:open {
+\\ border: 1px solid #2b2b2b;
+\\}
QPushButton::menu-indicator {
subcontrol-origin: padding;
diff --git a/3rdparty/zint-2.6.1/backend_qt/backend_qt.pro b/3rdparty/zint-2.6.1/backend_qt/backend_qt.pro
index 9bea19e..06203b6 100644
--- a/3rdparty/zint-2.6.1/backend_qt/backend_qt.pro
+++ b/3rdparty/zint-2.6.1/backend_qt/backend_qt.pro
@@ -2,6 +2,7 @@ DEFINES += NO_PNG
TEMPLATE = lib
contains(CONFIG, static_build){
+ message(Static Build)
CONFIG += staticlib
DEFINES += HAVE_STATIC_BUILD
}
diff --git a/common.pri b/common.pri
index dc54195..ce2a2c7 100644
--- a/common.pri
+++ b/common.pri
@@ -12,6 +12,11 @@ CONFIG *= build_translations
CONFIG *= dialogdesigner
}
+!contains(CONFIG, no_embedded_designer){
+ CONFIG *= embedded_designer
+ DEFINES += HAVE_REPORT_DESIGNER
+}
+
ZINT_PATH = $$PWD/3rdparty/zint-2.6.1
contains(CONFIG,zint){
DEFINES *= HAVE_ZINT
diff --git a/demo_r1/demo_reports/change_alignment.lrxml b/demo_r1/demo_reports/change_alignment.lrxml
new file mode 100644
index 0000000..507954e
--- /dev/null
+++ b/demo_r1/demo_reports/change_alignment.lrxml
@@ -0,0 +1,105 @@
+
+
+
+
diff --git a/demo_r1/demo_reports/demoReport1_report_header_group_subdetail_TOC.lrxml b/demo_r1/demo_reports/demoReport1_report_header_group_subdetail_TOC.lrxml
index 732b484..141b5b0 100644
--- a/demo_r1/demo_reports/demoReport1_report_header_group_subdetail_TOC.lrxml
+++ b/demo_r1/demo_reports/demoReport1_report_header_group_subdetail_TOC.lrxml
@@ -5,23 +5,23 @@
-
page2
-
+
-
+
TOC
-
+
-
DataBand1
-
+
-
TextItem1
-
+
@@ -32,12 +32,12 @@
- $D{tableofcontens.Content}
+ $D{tableofcontents.Content}
-
+
@@ -61,7 +61,7 @@
-
TextItem2
-
+
@@ -74,17 +74,17 @@
$S{
getFieldByKeyField(
- "tableofcontens",
+ "tableofcontents",
"Page number",
"Content Key",
- "$D{tableofcontens.Content Key}"
+ "$D{tableofcontents.Content Key}"
)
}
-
+
@@ -120,7 +120,7 @@ getFieldByKeyField(
- tableofcontens
+ tableofcontents
@@ -152,27 +152,29 @@ getFieldByKeyField(
+
+
-
page1
-
+
-
+
ReportPage1
-
+
-
ReportHeader1
-
+
-
TextItem1
-
+
@@ -189,7 +191,7 @@ Report
-
+
@@ -213,7 +215,7 @@ Report
-
ImageItem1
-
+
@@ -228,6 +230,7 @@ Report
+
@@ -236,7 +239,7 @@ Report
-
ShapeItem1
-
+
@@ -258,7 +261,7 @@ Report
-
ShapeItem2
-
+
@@ -280,7 +283,7 @@ Report
-
TextItem9
-
+
@@ -296,7 +299,7 @@ Report
-
+
@@ -320,7 +323,7 @@ Report
-
TextItem10
-
+
@@ -336,7 +339,7 @@ Report
-
+
@@ -377,11 +380,11 @@ Report
-
DataBand1
-
+
-
TextItem3
-
+
@@ -397,7 +400,7 @@ Report
-
+
@@ -421,7 +424,7 @@ Report
-
TextItem4
-
+
@@ -437,7 +440,7 @@ Report
-
+
@@ -461,7 +464,7 @@ Report
-
TextItem12
-
+
@@ -477,7 +480,7 @@ Report
-
+
@@ -501,7 +504,7 @@ Report
-
TextItem16
-
+
@@ -517,7 +520,7 @@ Report
-
+
@@ -541,7 +544,7 @@ Report
-
TextItem17
-
+
@@ -557,7 +560,7 @@ Report
-
+
@@ -607,11 +610,11 @@ Report
-
GroupBandHeader1
-
+
-
TextItem2
-
+
@@ -627,7 +630,7 @@ Report
-
+
@@ -651,7 +654,7 @@ Report
-
ShapeItem3
-
+
@@ -673,7 +676,7 @@ Report
-
TextItem11
-
+
@@ -689,7 +692,7 @@ Report
-
+
@@ -735,11 +738,11 @@ Report
-
SubDetailBand1
-
+
-
TextItem5
-
+
@@ -755,7 +758,7 @@ Report
-
+
@@ -779,7 +782,7 @@ Report
-
TextItem6
-
+
@@ -795,7 +798,7 @@ Report
-
+
@@ -819,7 +822,7 @@ Report
-
TextItem7
-
+
@@ -835,7 +838,7 @@ Report
-
+
@@ -859,7 +862,7 @@ Report
-
TextItem13
-
+
@@ -875,7 +878,7 @@ Report
-
+
@@ -921,11 +924,11 @@ Report
-
SubDetailFooterBand1
-
+
-
TextItem8
-
+
@@ -941,7 +944,7 @@ Report
-
+
@@ -965,7 +968,7 @@ Report
-
TextItem14
-
+
@@ -981,7 +984,7 @@ Report
-
+
@@ -1005,7 +1008,7 @@ Report
-
TextItem15
-
+
@@ -1021,7 +1024,7 @@ Report
-
+
@@ -1045,7 +1048,7 @@ Report
-
ShapeItem4
-
+
@@ -1085,11 +1088,11 @@ Report
-
PageFooter1
-
+
-
TextItem18
-
+
@@ -1105,7 +1108,7 @@ Report
-
+
@@ -1146,11 +1149,11 @@ Report
-
PageHeader18
-
+
-
TextItem19
-
+
@@ -1166,7 +1169,7 @@ Report
-
+
@@ -1225,6 +1228,8 @@ Report
+
+
@@ -1278,15 +1283,15 @@ var firstLevel = " ";
var secondLevel = " ";
function SB1AfterData(){
- addTableOfContensItem(getField("orders.OrderID"),firstLevel+getField("orders.OrderID"));
+ addTableOfContentsItem(getField("orders.OrderID"),firstLevel+getField("orders.OrderID"));
}
function SB2AfterData(){
- addTableOfContensItem(getField("orders.OrderID")+getField("orderItems.ProductName"), secondLevel+"<i>"+getField("orderItems.ProductName")+"</i>");
+ addTableOfContentsItem(getField("orders.OrderID")+getField("orderItems.ProductName"), secondLevel+"<i>"+getField("orderItems.ProductName")+"</i>");
}
function SB3AfterData(){
- addTableOfContensItem(getField("orders.CompanyName"), "<b>"+getField("orders.CompanyName")+"</b>");
+ addTableOfContentsItem(getField("orders.CompanyName"), "<b>"+getField("orders.CompanyName")+"</b>");
}
diff --git a/designer/designer.pro b/designer/designer.pro
index f8a22c3..4062e6f 100644
--- a/designer/designer.pro
+++ b/designer/designer.pro
@@ -13,6 +13,8 @@ SOURCES += main.cpp
INCLUDEPATH += $$PWD/../include
DEPENDPATH += $$PWD/../include
+RESOURCES += $$PWD/../3rdparty/dark_style_sheet/qdarkstyle/style.qrc
+
DEST_DIR = $${DEST_BINS}
REPORTS_DIR = $${DEST_DIR}
diff --git a/designer_plugin/designer_plugin.pro b/designer_plugin/designer_plugin.pro
new file mode 100644
index 0000000..cfcbb39
--- /dev/null
+++ b/designer_plugin/designer_plugin.pro
@@ -0,0 +1,44 @@
+include(../common.pri)
+include(limereport.pri)
+QT += core gui
+
+contains(CONFIG,release) {
+ TARGET = designer_plugin
+} else {
+ TARGET = designer_plugind
+}
+
+TEMPLATE = lib
+CONFIG += plugin
+
+HEADERS += \
+ lrdesignerplugin.h
+SOURCES += \
+ lrdesignerplugin.cpp
+
+INCLUDEPATH += $$PWD/../include
+DEPENDPATH += $$PWD/../include
+
+macx{
+ CONFIG += lib_bundle
+ CONFIG += -dll
+}
+
+DESTDIR = $${DEST_LIBS}
+unix {
+ target.path = $${DESTDIR}
+ INSTALLS = target
+}
+
+
+contains(CONFIG,zint){
+ message(zint)
+ INCLUDEPATH += $$ZINT_PATH/backend $$ZINT_PATH/backend_qt
+ DEPENDPATH += $$ZINT_PATH/backend $$ZINT_PATH/backend_qt
+ LIBS += -L$${DEST_LIBS}
+ contains(CONFIG,release) {
+ LIBS += -lQtZint
+ } else {
+ LIBS += -lQtZintd
+ }
+}
diff --git a/designer_plugin/limereport.pri b/designer_plugin/limereport.pri
new file mode 100644
index 0000000..be32632
--- /dev/null
+++ b/designer_plugin/limereport.pri
@@ -0,0 +1,235 @@
+include(../common.pri)
+
+DEFINES += HAVE_REPORT_DESIGNER
+
+contains(CONFIG,dialogdesigner){
+ include($$REPORT_PATH/dialogdesigner/dialogdesigner.pri)
+}
+
+DEFINES += INSPECT_BASEDESIGN
+
+INCLUDEPATH += \
+ $$REPORT_PATH/ \
+ $$REPORT_PATH/items \
+ $$REPORT_PATH/bands \
+ $$REPORT_PATH/base \
+ $$REPORT_PATH/objectinspector \
+ $$REPORT_PATH/databrowser \
+ $$REPORT_PATH/scripteditor \
+ $$REPORT_PATH/../designer_plugin
+
+SOURCES += \
+ $$REPORT_PATH/databrowser/lrdatabrowser.cpp \
+ $$REPORT_PATH/databrowser/lrsqleditdialog.cpp \
+ $$REPORT_PATH/databrowser/lrconnectiondialog.cpp \
+ $$REPORT_PATH/databrowser/lrvariabledialog.cpp \
+ $$REPORT_PATH/databrowser/lrdatabrowsertree.cpp \
+ $$REPORT_PATH/objectinspector/propertyItems/lrstringpropitem.cpp \
+ $$REPORT_PATH/objectinspector/propertyItems/lrrectproptem.cpp \
+ $$REPORT_PATH/objectinspector/propertyItems/lrintpropitem.cpp \
+ $$REPORT_PATH/objectinspector/propertyItems/lrenumpropitem.cpp \
+ $$REPORT_PATH/objectinspector/propertyItems/lrboolpropitem.cpp \
+ $$REPORT_PATH/objectinspector/propertyItems/lrflagspropitem.cpp \
+ $$REPORT_PATH/objectinspector/propertyItems/lrfontpropitem.cpp \
+ $$REPORT_PATH/objectinspector/propertyItems/lrimagepropitem.cpp \
+ $$REPORT_PATH/objectinspector/propertyItems/lrqrealpropitem.cpp \
+ $$REPORT_PATH/objectinspector/propertyItems/lrcolorpropitem.cpp \
+ $$REPORT_PATH/objectinspector/propertyItems/lrdatasourcepropitem.cpp \
+ $$REPORT_PATH/objectinspector/propertyItems/lrgroupfieldpropitem.cpp \
+ $$REPORT_PATH/objectinspector/propertyItems/lrcontentpropitem.cpp \
+ $$REPORT_PATH/objectinspector/editors/lrtextitempropertyeditor.cpp \
+ $$REPORT_PATH/objectinspector/editors/lrcomboboxeditor.cpp \
+ $$REPORT_PATH/objectinspector/editors/lrcheckboxeditor.cpp \
+ $$REPORT_PATH/objectinspector/editors/lrbuttonlineeditor.cpp \
+ $$REPORT_PATH/objectinspector/editors/lrfonteditor.cpp \
+ $$REPORT_PATH/objectinspector/editors/lrimageeditor.cpp \
+ $$REPORT_PATH/objectinspector/editors/lrcoloreditor.cpp \
+ $$REPORT_PATH/objectinspector/lrbasedesignobjectmodel.cpp \
+ $$REPORT_PATH/objectinspector/lrobjectinspectorwidget.cpp \
+ $$REPORT_PATH/objectinspector/lrobjectitemmodel.cpp \
+ $$REPORT_PATH/objectinspector/lrobjectpropitem.cpp \
+ $$REPORT_PATH/objectinspector/lrpropertydelegate.cpp \
+ $$REPORT_PATH/objectsbrowser/lrobjectbrowser.cpp \
+ $$REPORT_PATH/scriptbrowser/lrscriptbrowser.cpp \
+ $$REPORT_PATH/scripteditor/lrscripteditor.cpp \
+ $$REPORT_PATH/scripteditor/lrcodeeditor.cpp \
+ $$REPORT_PATH/scripteditor/lrscripthighlighter.cpp \
+ $$REPORT_PATH/items/lrsubitemparentpropitem.cpp \
+ $$REPORT_PATH/items/lralignpropitem.cpp \
+ $$REPORT_PATH/items/lrhorizontallayout.cpp \
+ $$REPORT_PATH/items/editors/lritemeditorwidget.cpp \
+ $$REPORT_PATH/items/editors/lrfonteditorwidget.cpp \
+ $$REPORT_PATH/items/editors/lrtextalignmenteditorwidget.cpp \
+ $$REPORT_PATH/items/editors/lritemsaligneditorwidget.cpp \
+ $$REPORT_PATH/items/editors/lritemsborderseditorwidget.cpp \
+ $$REPORT_PATH/items/lrchartitem.cpp \
+ $$REPORT_PATH/items/lrchartitemeditor.cpp \
+ $$REPORT_PATH/items/lrshapeitem.cpp \
+ $$REPORT_PATH/items/lrimageitem.cpp \
+ $$REPORT_PATH/translationeditor/translationeditor.cpp \
+ $$REPORT_PATH/lrbanddesignintf.cpp \
+ $$REPORT_PATH/lrpageitemdesignintf.cpp \
+ $$REPORT_PATH/lrpagedesignintf.cpp \
+ $$REPORT_PATH/lrbandsmanager.cpp \
+ $$REPORT_PATH/lrglobal.cpp \
+ $$REPORT_PATH/lritemdesignintf.cpp \
+ $$REPORT_PATH/lrdatadesignintf.cpp \
+ $$REPORT_PATH/lrreportdesignwidget.cpp \
+ $$REPORT_PATH/lrbasedesignintf.cpp \
+ $$REPORT_PATH/lrdatasourcemanager.cpp \
+ $$REPORT_PATH/lrreportdesignwindow.cpp \
+ $$REPORT_PATH/lrscriptenginemanager.cpp \
+ $$REPORT_PATH/lraboutdialog.cpp \
+ $$REPORT_PATH/lrsettingdialog.cpp \
+ $$REPORT_PATH/lritemscontainerdesignitf.cpp \
+ $$REPORT_PATH/lrcolorindicator.cpp \
+ $$REPORT_PATH/lrreporttranslation.cpp \
+ $$REPORT_PATH/translationeditor/languageselectdialog.cpp \
+ $$REPORT_PATH/serializators/lrxmlqrectserializator.cpp \
+ $$REPORT_PATH/serializators/lrxmlbasetypesserializators.cpp \
+ $$REPORT_PATH/serializators/lrxmlreader.cpp \
+ $$REPORT_PATH/serializators/lrxmlwriter.cpp \
+ $$REPORT_PATH/bands/lrpageheader.cpp \
+ $$REPORT_PATH/bands/lrpagefooter.cpp \
+ $$REPORT_PATH/bands/lrreportheader.cpp \
+ $$REPORT_PATH/bands/lrreportfooter.cpp \
+ $$REPORT_PATH/bands/lrdataband.cpp \
+ $$REPORT_PATH/bands/lrgroupbands.cpp \
+ $$REPORT_PATH/bands/lrsubdetailband.cpp \
+ $$REPORT_PATH/bands/lrtearoffband.cpp \
+ $$REPORT_PATH/lrgraphicsviewzoom.cpp \
+ $$REPORT_PATH/lrvariablesholder.cpp \
+ $$REPORT_PATH/lrgroupfunctions.cpp \
+ $$REPORT_PATH/lrsimplecrypt.cpp \
+ $$REPORT_PATH/items/lrsimpletagparser.cpp \
+ $$REPORT_PATH/items/lrtextitem.cpp \
+ $$REPORT_PATH/items/lrtextitemeditor.cpp \
+ $$REPORT_PATH/lrreportengine.cpp \
+ $$REPORT_PATH/lrpreviewreportwindow.cpp \
+ $$REPORT_PATH/lrpreviewreportwidget.cpp \
+ $$REPORT_PATH/lrreportrender.cpp
+
+HEADERS += \
+ $$REPORT_PATH/base/lrsingleton.h \
+ $$REPORT_PATH/base/lrsimpleabstractfactory.h \
+ $$REPORT_PATH/base/lrattribsabstractfactory.h \
+ $$REPORT_PATH/databrowser/lrdatabrowser.h \
+ $$REPORT_PATH/databrowser/lrsqleditdialog.h \
+ $$REPORT_PATH/databrowser/lrconnectiondialog.h \
+ $$REPORT_PATH/databrowser/lrvariabledialog.h \
+ $$REPORT_PATH/databrowser/lrdatabrowsertree.h \
+ $$REPORT_PATH/objectinspector/propertyItems/lrstringpropitem.h \
+ $$REPORT_PATH/objectinspector/propertyItems/lrrectproptem.h \
+ $$REPORT_PATH/objectinspector/propertyItems/lrdatasourcepropitem.h \
+ $$REPORT_PATH/objectinspector/propertyItems/lrfontpropitem.h \
+ $$REPORT_PATH/objectinspector/propertyItems/lrimagepropitem.h \
+ $$REPORT_PATH/objectinspector/propertyItems/lrintpropitem.h \
+ $$REPORT_PATH/objectinspector/propertyItems/lrenumpropitem.h \
+ $$REPORT_PATH/objectinspector/propertyItems/lrboolpropitem.h \
+ $$REPORT_PATH/objectinspector/propertyItems/lrflagspropitem.h \
+ $$REPORT_PATH/objectinspector/propertyItems/lrgroupfieldpropitem.h \
+ $$REPORT_PATH/objectinspector/propertyItems/lrcontentpropitem.h \
+ $$REPORT_PATH/objectinspector/propertyItems/lrqrealpropitem.h \
+ $$REPORT_PATH/objectinspector/propertyItems/lrcolorpropitem.h \
+ $$REPORT_PATH/objectinspector/editors/lrtextitempropertyeditor.h \
+ $$REPORT_PATH/objectinspector/editors/lrcomboboxeditor.h \
+ $$REPORT_PATH/objectinspector/editors/lrcheckboxeditor.h \
+ $$REPORT_PATH/objectinspector/editors/lrbuttonlineeditor.h \
+ $$REPORT_PATH/objectinspector/editors/lrimageeditor.h \
+ $$REPORT_PATH/objectinspector/editors/lrcoloreditor.h \
+ $$REPORT_PATH/objectinspector/editors/lrfonteditor.h \
+ $$REPORT_PATH/objectinspector/lrbasedesignobjectmodel.h \
+ $$REPORT_PATH/objectinspector/lrobjectinspectorwidget.h \
+ $$REPORT_PATH/objectinspector/lrobjectitemmodel.h \
+ $$REPORT_PATH/objectinspector/lrobjectpropitem.h \
+ $$REPORT_PATH/objectinspector/lrpropertydelegate.h \
+ $$REPORT_PATH/objectsbrowser/lrobjectbrowser.h \
+ $$REPORT_PATH/scriptbrowser/lrscriptbrowser.h \
+ $$REPORT_PATH/scripteditor/lrscripteditor.h \
+ $$REPORT_PATH/scripteditor/lrcodeeditor.h \
+ $$REPORT_PATH/scripteditor/lrscripthighlighter.h \
+ $$REPORT_PATH/items/editors/lritemeditorwidget.h \
+ $$REPORT_PATH/items/editors/lrfonteditorwidget.h \
+ $$REPORT_PATH/items/editors/lrtextalignmenteditorwidget.h \
+ $$REPORT_PATH/items/editors/lritemsaligneditorwidget.h \
+ $$REPORT_PATH/items/editors/lritemsborderseditorwidget.h \
+ $$REPORT_PATH/items/lrtextitem.h \
+ $$REPORT_PATH/items/lrtextitemeditor.h \
+ $$REPORT_PATH/items/lrsubitemparentpropitem.h \
+ $$REPORT_PATH/items/lralignpropitem.h \
+ $$REPORT_PATH/items/lrhorizontallayout.h \
+ $$REPORT_PATH/items/lrchartitem.h \
+ $$REPORT_PATH/items/lrchartitemeditor.h \
+ $$REPORT_PATH/items/lrshapeitem.h \
+ $$REPORT_PATH/items/lrimageitem.h \
+ $$REPORT_PATH/translationeditor/translationeditor.h \
+ $$REPORT_PATH/lrbanddesignintf.h \
+ $$REPORT_PATH/lrpageitemdesignintf.h \
+ $$REPORT_PATH/lrbandsmanager.h \
+ $$REPORT_PATH/lrglobal.h \
+ $$REPORT_PATH/lrdatadesignintf.h \
+ $$REPORT_PATH/lrpagedesignintf.h \
+ $$REPORT_PATH/lrreportdesignwidget.h \
+ $$REPORT_PATH/lrdatasourcemanager.h \
+ $$REPORT_PATH/lrreportdesignwindow.h \
+ $$REPORT_PATH/lrgraphicsviewzoom.h \
+ $$REPORT_PATH/lrbasedesignintf.h \
+ $$REPORT_PATH/lritemdesignintf.h \
+ $$REPORT_PATH/lrscriptenginemanager.h \
+ $$REPORT_PATH/lrgroupfunctions.h \
+ $$REPORT_PATH/lrdatasourcemanagerintf.h \
+ $$REPORT_PATH/lrscriptenginemanagerintf.h \
+ $$REPORT_PATH/lraboutdialog.h \
+ $$REPORT_PATH/lrcallbackdatasourceintf.h \
+ $$REPORT_PATH/lrsettingdialog.h \
+ $$REPORT_PATH/lritemscontainerdesignitf.h \
+ $$REPORT_PATH/lrcolorindicator.h \
+ $$REPORT_PATH/lrreporttranslation.h \
+ $$REPORT_PATH/translationeditor/languageselectdialog.h \
+ $$REPORT_PATH/serializators/lrserializatorintf.h \
+ $$REPORT_PATH/serializators/lrstorageintf.h \
+ $$REPORT_PATH/serializators/lrxmlqrectserializator.h \
+ $$REPORT_PATH/serializators/lrxmlserializatorsfactory.h \
+ $$REPORT_PATH/serializators/lrxmlbasetypesserializators.h \
+ $$REPORT_PATH/serializators/lrxmlreader.h \
+ $$REPORT_PATH/serializators/lrxmlwriter.h \
+ $$REPORT_PATH/bands/lrpageheader.h \
+ $$REPORT_PATH/bands/lrpagefooter.h \
+ $$REPORT_PATH/bands/lrreportheader.h \
+ $$REPORT_PATH/bands/lrreportfooter.h \
+ $$REPORT_PATH/bands/lrdataband.h \
+ $$REPORT_PATH/bands/lrtearoffband.h \
+ $$REPORT_PATH/bands/lrsubdetailband.h \
+ $$REPORT_PATH/bands/lrgroupbands.h \
+ $$REPORT_PATH/lrvariablesholder.h \
+ $$REPORT_PATH/lrsimplecrypt.h \
+ $$REPORT_PATH/items/lrsimpletagparser.h \
+ $$REPORT_PATH/lrreportengine_p.h \
+ $$REPORT_PATH/lrreportengine.h \
+ $$REPORT_PATH/lrpreviewreportwindow.h \
+ $$REPORT_PATH/lrpreviewreportwidget.h \
+ $$REPORT_PATH/lrreportrender.h
+
+FORMS += \
+ $$REPORT_PATH/items/lrtextitemeditor.ui \
+ $$REPORT_PATH/items/lrchartitemeditor.ui \
+ $$REPORT_PATH/databrowser/lrsqleditdialog.ui \
+ $$REPORT_PATH/databrowser/lrconnectiondialog.ui \
+ $$REPORT_PATH/databrowser/lrdatabrowser.ui \
+ $$REPORT_PATH/databrowser/lrvariabledialog.ui \
+ $$REPORT_PATH/objectinspector/editors/ltextitempropertyeditor.ui \
+ $$REPORT_PATH/lraboutdialog.ui \
+ $$REPORT_PATH/lrsettingdialog.ui \
+ $$REPORT_PATH/scriptbrowser/lrscriptbrowser.ui \
+ $$REPORT_PATH/translationeditor/translationeditor.ui \
+ $$REPORT_PATH/translationeditor/languageselectdialog.ui \
+ $$REPORT_PATH/scripteditor/lrscripteditor.ui \
+ $$REPORT_PATH/lrpreviewreportwindow.ui \
+ $$REPORT_PATH/lrpreviewreportwidget.ui
+RESOURCES += \
+ $$REPORT_PATH/objectinspector/lobjectinspector.qrc \
+ $$REPORT_PATH/databrowser/lrdatabrowser.qrc \
+ $$REPORT_PATH/report.qrc \
+ $$REPORT_PATH/items/items.qrc \
+ $$REPORT_PATH/scriptbrowser/lrscriptbrowser.qrc \
+ $$REPORT_PATH/translationeditor/translationeditor.qrc
diff --git a/designer_plugin/lrdesignerplugin.cpp b/designer_plugin/lrdesignerplugin.cpp
new file mode 100644
index 0000000..96b6f4a
--- /dev/null
+++ b/designer_plugin/lrdesignerplugin.cpp
@@ -0,0 +1,17 @@
+#include "lrdesignerplugin.h"
+
+#include
+#include "lrreportdesignwindow.h"
+
+ReportDesignerFactoryPlugin::~ReportDesignerFactoryPlugin() {
+}
+
+LimeReport::ReportDesignWindowInterface* ReportDesignerFactoryPlugin::getDesignerWindow(LimeReport::ReportEnginePrivateInterface* report, QWidget* parent, QSettings* settings)
+{
+ return new LimeReport::ReportDesignWindow(report, parent, settings);
+}
+
+#if QT_VERSION < 0x050000
+Q_EXPORT_PLUGIN2(LimeReportPluginInterface, ReportDesignerFactoryPlugin)
+#endif
+
diff --git a/designer_plugin/lrdesignerplugin.h b/designer_plugin/lrdesignerplugin.h
new file mode 100644
index 0000000..7f17491
--- /dev/null
+++ b/designer_plugin/lrdesignerplugin.h
@@ -0,0 +1,19 @@
+#ifndef LRDESIGNERPLUGIN_H
+#define LRDESIGNERPLUGIN_H
+
+#include
+#include
+
+class ReportDesignerFactoryPlugin : public QObject, public LimeReportPluginInterface {
+ Q_OBJECT
+#if QT_VERSION >= 0x050000
+ Q_PLUGIN_METADATA(IID "ru.limereport.DersignerFactoryInterface")
+#endif
+ Q_INTERFACES( LimeReportPluginInterface )
+
+public:
+ ~ReportDesignerFactoryPlugin();
+ LimeReport::ReportDesignWindowInterface* getDesignerWindow(LimeReport::ReportEnginePrivateInterface* report, QWidget* parent, QSettings* settings);
+};
+
+#endif
diff --git a/designer_plugin/main.cpp b/designer_plugin/main.cpp
new file mode 100644
index 0000000..6ecf8ef
--- /dev/null
+++ b/designer_plugin/main.cpp
@@ -0,0 +1,13 @@
+#include
+#include
+
+int main(int argc, char *argv[])
+{
+ QApplication a(argc, argv);
+ LimeReport::ReportEngine report;
+ if (a.arguments().count()>1){
+ report.loadFromFile(a.arguments().at(1));
+ }
+ report.designReport();
+ return a.exec();
+}
diff --git a/include/lrglobal.h b/include/lrglobal.h
index 74eeb00..13d8851 100644
--- a/include/lrglobal.h
+++ b/include/lrglobal.h
@@ -161,6 +161,7 @@ namespace Const{
Enums(){}
Q_GADGET
};
+
typedef Enums::VariableDataType VariableDataType;
} // namespace LimeReport
diff --git a/include/lrrenderengine.h b/include/lrrenderengine.h
new file mode 100644
index 0000000..ccbecd4
--- /dev/null
+++ b/include/lrrenderengine.h
@@ -0,0 +1,91 @@
+#ifndef LRRENDERENGINE_H
+#define LRRENDERENGINE_H
+
+#include
+#include
+#include
+
+#include "lrglobal.h"
+#include "lrdatasourcemanagerintf.h"
+#include "lrscriptenginemanagerintf.h"
+#include "lrpreviewreportwidget.h"
+
+namespace LimeReport{
+
+class PrintRange{
+public:
+ int fromPage() const { return m_fromPage;}
+ int toPage() const { return m_toPage;}
+ QPrintDialog::PrintRange rangeType() const { return m_rangeType;}
+ PrintRange(QAbstractPrintDialog::PrintRange rangeType=QPrintDialog::AllPages, int fromPage=0, int toPage=0);
+ void setRangeType(QAbstractPrintDialog::PrintRange rangeType){ m_rangeType=rangeType;}
+ void setFromPage(int fromPage){ m_fromPage = fromPage;}
+ void setToPage(int toPage){ m_toPage = toPage;}
+private:
+ QPrintDialog::PrintRange m_rangeType;
+ int m_fromPage;
+ int m_toPage;
+};
+
+class DataSourceManager;
+class PageDesignIntf;
+class PageItemDesignIntf;
+class PreviewReportWidget;
+
+typedef QList< QSharedPointer > ReportPages;
+
+class RenderEnginePrivate;
+
+class LIMEREPORT_EXPORT RenderEngine: public QObject{
+ Q_OBJECT
+ friend class PreviewReportWidget;
+public:
+ static void setSettings(QSettings *value){m_settings=value;}
+public:
+ explicit RenderEngine(QObject *parent = 0);
+ explicit RenderEngine(RenderEnginePrivate* dd, QObject *parent = 0);
+ ~RenderEngine();
+ bool printReport(QPrinter *printer=0);
+ bool printPages(ReportPages pages, QPrinter *printer);
+ void printToFile(const QString& fileName);
+ PageDesignIntf *createPreviewScene(QObject *parent = 0);
+ bool printToPDF(const QString& fileName);
+ void previewReport(PreviewHints hints = PreviewBarsUserSetting);
+ IDataSourceManager* dataManager();
+ IScriptEngineManager* scriptManager();
+ bool loadFromFile(const QString& fileName, bool autoLoadPreviewOnChange = false);
+ bool loadFromByteArray(QByteArray *data);
+ bool loadFromString(const QString& data);
+ QString reportFileName();
+ void setReportFileName(const QString& fileName);
+ QString lastError();
+ PreviewReportWidget *createPreviewWidget(QWidget *parent = 0);
+ void setPreviewWindowTitle(const QString& title);
+ void setPreviewWindowIcon(const QIcon& icon);
+ void setResultEditable(bool value);
+ bool resultIsEditable();
+ bool isBusy();
+ void setPassPharse(QString& passPharse);
+ QList aviableLanguages();
+ bool setReportLanguage(QLocale::Language language);
+ Qt::LayoutDirection previewLayoutDirection();
+ void setPreviewLayoutDirection(const Qt::LayoutDirection& previewLayoutDirection);
+ QSettings* settings(){ return m_settings;}
+signals:
+ void renderStarted();
+ void renderFinished();
+ void renderPageFinished(int renderedPageCount);
+ void onLoad(bool& loaded);
+public slots:
+ void cancelRender();
+protected:
+ QObject* d_ptr;
+private:
+ static QSettings* m_settings;
+ void init();
+private:
+ Q_DECLARE_PRIVATE(RenderEngine)
+};
+
+} // namespace LimeReport
+#endif // LRRENDERENGINE_H
diff --git a/include/lrreportdesignwindowintrerface.h b/include/lrreportdesignwindowintrerface.h
new file mode 100644
index 0000000..858881e
--- /dev/null
+++ b/include/lrreportdesignwindowintrerface.h
@@ -0,0 +1,23 @@
+#ifndef LRREPORTDESIGNWINDOWINTRERFACE_H
+#define LRREPORTDESIGNWINDOWINTRERFACE_H
+
+#include
+#include
+
+namespace LimeReport {
+
+class ReportDesignWindowInterface: public QMainWindow{
+public:
+ ReportDesignWindowInterface(QWidget* parent = 0): QMainWindow(parent){}
+ virtual bool checkNeedToSave() = 0;
+ virtual void showModal() = 0;
+ virtual void showNonModal() = 0;
+ virtual void setSettings(QSettings* value) = 0;
+ virtual QSettings* settings() = 0;
+ virtual void restoreSetting() = 0;
+ virtual void setShowProgressDialog(bool value) = 0;
+};
+
+} // namespace LimeReport
+
+#endif // LRREPORTDESIGNWINDOWINTRERFACE_H
diff --git a/include/lrreportengine.h b/include/lrreportengine.h
index 444d2f4..03b5d91 100644
--- a/include/lrreportengine.h
+++ b/include/lrreportengine.h
@@ -39,6 +39,7 @@
#include "lrdatasourcemanagerintf.h"
#include "lrscriptenginemanagerintf.h"
#include "lrpreviewreportwidget.h"
+#include "lrreportdesignwindowintrerface.h"
class QPrinter;
@@ -85,6 +86,7 @@ public:
bool printToPDF(const QString& fileName);
void previewReport(PreviewHints hints = PreviewBarsUserSetting);
void designReport();
+ ReportDesignWindowInterface* getDesignerWindow();
void setShowProgressDialog(bool value);
IDataSourceManager* dataManager();
IScriptEngineManager* scriptManager();
diff --git a/limerender/limerender.h b/limerender/limerender.h
new file mode 100644
index 0000000..213adec
--- /dev/null
+++ b/limerender/limerender.h
@@ -0,0 +1,120 @@
+/***************************************************************************
+ * This file is part of the Lime Report project *
+ * Copyright (C) 2015 by Alexander Arin *
+ * arin_a@bk.ru *
+ * *
+ ** GNU General Public License Usage **
+ * *
+ * This library is free software: you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation, either version 3 of the License, or *
+ * (at your option) any later version. *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program. If not, see . *
+ * *
+ ** GNU Lesser General Public License **
+ * *
+ * 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 3 of the *
+ * License, or (at your option) any later version. *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this library. *
+ * If not, see . *
+ * *
+ * 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 General Public License for more details. *
+ ****************************************************************************/
+#ifndef LRLIMERENDER_H
+#define LRLIMERENDER_H
+
+#include
+#include
+#include
+//#include
+
+#include "lrreportrender.h"
+#include "limerender_p.h"
+#include "lrglobal.h"
+#include "lrdatasourcemanagerintf.h"
+#include "lrscriptenginemanagerintf.h"
+#include "lrpreviewreportwidget.h"
+
+class QPrinter;
+
+namespace LimeReport {
+
+//class PrintRange{
+//public:
+// int fromPage() const { return m_fromPage;}
+// int toPage() const { return m_toPage;}
+// QPrintDialog::PrintRange rangeType() const { return m_rangeType;}
+// PrintRange(QAbstractPrintDialog::PrintRange rangeType=QPrintDialog::AllPages, int fromPage=0, int toPage=0);
+// void setRangeType(QAbstractPrintDialog::PrintRange rangeType){ m_rangeType=rangeType;}
+// void setFromPage(int fromPage){ m_fromPage = fromPage;}
+// void setToPage(int toPage){ m_toPage = toPage;}
+//private:
+// QPrintDialog::PrintRange m_rangeType;
+// int m_fromPage;
+// int m_toPage;
+//};
+
+class DataSourceManager;
+class LimeRenderPrivate;
+class PageDesignIntf;
+class PageItemDesignIntf;
+class PreviewReportWidget;
+
+typedef QList< QSharedPointer > ReportPages;
+
+class LIMEREPORT_EXPORT LimeRender : public QObject{
+ Q_OBJECT
+ friend class PreviewReportWidget;
+public:
+ static void setSettings(QSettings *value){m_settings=value;}
+public:
+ explicit LimeRender(QObject *parent = 0);
+ ~LimeRender();
+ bool printReport(QPrinter *printer=0);
+ bool printPages(ReportPages pages, QPrinter *printer);
+ void printToFile(const QString& fileName);
+ PageDesignIntf *createPreviewScene(QObject *parent = 0);
+ bool printToPDF(const QString& fileName);
+ void previewReport(PreviewHints hints = PreviewBarsUserSetting);
+ IDataSourceManager* dataManager();
+ IScriptEngineManager* scriptManager();
+ bool loadFromFile(const QString& fileName, bool autoLoadPreviewOnChange = false);
+ bool loadFromByteArray(QByteArray *data);
+ bool loadFromString(const QString& data);
+ QString lastError();
+ PreviewReportWidget *createPreviewWidget(QWidget *parent = 0);
+ void setPreviewWindowTitle(const QString& title);
+ void setPreviewWindowIcon(const QIcon& icon);
+ void setResultEditable(bool value);
+ bool resultIsEditable();
+ bool isBusy();
+ void setPassPharse(QString& passPharse);
+ QList aviableLanguages();
+ bool setReportLanguage(QLocale::Language language);
+ Qt::LayoutDirection previewLayoutDirection();
+ void setPreviewLayoutDirection(const Qt::LayoutDirection& previewLayoutDirection);
+signals:
+ void renderStarted();
+ void renderFinished();
+ void renderPageFinished(int renderedPageCount);
+ void onLoad(bool& loaded);
+public slots:
+ void cancelRender();
+protected:
+ LimeRenderPrivate * const d_ptr;
+ LimeRender(LimeRenderPrivate &dd, QObject * parent=0);
+private:
+ Q_DECLARE_PRIVATE(LimeRender)
+ static QSettings* m_settings;
+};
+
+} // namespace LimeReport
+
+#endif // LRLIMERENDER_H
diff --git a/limerender/limerender.pri b/limerender/limerender.pri
new file mode 100644
index 0000000..1fffc27
--- /dev/null
+++ b/limerender/limerender.pri
@@ -0,0 +1,156 @@
+include(../common.pri)
+
+DEFINES += IS_RENDER_BUILD
+
+INCLUDEPATH += \
+ $$REPORT_PATH/ \
+ $$REPORT_PATH/items \
+ $$REPORT_PATH/bands \
+ $$REPORT_PATH/base \
+ $$REPORT_PATH/scripteditor
+
+SOURCES += \
+ $$REPORT_PATH/bands/lrpageheader.cpp \
+ $$REPORT_PATH/bands/lrpagefooter.cpp \
+ $$REPORT_PATH/bands/lrreportheader.cpp \
+ $$REPORT_PATH/bands/lrreportfooter.cpp \
+ $$REPORT_PATH/bands/lrdataband.cpp \
+ $$REPORT_PATH/bands/lrgroupbands.cpp \
+ $$REPORT_PATH/bands/lrsubdetailband.cpp \
+ $$REPORT_PATH/bands/lrtearoffband.cpp \
+ $$REPORT_PATH/serializators/lrxmlqrectserializator.cpp \
+ $$REPORT_PATH/serializators/lrxmlbasetypesserializators.cpp \
+ $$REPORT_PATH/serializators/lrxmlreader.cpp \
+ $$REPORT_PATH/serializators/lrxmlwriter.cpp \
+ $$REPORT_PATH/scripteditor/lrscripteditor.cpp \
+ $$REPORT_PATH/scripteditor/lrcodeeditor.cpp \
+ $$REPORT_PATH/scripteditor/lrscripthighlighter.cpp \
+ $$REPORT_PATH/items/lrhorizontallayout.cpp \
+ $$REPORT_PATH/items/editors/lritemeditorwidget.cpp \
+ $$REPORT_PATH/items/editors/lrfonteditorwidget.cpp \
+ $$REPORT_PATH/items/editors/lrtextalignmenteditorwidget.cpp \
+ $$REPORT_PATH/items/editors/lritemsaligneditorwidget.cpp \
+ $$REPORT_PATH/items/editors/lritemsborderseditorwidget.cpp \
+ $$REPORT_PATH/items/lrsimpletagparser.cpp \
+ $$REPORT_PATH/items/lrimageitem.cpp \
+ $$REPORT_PATH/items/lrtextitemeditor.cpp \
+ $$REPORT_PATH/items/lrshapeitem.cpp \
+ $$REPORT_PATH/items/lrtextitem.cpp \
+ $$REPORT_PATH/lrbanddesignintf.cpp \
+ $$REPORT_PATH/lrpageitemdesignintf.cpp \
+ $$REPORT_PATH/lrpagedesignintf.cpp \
+ $$REPORT_PATH/lrbandsmanager.cpp \
+ $$REPORT_PATH/lrglobal.cpp \
+ $$REPORT_PATH/lritemdesignintf.cpp \
+ $$REPORT_PATH/lrdatadesignintf.cpp \
+ $$REPORT_PATH/lrbasedesignintf.cpp \
+ $$REPORT_PATH/lrdatasourcemanager.cpp \
+ $$REPORT_PATH/lrreportrender.cpp \
+ $$REPORT_PATH/lrscriptenginemanager.cpp \
+ $$REPORT_PATH/lrpreviewreportwindow.cpp \
+ $$REPORT_PATH/lrpreviewreportwidget.cpp \
+ $$REPORT_PATH/lrgraphicsviewzoom.cpp \
+ $$REPORT_PATH/lrvariablesholder.cpp \
+ $$REPORT_PATH/lrgroupfunctions.cpp \
+ $$REPORT_PATH/lrsimplecrypt.cpp \
+ $$REPORT_PATH/lraboutdialog.cpp \
+ $$REPORT_PATH/lritemscontainerdesignitf.cpp \
+ $$REPORT_PATH/lrcolorindicator.cpp \
+ $$REPORT_PATH/items/lrchartitem.cpp \
+ $$REPORT_PATH/lrreporttranslation.cpp
+# $$PWD/lrreportrender.cpp
+
+
+contains(CONFIG, staticlib){
+ SOURCES += $$REPORT_PATH/lrfactoryinitializer.cpp
+}
+
+contains(CONFIG, zint){
+ SOURCES += $$REPORT_PATH/items/lrbarcodeitem.cpp
+}
+
+HEADERS += \
+ $$REPORT_PATH/base/lrsingleton.h \
+ $$REPORT_PATH/base/lrsimpleabstractfactory.h \
+ $$REPORT_PATH/base/lrattribsabstractfactory.h \
+ $$REPORT_PATH/bands/lrpageheader.h \
+ $$REPORT_PATH/bands/lrpagefooter.h \
+ $$REPORT_PATH/bands/lrreportheader.h \
+ $$REPORT_PATH/bands/lrreportfooter.h \
+ $$REPORT_PATH/bands/lrdataband.h \
+ $$REPORT_PATH/bands/lrtearoffband.h \
+ $$REPORT_PATH/bands/lrsubdetailband.h \
+ $$REPORT_PATH/bands/lrgroupbands.h \
+ $$REPORT_PATH/serializators/lrserializatorintf.h \
+ $$REPORT_PATH/serializators/lrstorageintf.h \
+ $$REPORT_PATH/serializators/lrxmlqrectserializator.h \
+ $$REPORT_PATH/serializators/lrxmlserializatorsfactory.h \
+ $$REPORT_PATH/serializators/lrxmlbasetypesserializators.h \
+ $$REPORT_PATH/serializators/lrxmlreader.h \
+ $$REPORT_PATH/serializators/lrxmlwriter.h \
+ $$REPORT_PATH/scripteditor/lrscripteditor.h \
+ $$REPORT_PATH/scripteditor/lrcodeeditor.h \
+ $$REPORT_PATH/scripteditor/lrscripthighlighter.h \
+ $$REPORT_PATH/items/editors/lritemeditorwidget.h \
+ $$REPORT_PATH/items/editors/lrfonteditorwidget.h \
+ $$REPORT_PATH/items/editors/lrtextalignmenteditorwidget.h \
+ $$REPORT_PATH/items/editors/lritemsaligneditorwidget.h \
+ $$REPORT_PATH/items/editors/lritemsborderseditorwidget.h \
+ $$REPORT_PATH/items/lrtextitem.h \
+ $$REPORT_PATH/items/lrhorizontallayout.h \
+ $$REPORT_PATH/items/lrtextitemeditor.h \
+ $$REPORT_PATH/items/lrshapeitem.h \
+ $$REPORT_PATH/items/lrimageitem.h \
+ $$REPORT_PATH/items/lrsimpletagparser.h \
+ $$REPORT_PATH/lrfactoryinitializer.h \
+ $$REPORT_PATH/lrbanddesignintf.h \
+ $$REPORT_PATH/lrpageitemdesignintf.h \
+ $$REPORT_PATH/lrbandsmanager.h \
+ $$REPORT_PATH/lrglobal.h \
+ $$REPORT_PATH/lrdatadesignintf.h \
+ $$REPORT_PATH/lrcollection.h \
+ $$REPORT_PATH/lrpagedesignintf.h \
+ $$REPORT_PATH/lrdatasourcemanager.h \
+ $$REPORT_PATH/lrreportrender.h \
+ $$REPORT_PATH/lrpreviewreportwindow.h \
+ $$REPORT_PATH/lrpreviewreportwidget.h \
+ $$REPORT_PATH/lrpreviewreportwidget_p.h \
+ $$REPORT_PATH/lrgraphicsviewzoom.h \
+ $$REPORT_PATH/lrbasedesignintf.h \
+ $$REPORT_PATH/lritemdesignintf.h \
+ $$REPORT_PATH/lrdesignelementsfactory.h \
+ $$REPORT_PATH/lrscriptenginemanager.h \
+ $$REPORT_PATH/lrvariablesholder.h \
+ $$REPORT_PATH/lrgroupfunctions.h \
+ $$REPORT_PATH/lrdatasourcemanagerintf.h \
+ $$REPORT_PATH/lrscriptenginemanagerintf.h \
+ $$REPORT_PATH/lrsimplecrypt.h \
+ $$REPORT_PATH/lraboutdialog.h \
+ $$REPORT_PATH/lrcallbackdatasourceintf.h \
+ $$REPORT_PATH/lrpreviewreportwidget_p.h \
+ $$REPORT_PATH/lritemscontainerdesignitf.h \
+ $$REPORT_PATH/lrcolorindicator.h \
+ $$REPORT_PATH/items/lrchartitem.h \
+ $$REPORT_PATH/lrreporttranslation.h
+# $$PWD/limerender.h \
+# $$PWD/limerender_p.h
+
+contains(CONFIG, staticlib){
+ HEADERS += $$REPORT_PATH/lrfactoryinitializer.h
+}
+
+contains(CONFIG,zint){
+ HEADERS += $$REPORT_PATH/items/lrbarcodeitem.h
+}
+
+FORMS += \
+ $$REPORT_PATH/lrpreviewreportwindow.ui \
+ $$REPORT_PATH/lrpreviewreportwidget.ui \
+ $$REPORT_PATH/items/lrtextitemeditor.ui \
+ $$REPORT_PATH/lraboutdialog.ui \
+ $$REPORT_PATH/scripteditor/lrscripteditor.ui
+
+RESOURCES += \
+ $$REPORT_PATH/report.qrc \
+ $$REPORT_PATH/items/items.qrc
+
diff --git a/limerender/limerender.pro b/limerender/limerender.pro
new file mode 100644
index 0000000..12f8bd3
--- /dev/null
+++ b/limerender/limerender.pro
@@ -0,0 +1,124 @@
+contains(CONFIG,release) {
+ TARGET = limerender
+} else {
+ TARGET = limerenderd
+}
+
+TEMPLATE = lib
+
+contains(CONFIG, static_build){
+ CONFIG += staticlib
+}
+
+!contains(CONFIG, staticlib){
+ CONFIG += lib
+ CONFIG += dll
+}
+
+CONFIG += create_prl
+CONFIG += link_prl
+
+macx{
+ CONFIG -= dll
+ CONFIG += lib_bundle
+ CONFIG += plugin
+}
+
+DEFINES += LIMEREPORT_EXPORTS
+
+contains(CONFIG, staticlib){
+ DEFINES += HAVE_STATIC_BUILD
+ message(STATIC_BUILD)
+ DEFINES -= LIMEREPORT_EXPORTS
+}
+
+EXTRA_FILES += \
+ $$PWD/../limereport/lrglobal.cpp \
+ $$PWD/../limereport/lrglobal.h \
+ $$PWD/../limereport/lrdatasourcemanagerintf.h \
+ $$PWD/../limereport/lrreportengine.h \
+ $$PWD/../limereport/lrscriptenginemanagerintf.h \
+ $$PWD/../limereport/lrcallbackdatasourceintf.h \
+ $$PWD/../limereport/lrpreviewreportwidget.h
+
+include(limerender.pri)
+
+unix:{
+ DESTDIR = $${DEST_LIBS}
+ linux{
+ QMAKE_POST_LINK += mkdir -p $$quote($${DEST_INCLUDE_DIR}) $$escape_expand(\\n\\t) # qmake need make mkdir -p on subdirs more than root/
+ for(FILE,EXTRA_FILES){
+ QMAKE_POST_LINK += $$QMAKE_COPY $$quote($$FILE) $$quote($${DEST_INCLUDE_DIR}) $$escape_expand(\\n\\t) # inside of libs make /include/files
+ }
+ }
+ macx{
+ for(FILE,EXTRA_FILES){
+ QMAKE_POST_LINK += $$QMAKE_COPY $$quote($$FILE) $$quote($${DEST_INCLUDE_DIR}) $$escape_expand(\\n\\t)
+ }
+ QMAKE_POST_LINK += mkdir -p $$quote($${DESTDIR}/include) $$escape_expand(\\n\\t)
+ }
+ QMAKE_POST_LINK += $$QMAKE_COPY_DIR $$quote($${DEST_INCLUDE_DIR}) $$quote($${DESTDIR})
+}
+
+win32 {
+ EXTRA_FILES ~= s,/,\\,g
+ BUILD_DIR ~= s,/,\\,g
+ DESTDIR = $${DEST_LIBS}
+ DEST_DIR = $$DESTDIR/include
+ DEST_DIR ~= s,/,\\,g
+ DEST_INCLUDE_DIR ~= s,/,\\,g
+
+ for(FILE,EXTRA_FILES){
+ QMAKE_POST_LINK += $$QMAKE_COPY \"$$FILE\" \"$${DEST_INCLUDE_DIR}\" $$escape_expand(\\n\\t)
+ }
+ QMAKE_POST_LINK += $$QMAKE_COPY_DIR \"$${DEST_INCLUDE_DIR}\" \"$${DEST_DIR}\"
+}
+
+contains(CONFIG,zint){
+ message(zint)
+ INCLUDEPATH += $$ZINT_PATH/backend $$ZINT_PATH/backend_qt
+ DEPENDPATH += $$ZINT_PATH/backend $$ZINT_PATH/backend_qt
+ LIBS += -L$${DEST_LIBS}
+ contains(CONFIG,release) {
+ LIBS += -lQtZint
+ } else {
+ LIBS += -lQtZintd
+ }
+}
+
+####Automatically build required translation files (*.qm)
+
+contains(CONFIG,build_translations){
+ LANGUAGES = ru es_ES ar
+
+ defineReplace(prependAll) {
+ for(a,$$1):result += $$2$${a}$$3
+ return($$result)
+ }
+
+ TRANSLATIONS = $$prependAll(LANGUAGES, \"$$TRANSLATIONS_PATH/limereport_,.ts\")
+
+ qtPrepareTool(LUPDATE, lupdate)
+
+greaterThan(QT_MAJOR_VERSION, 4) {
+ ts.commands = $$LUPDATE $$shell_quote($$PWD) -ts $$TRANSLATIONS
+}
+lessThan(QT_MAJOR_VERSION, 5){
+ ts.commands = $$LUPDATE $$quote($$PWD) -ts $$TRANSLATIONS
+}
+ TRANSLATIONS_FILES =
+ qtPrepareTool(LRELEASE, lrelease)
+ for(tsfile, TRANSLATIONS) {
+ qmfile = $$tsfile
+ qmfile ~= s,".ts\"$",".qm\"",
+ qm.commands += $$LRELEASE -removeidentical $$tsfile -qm $$qmfile $$escape_expand(\\n\\t)
+ tmp_command = $$LRELEASE -removeidentical $$tsfile -qm $$qmfile $$escape_expand(\\n\\t)
+ TRANSLATIONS_FILES += $$qmfile
+ }
+ qm.depends = ts
+ OTHER_FILES += $$TRANSLATIONS
+ QMAKE_EXTRA_TARGETS += qm ts
+ POST_TARGETDEPS += qm
+}
+
+#### EN AUTOMATIC TRANSLATIONS
diff --git a/limerender/limerender_p.h b/limerender/limerender_p.h
new file mode 100644
index 0000000..af650b4
--- /dev/null
+++ b/limerender/limerender_p.h
@@ -0,0 +1,192 @@
+/***************************************************************************
+ * This file is part of the Lime Report project *
+ * Copyright (C) 2015 by Alexander Arin *
+ * arin_a@bk.ru *
+ * *
+ ** GNU General Public License Usage **
+ * *
+ * This library is free software: you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation, either version 3 of the License, or *
+ * (at your option) any later version. *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program. If not, see . *
+ * *
+ ** GNU Lesser General Public License **
+ * *
+ * 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 3 of the *
+ * License, or (at your option) any later version. *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this library. *
+ * If not, see . *
+ * *
+ * 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 General Public License for more details. *
+ ****************************************************************************/
+#ifndef LRLIMERENDER_P_H
+#define LRLIMERENDER_P_H
+
+#include
+#include
+#include
+
+#include "limerender.h"
+#include "lrcollection.h"
+#include "lrglobal.h"
+#include "lrdatasourcemanager.h"
+#include "lrbanddesignintf.h"
+#include "serializators/lrstorageintf.h"
+#include "lrscriptenginemanager.h"
+#include "lrreporttranslation.h"
+
+class QFileSystemWatcher;
+
+namespace LimeReport{
+
+class PageDesignIntf;
+class PrintRange;
+class ReportDesignWindow;
+
+//TODO: Add on render callback
+
+class LimeRenderPrivate : public QObject, public ICollectionContainer, public ITranslationContainer
+{
+ Q_OBJECT
+ Q_DECLARE_PUBLIC(ReportEngine)
+ Q_PROPERTY(ACollectionProperty pages READ fakeCollectionReader())
+ Q_PROPERTY(QObject* datasourcesManager READ dataManager)
+ Q_PROPERTY(QObject* scriptContext READ scriptContext)
+ Q_PROPERTY(bool suppressFieldAndVarError READ suppressFieldAndVarError WRITE setSuppressFieldAndVarError)
+ Q_PROPERTY(ATranslationProperty translation READ fakeTranslationReader)
+ friend class PreviewReportWidget;
+public:
+ static void printReport(ItemsReaderIntf::Ptr reader, QPrinter &printer);
+ static void printReport(ReportPages pages, QPrinter &printer);
+ Q_INVOKABLE QStringList aviableReportTranslations();
+ Q_INVOKABLE void setReportTranslation(const QString& languageName);
+public:
+ explicit LimeRenderPrivate(QObject *parent = 0);
+ virtual ~LimeRenderPrivate();
+
+ PageDesignIntf* appendPage(const QString& pageName="");
+ bool deletePage(PageDesignIntf *page);
+ PageDesignIntf* createPreviewPage();
+ PageDesignIntf* pageAt(int index){return (index<=(m_pages.count()-1)) ? m_pages.at(index):0;}
+ int pageCount() {return m_pages.count();}
+ DataSourceManager* dataManager(){return m_datasources;}
+ ScriptEngineContext* scriptContext(){return m_scriptEngineContext;}
+ ScriptEngineManager* scriptManager();
+ IDataSourceManager* dataManagerIntf(){return m_datasources;}
+
+ IScriptEngineManager* scriptManagerIntf(){
+ ScriptEngineManager::instance().setDataManager(dataManager());
+ return &ScriptEngineManager::instance();
+ }
+
+ void clearReport();
+ bool printReport(QPrinter *printer=0);
+ bool printPages(ReportPages pages, QPrinter *printer);
+ void printToFile(const QString& fileName);
+ bool printToPDF(const QString& fileName);
+ void previewReport(PreviewHints hints = PreviewBarsUserSetting);
+ void setSettings(QSettings* value);
+ QSettings* settings();
+ bool loadFromFile(const QString& fileName, bool autoLoadPreviewOnChange);
+ bool loadFromByteArray(QByteArray *data, const QString& name = "");
+ bool loadFromString(const QString& report, const QString& name = "");
+ QString lastError();
+ ReportEngine * q_ptr;
+ bool emitLoadReport();
+ bool hasActivePreview(){return m_activePreview;}
+ PageDesignIntf *createPreviewScene(QObject *parent);
+ PreviewReportWidget *createPreviewWidget(QWidget *parent);
+ QIcon previewWindowIcon() const;
+ void setPreviewWindowIcon(const QIcon &previewWindowIcon);
+ QString previewWindowTitle() const;
+ void setPreviewWindowTitle(const QString &previewWindowTitle);
+
+ bool suppressFieldAndVarError() const;
+ void setSuppressFieldAndVarError(bool suppressFieldAndVarError);
+ bool isBusy();
+ bool resultIsEditable() const;
+ void setResultEditable(bool value);
+
+ void setPassPhrase(const QString &passPhrase);
+ bool addTranslationLanguage(QLocale::Language language);
+ bool removeTranslationLanguage(QLocale::Language language);
+ bool setReportLanguage(QLocale::Language language);
+ QList aviableLanguages();
+ ReportTranslation* reportTranslation(QLocale::Language language);
+ void reorderPages(const QList &reorderedPages);
+ void clearSelection();
+ Qt::LayoutDirection previewLayoutDirection();
+ void setPreviewLayoutDirection(const Qt::LayoutDirection& previewLayoutDirection);
+signals:
+ void pagesLoadFinished();
+ void datasourceCollectionLoadFinished(const QString& collectionName);
+ void cleared();
+ void renderStarted();
+ void renderFinished();
+ void renderPageFinished(int renderedPageCount);
+ void onLoad(bool& loaded);
+public slots:
+ bool slotLoadFromFile(const QString& fileName);
+ void cancelRender();
+protected:
+ PageDesignIntf* createPage(const QString& pageName="");
+protected slots:
+ void slotDataSourceCollectionLoaded(const QString& collectionName);
+private slots:
+ void slotPreviewWindowDestroyed(QObject *window);
+private:
+ //ICollectionContainer
+ virtual QObject* createElement(const QString&,const QString&);
+ virtual int elementsCount(const QString&);
+ virtual QObject* elementAt(const QString&, int index);
+ virtual void collectionLoadFinished(const QString&);
+ void saveError(QString message);
+ void showError(QString message);
+ //ICollectionContainer
+ //ITranslationContainer
+ Translations* translations(){ return &m_translations;}
+ void updateTranslations();
+ //ITranslationContainer
+ ReportPages renderToPages();
+ QString renderToString();
+ PageDesignIntf* getPageByName(const QString& pageName);
+ ATranslationProperty fakeTranslationReader(){ return ATranslationProperty();}
+private:
+ QList m_pages;
+ DataSourceManager* m_datasources;
+ ScriptEngineContext* m_scriptEngineContext;
+ ReportRender::Ptr m_reportRender;
+ QString m_fileName;
+ QString m_lastError;
+ QSettings* m_settings;
+ bool m_ownedSettings;
+ QScopedPointer m_printer;
+ bool m_printerSelected;
+ bool m_showProgressDialog;
+ QString m_reportsDir;
+ QString m_reportName;
+ QMainWindow* m_activePreview;
+ QIcon m_previewWindowIcon;
+ QString m_previewWindowTitle;
+ QPointer m_designerWindow;
+ ReportSettings m_reportSettings;
+ bool m_LimeRendering;
+ bool m_resultIsEditable;
+ QString m_passPhrase;
+ QFileSystemWatcher *m_fileWatcher;
+ Translations m_translations;
+ QLocale::Language m_reportLanguage;
+ void activateLanguage(QLocale::Language language);
+ Qt::LayoutDirection m_previewLayoutDirection;
+};
+
+}
+#endif // LRLIMERENDER_P_H
diff --git a/limerender/lrreportrender.cpp b/limerender/lrreportrender.cpp
new file mode 100644
index 0000000..782db29
--- /dev/null
+++ b/limerender/lrreportrender.cpp
@@ -0,0 +1,1104 @@
+/***************************************************************************
+ * This file is part of the Lime Report project *
+ * Copyright (C) 2015 by Alexander Arin *
+ * arin_a@bk.ru *
+ * *
+ ** GNU General Public License Usage **
+ * *
+ * This library is free software: you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation, either version 3 of the License, or *
+ * (at your option) any later version. *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program. If not, see . *
+ * *
+ ** GNU Lesser General Public License **
+ * *
+ * 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 3 of the *
+ * License, or (at your option) any later version. *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this library. *
+ * If not, see . *
+ * *
+ * 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 General Public License for more details. *
+ ****************************************************************************/
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include "time.h"
+
+#include "limerender_p.h"
+#include "limerender.h"
+
+#include "lrpagedesignintf.h"
+#include "lrdatasourcemanager.h"
+#include "lrreportrender.h"
+#include "serializators/lrxmlwriter.h"
+#include "serializators/lrxmlreader.h"
+#include "lrpreviewreportwindow.h"
+#include "lrpreviewreportwidget.h"
+#include "lrpreviewreportwidget_p.h"
+
+#ifdef HAVE_STATIC_BUILD
+#include "lrfactoryinitializer.h"
+#endif
+namespace LimeReport{
+
+QSettings* LimeRender::m_settings = 0;
+
+LimeRenderPrivate::LimeRenderPrivate(QObject *parent) :
+ QObject(parent), m_fileName(""), m_settings(0), m_ownedSettings(false),
+ m_printer(new QPrinter(QPrinter::HighResolution)), m_printerSelected(false),
+ m_showProgressDialog(true), m_reportName(""), m_activePreview(0),
+ m_previewWindowIcon(":/report/images/logo32"), m_previewWindowTitle(tr("Preview")),
+ m_LimeRendering(false), m_resultIsEditable(true), m_passPhrase("HjccbzHjlbyfCkjy"),
+ m_fileWatcher( new QFileSystemWatcher( this ) ), m_reportLanguage(QLocale::AnyLanguage)
+{
+#ifdef HAVE_STATIC_BUILD
+ initResources();
+ initReportItems();
+ initObjectInspectorProperties();
+ initSerializators();
+#endif
+ m_datasources = new DataSourceManager(this);
+ m_datasources->setReportSettings(&m_reportSettings);
+ m_scriptEngineContext = new ScriptEngineContext(this);
+
+ ICallbackDatasource* tableOfContens = m_datasources->createCallbackDatasource("tableofcontens");
+ connect(tableOfContens, SIGNAL(getCallbackData(LimeReport::CallbackInfo,QVariant&)),
+ m_scriptEngineContext->tableOfContens(), SLOT(slotOneSlotDS(LimeReport::CallbackInfo,QVariant&)));
+
+ m_datasources->setObjectName("datasources");
+ connect(m_datasources,SIGNAL(loadCollectionFinished(QString)),this,SLOT(slotDataSourceCollectionLoaded(QString)));
+ connect(m_fileWatcher,SIGNAL(fileChanged(const QString &)),this,SLOT(slotLoadFromFile(const QString &)));
+}
+
+LimeRenderPrivate::~LimeRenderPrivate()
+{
+ if (m_activePreview){
+ m_activePreview->close();
+ }
+ foreach(PageDesignIntf* page,m_pages) delete page;
+ m_pages.clear();
+
+ foreach(ReportTranslation* translation, m_translations)
+ delete translation;
+ m_translations.clear();
+
+ if (m_ownedSettings&&m_settings) delete m_settings;
+}
+
+QObject* LimeRenderPrivate::createElement(const QString &, const QString &)
+{
+ return appendPage();
+}
+
+QObject *LimeRenderPrivate::elementAt(const QString &, int index)
+{
+ return pageAt(index);
+}
+
+PageDesignIntf *LimeRenderPrivate::createPage(const QString &pageName)
+{
+ PageDesignIntf* page =new PageDesignIntf();
+ page->setObjectName(pageName);
+ page->pageItem()->setObjectName("Report"+pageName);
+ page->setReportRender(this);
+ page->setReportSettings(&m_reportSettings);
+ return page;
+}
+
+PageDesignIntf *LimeRenderPrivate::appendPage(const QString &pageName)
+{
+ PageDesignIntf* page = createPage(pageName);
+ m_pages.append(page);
+ return page;
+}
+
+bool LimeRenderPrivate::deletePage(PageDesignIntf *page){
+ QList::iterator it = m_pages.begin();
+ while (it != m_pages.end()){
+ if (*it == page) {
+ it = m_pages.erase(it);
+ return true;
+ } else ++it;
+ }
+ return false;
+}
+
+PageDesignIntf *LimeRenderPrivate::createPreviewPage()
+{
+ return createPage();
+}
+
+int LimeRenderPrivate::elementsCount(const QString &)
+{
+ return m_pages.count();
+}
+
+void LimeRenderPrivate::collectionLoadFinished(const QString &)
+{
+ foreach (PageDesignIntf* page, m_pages) {
+ page->setReportRender(this);
+ page->setReportSettings(&m_reportSettings);
+ page->setSceneRect(-Const::SCENE_MARGIN,-Const::SCENE_MARGIN,
+ page->pageItem()->width()+Const::SCENE_MARGIN*2,
+ page->pageItem()->height()+Const::SCENE_MARGIN*2);
+ }
+ emit pagesLoadFinished();
+}
+
+void LimeRenderPrivate::saveError(QString message)
+{
+ m_lastError = message;
+}
+
+void LimeRenderPrivate::showError(QString message)
+{
+ QMessageBox::critical(0,tr("Error"),message);
+}
+
+void LimeRenderPrivate::updateTranslations()
+{
+ foreach(ReportTranslation* translation, m_translations.values()){
+ foreach(PageDesignIntf* page, m_pages){
+ translation->updatePageTranslation(page);
+ }
+ }
+}
+
+void LimeRenderPrivate::slotDataSourceCollectionLoaded(const QString &collectionName)
+{
+ emit datasourceCollectionLoadFinished(collectionName);
+}
+
+void LimeRenderPrivate::slotPreviewWindowDestroyed(QObject* window)
+{
+ if (m_activePreview == window){
+ m_activePreview = 0;
+ }
+}
+
+void LimeRenderPrivate::clearReport()
+{
+ foreach(PageDesignIntf* page,m_pages) delete page;
+ m_pages.clear();
+ foreach(ReportTranslation* reportTranslation, m_translations)
+ delete reportTranslation;
+ m_translations.clear();
+ m_datasources->clear(DataSourceManager::Owned);
+ m_fileName="";
+ m_scriptEngineContext->clear();
+ m_reportSettings.setDefaultValues();
+
+ emit cleared();
+}
+
+void LimeRenderPrivate::printReport(ItemsReaderIntf::Ptr reader, QPrinter& printer)
+{
+ LimeReport::PageDesignIntf renderPage;
+ renderPage.setItemMode(PrintMode);
+ if (reader->first()){
+ reader->readItem(renderPage.pageItem());
+ printer.setFullPage(renderPage.pageItem()->fullPage());
+ printer.setOrientation((QPrinter::Orientation)renderPage.pageItem()->pageOrientation());
+ renderPage.setSceneRect(renderPage.pageItem()->mapToScene(renderPage.pageItem()->rect()).boundingRect());
+
+ if (renderPage.pageItem()->pageSize()==PageItemDesignIntf::Custom){
+ QSizeF pageSize = (renderPage.pageItem()->pageOrientation()==PageItemDesignIntf::Landscape)?
+ QSizeF(renderPage.pageItem()->sizeMM().height(),renderPage.pageItem()->sizeMM().width()):
+ renderPage.pageItem()->sizeMM();
+ printer.setPaperSize(pageSize,QPrinter::Millimeter);
+ } else {
+ printer.setPaperSize((QPrinter::PageSize)renderPage.pageItem()->pageSize());
+ }
+
+ QPainter painter(&printer);
+ renderPage.render(&painter);
+
+ while (reader->next()){
+ printer.newPage();
+ renderPage.removeAllItems();
+ reader->readItem(renderPage.pageItem());
+ renderPage.setSceneRect(renderPage.pageItem()->mapToScene(renderPage.pageItem()->rect()).boundingRect());
+ renderPage.render(&painter);
+ }
+ }
+}
+
+void LimeRenderPrivate::printReport(ReportPages pages, QPrinter &printer)
+{
+ LimeReport::PageDesignIntf renderPage;
+ renderPage.setItemMode(PrintMode);
+ QPainter* painter=0;
+
+ bool isFirst = true;
+ int currenPage = 1;
+
+
+ qreal leftMargin, topMargin, rightMargin, bottomMargin;
+ printer.getPageMargins(&leftMargin, &topMargin, &rightMargin, &bottomMargin, QPrinter::Millimeter);
+
+ QRectF printerPageRect = printer.pageRect(QPrinter::Millimeter);
+ printerPageRect = QRectF(0,0,(printerPageRect.size().width() + rightMargin + leftMargin) * Const::mmFACTOR,
+ (printerPageRect.size().height() + bottomMargin +topMargin) * Const::mmFACTOR);
+
+ foreach(PageItemDesignIntf::Ptr page, pages){
+
+ if (
+ (printer.printRange() == QPrinter::AllPages) ||
+ ( (printer.printRange()==QPrinter::PageRange) &&
+ (currenPage>=printer.fromPage()) &&
+ (currenPage<=printer.toPage())
+ )
+ )
+ {
+
+ QPointF pagePos = page->pos();
+
+ page->setPos(0,0);
+ renderPage.setPageItem(page);
+ renderPage.setSceneRect(renderPage.pageItem()->mapToScene(renderPage.pageItem()->rect()).boundingRect());
+ if (renderPage.pageItem()->oldPrintMode()){
+ printer.setPageMargins(renderPage.pageItem()->leftMargin(),
+ renderPage.pageItem()->topMargin(),
+ renderPage.pageItem()->rightMargin(),
+ renderPage.pageItem()->bottomMargin(),
+ QPrinter::Millimeter);
+ printer.setOrientation((QPrinter::Orientation)renderPage.pageItem()->pageOrientation());
+ QSizeF pageSize = (renderPage.pageItem()->pageOrientation()==PageItemDesignIntf::Landscape)?
+ QSizeF(renderPage.pageItem()->sizeMM().height(),renderPage.pageItem()->sizeMM().width()):
+ renderPage.pageItem()->sizeMM();
+ printer.setPaperSize(pageSize,QPrinter::Millimeter);
+ } else {
+ printer.setFullPage(renderPage.pageItem()->fullPage());
+ printer.setOrientation((QPrinter::Orientation)renderPage.pageItem()->pageOrientation());
+ if (renderPage.pageItem()->pageSize()==PageItemDesignIntf::Custom){
+ QSizeF pageSize = (renderPage.pageItem()->pageOrientation()==PageItemDesignIntf::Landscape)?
+ QSizeF(renderPage.pageItem()->sizeMM().height(),renderPage.pageItem()->sizeMM().width()):
+ renderPage.pageItem()->sizeMM();
+ if (page->getSetPageSizeToPrinter())
+ printer.setPaperSize(pageSize,QPrinter::Millimeter);
+ } else {
+ if (page->getSetPageSizeToPrinter())
+ printer.setPaperSize((QPrinter::PageSize)renderPage.pageItem()->pageSize());
+ }
+ }
+
+ if (!isFirst){
+ printer.newPage();
+ } else {
+ isFirst=false;
+ painter = new QPainter(&printer);
+ }
+
+ if (printerPageRect.width() < page->geometry().width()){
+ qreal pageWidth = page->geometry().width();
+ QRectF currentPrintingRect = printerPageRect;
+ while (pageWidth>0){
+ renderPage.render(painter, printer.pageRect(), currentPrintingRect);
+ currentPrintingRect.adjust(printerPageRect.size().width(),0,printerPageRect.size().width(),0);
+ pageWidth -= printerPageRect.size().width();
+ if (pageWidth>0) printer.newPage();
+ }
+
+ } else {
+ renderPage.render(painter);
+ }
+
+
+ page->setPos(pagePos);
+ }
+
+ currenPage++;
+ }
+ delete painter;
+}
+
+QStringList LimeRenderPrivate::aviableReportTranslations()
+{
+ QStringList result;
+ foreach (QLocale::Language language, aviableLanguages()){
+ result << QLocale::languageToString(language);
+ }
+ return result;
+}
+
+void LimeRenderPrivate::setReportTranslation(const QString &languageName)
+{
+ foreach(QLocale::Language language, aviableLanguages()){
+ if (QLocale::languageToString(language).compare(languageName) == 0){
+ setReportLanguage(language);
+ }
+ }
+};
+
+bool LimeRenderPrivate::printReport(QPrinter* printer)
+{
+ if (!printer&&!m_printerSelected){
+ QPrinterInfo pi;
+ if (!pi.defaultPrinter().isNull())
+#ifdef HAVE_QT4
+ m_printer.data()->setPrinterName(pi.defaultPrinter().printerName());
+#endif
+#ifdef HAVE_QT5
+ m_printer.data()->setPrinterName(pi.defaultPrinterName());
+#endif
+ QPrintDialog dialog(m_printer.data(),QApplication::activeWindow());
+ m_printerSelected = dialog.exec()!=QDialog::Rejected;
+ }
+ if (!printer&&!m_printerSelected) return false;
+
+ printer =(printer)?printer:m_printer.data();
+ if (printer&&printer->isValid()){
+ try{
+ dataManager()->setDesignTime(false);
+ ReportPages pages = renderToPages();
+ dataManager()->setDesignTime(true);
+ if (pages.count()>0){
+ printReport(pages,*printer);
+ }
+ } catch(ReportError &exception){
+ saveError(exception.what());
+ }
+ return true;
+ } else return false;
+}
+
+bool LimeRenderPrivate::printPages(ReportPages pages, QPrinter *printer)
+{
+ if (!printer&&!m_printerSelected){
+ QPrinterInfo pi;
+ if (!pi.defaultPrinter().isNull())
+#ifdef HAVE_QT4
+ m_printer.data()->setPrinterName(pi.defaultPrinter().printerName());
+#endif
+#ifdef HAVE_QT5
+ m_printer.data()->setPrinterName(pi.defaultPrinterName());
+#endif
+ QPrintDialog dialog(m_printer.data(),QApplication::activeWindow());
+ m_printerSelected = dialog.exec()!=QDialog::Rejected;
+ }
+ if (!printer&&!m_printerSelected) return false;
+
+ printer =(printer)?printer:m_printer.data();
+ if (printer&&printer->isValid()){
+ try{
+ if (pages.count()>0){
+ printReport(
+ pages,
+ *printer
+ );
+ }
+ } catch(ReportError &exception){
+ saveError(exception.what());
+ }
+ return true;
+ } else return false;
+}
+
+void LimeRenderPrivate::printToFile(const QString &fileName)
+{
+ if (!fileName.isEmpty()){
+ QFile file(fileName);
+ if (file.open(QIODevice::WriteOnly)){
+ QTextStream out(&file);
+ try {
+ dataManager()->setDesignTime(false);
+ out<setDesignTime(true);
+ } catch( ReportError &exception){
+ saveError(exception.what());
+ }
+ }
+ file.close();
+ }
+}
+
+bool LimeRenderPrivate::printToPDF(const QString &fileName)
+{
+ if (!fileName.isEmpty()){
+ QFileInfo fi(fileName);
+ QString fn = fileName;
+ if (fi.suffix().isEmpty())
+ fn+=".pdf";
+ QPrinter printer;
+ printer.setOutputFileName(fn);
+ printer.setOutputFormat(QPrinter::PdfFormat);
+ return printReport(&printer);
+ }
+ return false;
+}
+
+void LimeRenderPrivate::previewReport(PreviewHints hints)
+{
+// QTime start = QTime::currentTime();
+ try{
+ dataManager()->setDesignTime(false);
+ ReportPages pages = renderToPages();
+ dataManager()->setDesignTime(true);
+ if (pages.count()>0){
+ Q_Q(LimeRender);
+ PreviewReportWindow* w = new PreviewReportWindow(q,0,settings());
+ w->setWindowFlags(Qt::Dialog|Qt::WindowMaximizeButtonHint|Qt::WindowCloseButtonHint| Qt::WindowMinMaxButtonsHint);
+ w->setAttribute(Qt::WA_DeleteOnClose,true);
+ w->setWindowModality(Qt::ApplicationModal);
+ //w->setWindowIcon(QIcon(":/report/images/main.ico"));
+ w->setWindowIcon(m_previewWindowIcon);
+ w->setWindowTitle(m_previewWindowTitle);
+ w->setSettings(settings());
+ w->setPages(pages);
+ w->setLayoutDirection(m_previewLayoutDirection);
+ if (!dataManager()->errorsList().isEmpty()){
+ w->setErrorMessages(dataManager()->errorsList());
+ }
+
+ if (!hints.testFlag(PreviewBarsUserSetting)){
+ w->setMenuVisible(!hints.testFlag(HidePreviewMenuBar));
+ w->setStatusBarVisible(!hints.testFlag(HidePreviewStatusBar));
+ w->setToolBarVisible(!hints.testFlag(HidePreviewToolBar));
+ }
+
+ w->setHideResultEditButton(resultIsEditable());
+
+ m_activePreview = w;
+ connect(w,SIGNAL(destroyed(QObject*)), this, SLOT(slotPreviewWindowDestroyed(QObject*)));
+ w->exec();
+ }
+ } catch (ReportError &exception){
+ saveError(exception.what());
+ showError(exception.what());
+ }
+}
+
+PreviewReportWidget* LimeRenderPrivate::createPreviewWidget(QWidget* parent){
+
+ Q_Q(LimeRender);
+ PreviewReportWidget* widget = new PreviewReportWidget(q, parent);
+ try{
+ dataManager()->setDesignTime(false);
+ ReportPages pages = renderToPages();
+ dataManager()->setDesignTime(true);
+ if (pages.count()>0)
+ widget->d_ptr->setPages(pages);
+ } catch (ReportError &exception){
+ saveError(exception.what());
+ showError(exception.what());
+ }
+ return widget;
+}
+
+PageDesignIntf* LimeRenderPrivate::createPreviewScene(QObject* parent){
+ PageDesignIntf* result = 0;
+ try {
+ ReportPages pages = renderToPages();
+ result = new PageDesignIntf(parent);
+ result->setPageItems(pages);
+ } catch (ReportError &exception){
+ saveError(exception.what());
+ showError(exception.what());
+ }
+ return result;
+}
+
+bool LimeRenderPrivate::emitLoadReport()
+{
+ bool result = false;
+ emit onLoad(result);
+ return result;
+}
+
+bool LimeRenderPrivate::slotLoadFromFile(const QString &fileName)
+{
+ PreviewReportWindow *currentPreview = qobject_cast(m_activePreview);
+
+ if (!QFile::exists(fileName))
+ {
+ if ( hasActivePreview() )
+ {
+ QMessageBox::information( NULL,
+ tr( "Report File Change" ),
+ tr( "The report file \"%1\" has changed names or been deleted.\n\nThis preview is no longer valid." ).arg( fileName )
+ );
+
+ clearReport();
+
+ currentPreview->close();
+ }
+
+ return false;
+ }
+
+ clearReport();
+
+ ItemsReaderIntf::Ptr reader = FileXMLReader::create(fileName);
+ reader->setPassPhrase(m_passPhrase);
+ if (reader->first()){
+ if (reader->readItem(this)){
+ m_fileName=fileName;
+ QFileInfo fi(fileName);
+ m_reportName = fi.fileName();
+
+ QString dbSettingFileName = fi.absolutePath()+"/"+fi.baseName()+".db";
+ if (QFile::exists(dbSettingFileName)){
+ QSettings dbcredentals(dbSettingFileName, QSettings::IniFormat);
+ foreach (ConnectionDesc* connection, dataManager()->conections()) {
+ if (!connection->keepDBCredentials()){
+ dbcredentals.beginGroup(connection->name());
+ connection->setUserName(dbcredentals.value("user").toString());
+ connection->setPassword(dbcredentals.value("password").toString());
+ dbcredentals.endGroup();
+ }
+ }
+ }
+
+ dataManager()->connectAutoConnections();
+
+ if ( hasActivePreview() )
+ {
+ currentPreview->reloadPreview();
+ }
+ return true;
+ };
+ }
+ m_lastError = reader->lastError();
+ return false;
+}
+
+void LimeRenderPrivate::cancelRender()
+{
+ if (m_LimeRender)
+ m_LimeRender->cancelRender();
+ m_LimeRendering = false;
+}
+
+PageDesignIntf* LimeRender::createPreviewScene(QObject* parent){
+ Q_D(LimeRender);
+ return d->createPreviewScene(parent);
+}
+
+void LimeRenderPrivate::setSettings(QSettings* value)
+{
+ if (value){
+ if (m_ownedSettings&&m_settings)
+ delete m_settings;
+ m_settings = value;
+ m_ownedSettings = false;
+ }
+}
+
+QSettings*LimeRenderPrivate::settings()
+{
+ if (m_settings){
+ return m_settings;
+ } else {
+ m_settings = new QSettings("LimeReport",QApplication::applicationName());
+ m_ownedSettings=true;
+ return m_settings;
+ }
+}
+
+bool LimeRenderPrivate::loadFromFile(const QString &fileName, bool autoLoadPreviewOnChange)
+{
+ // only watch one file at a time
+ if ( !m_fileWatcher->files().isEmpty() )
+ {
+ m_fileWatcher->removePaths( m_fileWatcher->files() );
+ }
+
+ if ( autoLoadPreviewOnChange )
+ {
+ m_fileWatcher->addPath( fileName );
+ }
+
+ return slotLoadFromFile( fileName );
+}
+
+bool LimeRenderPrivate::loadFromByteArray(QByteArray* data, const QString &name){
+ clearReport();
+
+ ItemsReaderIntf::Ptr reader = ByteArrayXMLReader::create(data);
+ reader->setPassPhrase(m_passPhrase);
+ if (reader->first()){
+ if (reader->readItem(this)){
+ m_fileName = "";
+ m_reportName = name;
+ return true;
+ };
+ }
+ return false;
+}
+
+bool LimeRenderPrivate::loadFromString(const QString &report, const QString &name)
+{
+ clearReport();
+
+ ItemsReaderIntf::Ptr reader = StringXMLreader::create(report);
+ reader->setPassPhrase(m_passPhrase);
+ if (reader->first()){
+ if (reader->readItem(this)){
+ m_fileName = "";
+ m_reportName = name;
+ return true;
+ };
+ }
+ return false;
+}
+
+QString LimeRenderPrivate::renderToString()
+{
+ LimeReport::LimeRender render;
+ dataManager()->connectAllDatabases();
+ dataManager()->setDesignTime(false);
+ if (m_pages.count()){
+ render.setDatasources(dataManager());
+ render.setScriptContext(scriptContext());
+ return render.renderPageToString(m_pages.at(0));
+ }else return QString();
+}
+
+PageDesignIntf* LimeRenderPrivate::getPageByName(const QString& pageName)
+{
+ foreach(PageDesignIntf* page, m_pages){
+ if ( page->objectName().compare(pageName, Qt::CaseInsensitive) == 0)
+ return page;
+ }
+ return 0;
+}
+
+Qt::LayoutDirection LimeRenderPrivate::previewLayoutDirection()
+{
+ return m_previewLayoutDirection;
+}
+
+void LimeRenderPrivate::setPreviewLayoutDirection(const Qt::LayoutDirection& layoutDirection)
+{
+ m_previewLayoutDirection = layoutDirection;
+}
+
+void LimeRenderPrivate::setPassPhrase(const QString &passPhrase)
+{
+ m_passPhrase = passPhrase;
+}
+
+void LimeRenderPrivate::reorderPages(const QList& reorderedPages)
+{
+ m_pages.clear();
+ foreach(PageDesignIntf* page, reorderedPages){
+ m_pages.append(page);
+ }
+}
+
+void LimeRenderPrivate::clearSelection()
+{
+ foreach (PageDesignIntf* page, m_pages) {
+ foreach(QGraphicsItem* item, page->selectedItems()){
+ item->setSelected(false);
+ }
+ }
+}
+
+bool LimeRenderPrivate::addTranslationLanguage(QLocale::Language language)
+{
+ if (!m_translations.keys().contains(language)){
+ ReportTranslation* translation = 0;
+ if (!m_translations.contains(QLocale::AnyLanguage)){
+ translation = new ReportTranslation(QLocale::AnyLanguage,m_pages);
+ m_translations.insert(QLocale::AnyLanguage,translation);
+ }
+ translation = new ReportTranslation(language,m_pages);
+ m_translations.insert(language, translation);
+ return true;
+ } else {
+ m_lastError = tr("Language %1 already exists").arg(QLocale::languageToString(language));
+ return false;
+ }
+}
+
+bool LimeRenderPrivate::removeTranslationLanguage(QLocale::Language language)
+{
+ return m_translations.remove(language) != 0;
+}
+
+void LimeRenderPrivate::activateLanguage(QLocale::Language language)
+{
+ if (!m_translations.keys().contains(language)) return;
+ ReportTranslation* translation = m_translations.value(language);
+
+ foreach(PageTranslation* pageTranslation, translation->pagesTranslation()){
+ PageDesignIntf* page = getPageByName(pageTranslation->pageName);
+ if (page){
+ foreach(ItemTranslation* itemTranslation, pageTranslation->itemsTranslation){
+ BaseDesignIntf* item = page->pageItem()->childByName(itemTranslation->itemName);
+ if (item) {
+ foreach(PropertyTranslation* propertyTranslation, itemTranslation->propertyesTranslation){
+ item->setProperty(propertyTranslation->propertyName.toLatin1(), propertyTranslation->value);
+ }
+ }
+ }
+ }
+ }
+}
+
+bool LimeRenderPrivate::setReportLanguage(QLocale::Language language){
+ m_reportLanguage = language;
+ if (!m_translations.keys().contains(language)) return false;
+// activateLanguage(language);
+ return true;
+}
+
+QList LimeRenderPrivate::aviableLanguages()
+{
+ return m_translations.keys();
+}
+
+ReportTranslation*LimeRenderPrivate::reportTranslation(QLocale::Language language)
+{
+ return m_translations.value(language);
+}
+
+bool LimeRenderPrivate::resultIsEditable() const
+{
+ return m_resultIsEditable;
+}
+
+void LimeRenderPrivate::setResultEditable(bool value)
+{
+ m_resultIsEditable = value;
+}
+
+bool LimeRenderPrivate::suppressFieldAndVarError() const
+{
+ return m_reportSettings.suppressAbsentFieldsAndVarsWarnings();
+}
+
+void LimeRenderPrivate::setSuppressFieldAndVarError(bool suppressFieldAndVarError)
+{
+ m_reportSettings.setSuppressAbsentFieldsAndVarsWarnings(suppressFieldAndVarError);
+}
+
+bool LimeRenderPrivate::isBusy()
+{
+ return m_LimeRendering;
+}
+
+QString LimeRenderPrivate::previewWindowTitle() const
+{
+ return m_previewWindowTitle;
+}
+
+void LimeRenderPrivate::setPreviewWindowTitle(const QString &previewWindowTitle)
+{
+ m_previewWindowTitle = previewWindowTitle;
+}
+
+QIcon LimeRenderPrivate::previewWindowIcon() const
+{
+ return m_previewWindowIcon;
+}
+
+void LimeRenderPrivate::setPreviewWindowIcon(const QIcon &previewWindowIcon)
+{
+ m_previewWindowIcon = previewWindowIcon;
+}
+
+ReportPages LimeRenderPrivate::renderToPages()
+{
+ if (m_LimeRendering) return ReportPages();
+ m_LimeRender = LimeRender::Ptr(new LimeRender);
+
+ dataManager()->clearErrors();
+ dataManager()->connectAllDatabases();
+ dataManager()->setDesignTime(false);
+ dataManager()->updateDatasourceModel();
+
+ connect(m_LimeRender.data(),SIGNAL(pageRendered(int)),
+ this, SIGNAL(renderPageFinished(int)));
+
+ if (m_pages.count()){
+#ifdef HAVE_UI_LOADER
+ m_scriptEngineContext->initDialogs();
+#endif
+ ReportPages result;
+ m_LimeRendering = true;
+
+ m_LimeRender->setDatasources(dataManager());
+ m_LimeRender->setScriptContext(scriptContext());
+
+ foreach (PageDesignIntf* page, m_pages) {
+ scriptContext()->baseDesignIntfToScript(page->pageItem()->objectName(), page->pageItem());
+ }
+
+ scriptContext()->qobjectToScript("engine",this);
+
+ if (m_scriptEngineContext->runInitScript()){
+
+ activateLanguage(m_reportLanguage);
+ emit renderStarted();
+
+ foreach(PageDesignIntf* page , m_pages){
+ if (!page->pageItem()->isTOC()){
+ page->setReportSettings(&m_reportSettings);
+ result.append(m_LimeRender->renderPageToPages(page));
+ }
+ }
+
+
+// m_LimeRender->secondRenderPass(result);
+
+ for (int i=0; ipageItem()->isTOC()){
+ page->setReportSettings(&m_reportSettings);
+ if (i==0){
+ PageDesignIntf* secondPage = 0;
+ if (m_pages.count()>1) secondPage = m_pages.at(1);
+ ReportPages pages = m_LimeRender->renderTOC(
+ page,
+ true,
+ secondPage && secondPage->pageItem()->resetPageNumber()
+ );
+ for (int j=0; jrenderPageToPages(page));
+ }
+ }
+ }
+
+ m_LimeRender->secondRenderPass(result);
+
+ emit renderFinished();
+ m_LimeRender.clear();
+ }
+ m_LimeRendering = false;
+ activateLanguage(QLocale::AnyLanguage);
+ return result;
+ } else {
+ return ReportPages();
+ }
+}
+
+QString LimeRenderPrivate::lastError()
+{
+ return m_lastError;
+}
+
+LimeRender::LimeRender(QObject *parent)
+ : QObject(parent), d_ptr(new LimeRenderPrivate())
+{
+ Q_D(LimeRender);
+ d->q_ptr=this;
+ connect(d, SIGNAL(renderStarted()), this, SIGNAL(renderStarted()));
+ connect(d, SIGNAL(renderPageFinished(int)),
+ this, SIGNAL(renderPageFinished(int)));
+ connect(d, SIGNAL(renderFinished()), this, SIGNAL(renderFinished()));
+ connect(d, SIGNAL(onLoad(bool&)), this, SIGNAL(onLoad(bool&)));
+}
+
+LimeRender::~LimeRender()
+{
+ delete d_ptr;
+}
+
+bool LimeRender::printReport(QPrinter *printer)
+{
+ Q_D(LimeRender);
+ return d->printReport(printer);
+}
+
+bool LimeRender::printPages(ReportPages pages, QPrinter *printer){
+ Q_D(LimeRender);
+ return d->printPages(pages,printer);
+}
+
+void LimeRender::printToFile(const QString &fileName)
+{
+ Q_D(LimeRender);
+ d->printToFile(fileName);
+}
+
+bool LimeRender::printToPDF(const QString &fileName)
+{
+ Q_D(LimeRender);
+ return d->printToPDF(fileName);
+}
+
+void LimeRender::previewReport(PreviewHints hints)
+{
+ Q_D(LimeRender);
+ if (m_settings)
+ d->setSettings(m_settings);
+ d->previewReport(hints);
+}
+
+void LimeRender::designReport()
+{
+ Q_D(LimeRender);
+ if (m_settings)
+ d->setSettings(m_settings);
+ d->designReport();
+}
+
+PreviewReportWidget* LimeRender::createPreviewWidget(QWidget *parent)
+{
+ Q_D(LimeRender);
+ return d->createPreviewWidget(parent);
+}
+
+void LimeRender::setPreviewWindowTitle(const QString &title)
+{
+ Q_D(LimeRender);
+ d->setPreviewWindowTitle(title);
+}
+
+void LimeRender::setPreviewWindowIcon(const QIcon &icon)
+{
+ Q_D(LimeRender);
+ d->setPreviewWindowIcon(icon);
+}
+
+void LimeRender::setResultEditable(bool value)
+{
+ Q_D(LimeRender);
+ d->setResultEditable(value);
+}
+
+bool LimeRender::resultIsEditable()
+{
+ Q_D(LimeRender);
+ return d->resultIsEditable();
+}
+
+bool LimeRender::isBusy()
+{
+ Q_D(LimeRender);
+ return d->isBusy();
+}
+
+void LimeRender::setPassPharse(QString &passPharse)
+{
+ Q_D(LimeRender);
+ d->setPassPhrase(passPharse);
+}
+
+QList LimeRender::aviableLanguages()
+{
+ Q_D(LimeRender);
+ return d->aviableLanguages();
+}
+
+bool LimeRender::setReportLanguage(QLocale::Language language)
+{
+ Q_D(LimeRender);
+ return d->setReportLanguage(language);
+}
+
+void LimeRender::setShowProgressDialog(bool value)
+{
+ Q_D(LimeRender);
+ d->setShowProgressDialog(value);
+}
+
+IDataSourceManager *LimeRender::dataManager()
+{
+ Q_D(LimeRender);
+ return d->dataManagerIntf();
+}
+
+IScriptEngineManager *LimeRender::scriptManager()
+{
+ Q_D(LimeRender);
+ return d->scriptManagerIntf();
+}
+
+bool LimeRender::loadFromFile(const QString &fileName, bool autoLoadPreviewOnChange)
+{
+ Q_D(LimeRender);
+ return d->loadFromFile(fileName, autoLoadPreviewOnChange);
+}
+
+bool LimeRender::loadFromByteArray(QByteArray* data){
+ Q_D(LimeRender);
+ return d->loadFromByteArray(data);
+}
+
+bool LimeRender::loadFromString(const QString &data)
+{
+ Q_D(LimeRender);
+ return d->loadFromString(data);
+}
+
+QString LimeRender::reportFileName()
+{
+ Q_D(LimeRender);
+ return d->reportFileName();
+}
+
+void LimeRender::setReportFileName(const QString &fileName)
+{
+ Q_D(LimeRender);
+ return d->setReportFileName(fileName);
+}
+
+QString LimeRender::lastError()
+{
+ Q_D(LimeRender);
+ return d->lastError();
+}
+
+void LimeRender::setCurrentReportsDir(const QString &dirName)
+{
+ Q_D(LimeRender);
+ return d->setCurrentReportsDir(dirName);
+}
+
+void LimeRender::setReportName(const QString &name)
+{
+ Q_D(LimeRender);
+ return d->setReportName(name);
+}
+
+QString LimeRender::reportName()
+{
+ Q_D(LimeRender);
+ return d->reportName();
+}
+
+void LimeRender::cancelRender()
+{
+ Q_D(LimeRender);
+ d->cancelRender();
+}
+
+LimeRender::LimeRender(LimeRenderPrivate &dd, QObject *parent)
+ :QObject(parent),d_ptr(&dd)
+{
+ Q_D(LimeRender);
+ d->q_ptr=this;
+ connect(d, SIGNAL(renderStarted()), this, SIGNAL(renderStarted()));
+ connect(d, SIGNAL(renderPageFinished(int)),
+ this, SIGNAL(renderPageFinished(int)));
+ connect(d, SIGNAL(renderFinished()), this, SIGNAL(renderFinished()));
+}
+
+ScriptEngineManager*LimeReport::LimeRenderPrivate::scriptManager(){
+ ScriptEngineManager::instance().setContext(scriptContext());
+ ScriptEngineManager::instance().setDataManager(dataManager());
+ return &ScriptEngineManager::instance();
+}
+
+}// namespace LimeReport
+
diff --git a/limereport.pro b/limereport.pro
index 84179ac..3ede347 100644
--- a/limereport.pro
+++ b/limereport.pro
@@ -10,12 +10,19 @@ contains(CONFIG, zint){
}
export($$CONFIG)
-SUBDIRS += \
- limereport
-CONFIG += ordered
+
+SUBDIRS += limereport
+
+CONFIG += ordered
SUBDIRS += demo_r1 demo_r2 designer
+!contains(CONFIG, embedded_designer){
+!contains(CONFIG, static_build){
+SUBDIRS += designer_plugin
+}
+}
+
diff --git a/limereport/databrowser/lrdatabrowser.cpp b/limereport/databrowser/lrdatabrowser.cpp
index 4452df1..3dcd795 100644
--- a/limereport/databrowser/lrdatabrowser.cpp
+++ b/limereport/databrowser/lrdatabrowser.cpp
@@ -277,7 +277,7 @@ QSettings *DataBrowser::settings()
if (m_settings){
return m_settings;
} else {
- m_settings = new QSettings("LimeReport",QApplication::applicationName());
+ m_settings = new QSettings("LimeReport",QCoreApplication::applicationName());
m_ownedSettings = true;
return m_settings;
}
diff --git a/limereport/databrowser/lrsqleditdialog.cpp b/limereport/databrowser/lrsqleditdialog.cpp
index 05e3267..f74ae6c 100644
--- a/limereport/databrowser/lrsqleditdialog.cpp
+++ b/limereport/databrowser/lrsqleditdialog.cpp
@@ -78,7 +78,7 @@ QSettings *SQLEditDialog::settings(){
if (m_settings){
return m_settings;
} else {
- m_settings = new QSettings("LimeReport",QApplication::applicationName());
+ m_settings = new QSettings("LimeReport",QCoreApplication::applicationName());
m_ownedSettings = true;
return m_settings;
}
diff --git a/limereport/items/editors/lrfonteditorwidget.cpp b/limereport/items/editors/lrfonteditorwidget.cpp
index a2d7dbc..6787e90 100644
--- a/limereport/items/editors/lrfonteditorwidget.cpp
+++ b/limereport/items/editors/lrfonteditorwidget.cpp
@@ -31,23 +31,9 @@
namespace LimeReport{
-FontEditorWidget::FontEditorWidget(ReportDesignWidget *reportEditor, const QString &title, QWidget *parent)
- : ItemEditorWidget(reportEditor,title,parent), m_ignoreSlots(false) {
- initEditor();
-}
-
-FontEditorWidget::FontEditorWidget(ReportDesignWidget *reportEditor, QWidget *parent)
- :ItemEditorWidget(reportEditor,parent), m_ignoreSlots(false) {
- initEditor();
-}
-
-FontEditorWidget::FontEditorWidget(PageDesignIntf *page, const QString &title, QWidget *parent)
- :ItemEditorWidget(page,title,parent), m_ignoreSlots(false) {
- initEditor();
-}
-
-FontEditorWidget::FontEditorWidget(LimeReport::PageDesignIntf *page, QWidget *parent)
- :ItemEditorWidget(page,parent), m_ignoreSlots(false){
+FontEditorWidget::FontEditorWidget(const QString& title, QWidget* parent)
+ :ItemEditorWidget(title, parent), m_ignoreSlots(false)
+{
initEditor();
}
@@ -101,10 +87,6 @@ void FontEditorWidget::initEditor()
connect(m_fontUnderline,SIGNAL(toggled(bool)),this,SLOT(slotFontAttribsChanged(bool)));
addAction(m_fontUnderline);
- if (reportEditor()){
- connect(reportEditor(),SIGNAL(itemPropertyChanged(QString,QString,QVariant,QVariant)),
- this,SLOT(slotPropertyChanged(QString,QString,QVariant,QVariant)));
- }
}
void FontEditorWidget::updateValues(const QFont& font)
@@ -118,35 +100,31 @@ void FontEditorWidget::updateValues(const QFont& font)
m_ignoreSlots=false;
}
-
-void FontEditorWidget::slotFontChanged(const QFont &font)
+bool FontEditorWidget::ignoreSlots() const
{
- if (reportEditor() && !m_ignoreSlots) reportEditor()->setFont(font);
- if (page()) page()->setFont(font);
+ return m_ignoreSlots;
+}
+
+
+void FontEditorWidget::slotFontChanged(const QFont /*&font*/)
+{
+ // if (page()) page()->setFont(font);
}
void FontEditorWidget::slotFontSizeChanged(const QString &value)
{
if (m_ignoreSlots) return;
-
- QFont resFont(fontNameEditor()->currentFont());
- resFont.setPointSize(value.toInt());
-
- if (reportEditor()) reportEditor()->setFont(resFont);
- if (page()) page()->setFont(resFont);
+ m_resFont = fontNameEditor()->currentFont();
+ m_resFont.setPointSize(value.toInt());
}
void FontEditorWidget::slotFontAttribsChanged(bool)
{
if (m_ignoreSlots) return;
-
- QFont resFont(m_fontNameEditor->currentFont());
- resFont.setBold(m_fontBold->isChecked());
- resFont.setItalic(m_fontItalic->isChecked());
- resFont.setUnderline(m_fontUnderline->isChecked());
- if (reportEditor()) reportEditor()->setFont(resFont);
- if (page()) page()->setFont(resFont);
-
+ m_resFont = m_fontNameEditor->currentFont();
+ m_resFont.setBold(m_fontBold->isChecked());
+ m_resFont.setItalic(m_fontItalic->isChecked());
+ m_resFont.setUnderline(m_fontUnderline->isChecked());
}
void FontEditorWidget::slotPropertyChanged(const QString &objectName, const QString &property, const QVariant& oldValue, const QVariant& newValue)
@@ -159,4 +137,49 @@ void FontEditorWidget::slotPropertyChanged(const QString &objectName, const QStr
}
+void FontEditorWidgetForPage::slotFontChanged(const QFont& font)
+{
+ m_page->setFont(font);
+}
+
+void FontEditorWidgetForPage::slotFontSizeChanged(const QString& value)
+{
+ FontEditorWidget::slotFontSizeChanged(value);
+ m_page->setFont(resFont());
+}
+
+void FontEditorWidgetForPage::slotFontAttribsChanged(bool value)
+{
+ FontEditorWidget::slotFontAttribsChanged(value);
+ m_page->setFont(resFont());
+}
+
+#ifdef HAVE_REPORT_DESIGNER
+void FontEditorWidgetForDesigner::initEditor()
+{
+ FontEditorWidget::initEditor();
+ connect(m_reportEditor,SIGNAL(itemPropertyChanged(QString,QString,QVariant,QVariant)),
+ this,SLOT(slotPropertyChanged(QString,QString,QVariant,QVariant)));
+}
+
+void FontEditorWidgetForDesigner::slotFontChanged(const QFont& font)
+{
+ if (!ignoreSlots()) m_reportEditor->setFont(font);
+}
+
+void FontEditorWidgetForDesigner::slotFontSizeChanged(const QString& value)
+{
+ FontEditorWidget::slotFontSizeChanged(value);
+ m_reportEditor->setFont(resFont());
+}
+
+void FontEditorWidgetForDesigner::slotFontAttribsChanged(bool value)
+{
+ FontEditorWidget::slotFontAttribsChanged(value);
+ m_reportEditor->setFont(resFont());
+}
+
+#endif
+
+
} //namespace LimeReport
diff --git a/limereport/items/editors/lrfonteditorwidget.h b/limereport/items/editors/lrfonteditorwidget.h
index 23f9ab7..c5de288 100644
--- a/limereport/items/editors/lrfonteditorwidget.h
+++ b/limereport/items/editors/lrfonteditorwidget.h
@@ -35,7 +35,10 @@
#include
#include
+#ifdef HAVE_REPORT_DESIGNER
#include "lrreportdesignwidget.h"
+#endif
+
#include "lritemeditorwidget.h"
namespace LimeReport{
@@ -43,20 +46,21 @@ namespace LimeReport{
class FontEditorWidget :public ItemEditorWidget{
Q_OBJECT
public:
- explicit FontEditorWidget(ReportDesignWidget* reportEditor, const QString &title, QWidget *parent = 0);
- explicit FontEditorWidget(ReportDesignWidget* reportEditor, QWidget *parent = 0);
- explicit FontEditorWidget(PageDesignIntf* page, const QString &title, QWidget *parent = 0);
- explicit FontEditorWidget(PageDesignIntf* page, QWidget *parent = 0);
+ explicit FontEditorWidget(const QString &title, QWidget *parent = 0);
+ bool ignoreSlots() const;
protected:
void setItemEvent(BaseDesignIntf *item);
QFontComboBox* fontNameEditor(){return m_fontNameEditor;}
-private slots:
- void slotFontChanged(const QFont& font);
- void slotFontSizeChanged(const QString& value);
- void slotFontAttribsChanged(bool);
+ virtual void initEditor();
+protected slots:
+ virtual void slotFontChanged(const QFont);
+ virtual void slotFontSizeChanged(const QString& value);
+ virtual void slotFontAttribsChanged(bool);
void slotPropertyChanged(const QString& objectName, const QString& property, const QVariant &oldValue, const QVariant &newValue);
+protected:
+ QFont resFont(){return m_resFont;}
private:
- void initEditor();
+
void updateValues(const QFont &font);
QFontComboBox* m_fontNameEditor;
@@ -68,9 +72,41 @@ private:
QAction* m_fontUnderline;
bool m_ignoreSlots;
+ QFont m_resFont;
};
+class FontEditorWidgetForPage : public FontEditorWidget{
+ Q_OBJECT
+public:
+ explicit FontEditorWidgetForPage(PageDesignIntf* page, const QString &title, QWidget *parent = 0)
+ : FontEditorWidget(title, parent), m_page(page){}
+protected slots:
+ virtual void slotFontChanged(const QFont& font);
+ virtual void slotFontSizeChanged(const QString& value);
+ virtual void slotFontAttribsChanged(bool value);
+private:
+ PageDesignIntf* m_page;
+};
+
+#ifdef HAVE_REPORT_DESIGNER
+class FontEditorWidgetForDesigner : public FontEditorWidget{
+ Q_OBJECT
+public:
+ explicit FontEditorWidgetForDesigner(ReportDesignWidget* reportEditor, const QString &title, QWidget *parent = 0)
+ : FontEditorWidget(title, parent), m_reportEditor(reportEditor){}
+
+protected:
+ void initEditor();
+protected slots:
+ virtual void slotFontChanged(const QFont& font);
+ virtual void slotFontSizeChanged(const QString& value);
+ virtual void slotFontAttribsChanged(bool value);
+private:
+ ReportDesignWidget* m_reportEditor;
+};
+#endif
+
} //namespace LimeReport
#endif // LRFONTEDITORWIDGET_H
diff --git a/limereport/items/editors/lritemeditorwidget.cpp b/limereport/items/editors/lritemeditorwidget.cpp
index d335697..d81af5e 100644
--- a/limereport/items/editors/lritemeditorwidget.cpp
+++ b/limereport/items/editors/lritemeditorwidget.cpp
@@ -31,26 +31,6 @@
namespace LimeReport{
-ItemEditorWidget::ItemEditorWidget(ReportDesignWidget* reportEditor, const QString& title, QWidget* parent)
- :QToolBar(title,parent), m_reportEditor(reportEditor), m_item(0), m_page(0)
-{
-}
-
-ItemEditorWidget::ItemEditorWidget(ReportDesignWidget* reportEditor, QWidget* parent)
- :QToolBar(parent), m_reportEditor(reportEditor), m_item(0), m_page(0)
-{
-}
-
-ItemEditorWidget::ItemEditorWidget(PageDesignIntf* page, const QString& title, QWidget* parent)
- :QToolBar(title,parent), m_reportEditor(0), m_item(0), m_page(page)
-{
-}
-
-ItemEditorWidget::ItemEditorWidget(PageDesignIntf* page, QWidget* parent)
- :QToolBar(parent), m_reportEditor(0), m_item(0), m_page(page)
-{
-}
-
void ItemEditorWidget::setItem(BaseDesignIntf* item)
{
if (m_item!=item){
diff --git a/limereport/items/editors/lritemeditorwidget.h b/limereport/items/editors/lritemeditorwidget.h
index 5214756..733eac0 100644
--- a/limereport/items/editors/lritemeditorwidget.h
+++ b/limereport/items/editors/lritemeditorwidget.h
@@ -31,7 +31,11 @@
#define LRITEMEDITORWIDGET_H
#include
+
+#ifdef HAVE_REPORT_DESIGNER
#include "lrreportdesignwidget.h"
+#endif
+#include "lrpagedesignintf.h"
namespace LimeReport {
@@ -39,26 +43,18 @@ class ItemEditorWidget : public QToolBar
{
Q_OBJECT
public:
- explicit ItemEditorWidget(ReportDesignWidget* reportEditor, const QString &title, QWidget *parent = 0);
- explicit ItemEditorWidget(ReportDesignWidget* reportEditor, QWidget *parent = 0);
- explicit ItemEditorWidget(PageDesignIntf* page, const QString &title, QWidget *parent = 0);
- explicit ItemEditorWidget(PageDesignIntf* page, QWidget *parent = 0);
-
+ explicit ItemEditorWidget(const QString &title, QWidget *parent = 0)
+ : QToolBar(title, parent), m_item(0){}
void setItem(BaseDesignIntf *item);
- void setReportEditor(ReportDesignWidget* editor){m_reportEditor = editor;}
protected:
virtual void setItemEvent(BaseDesignIntf*){}
virtual void properyChangedEvent(const QString& propertName, const QVariant& oldValue, const QVariant& newValue);
BaseDesignIntf* item(){return m_item;}
- ReportDesignWidget* reportEditor(){return m_reportEditor;}
- PageDesignIntf* page(){return m_page;}
private slots:
void slotItemDestroyed(QObject* item);
void slotPropertyChanged(const QString& propertName, const QVariant& oldValue, const QVariant& newValue);
private:
- ReportDesignWidget* m_reportEditor;
BaseDesignIntf* m_item;
- PageDesignIntf* m_page;
};
} // namespace LimeReport
diff --git a/limereport/items/editors/lritemsborderseditorwidget.cpp b/limereport/items/editors/lritemsborderseditorwidget.cpp
index afdf766..44cc897 100644
--- a/limereport/items/editors/lritemsborderseditorwidget.cpp
+++ b/limereport/items/editors/lritemsborderseditorwidget.cpp
@@ -32,18 +32,6 @@
namespace LimeReport{
-ItemsBordersEditorWidget::ItemsBordersEditorWidget(ReportDesignWidget* reportEditor, const QString& title, QWidget* parent)
- : ItemEditorWidget(reportEditor,title,parent), m_changing(false)
-{
- initEditor();
-}
-
-ItemsBordersEditorWidget::ItemsBordersEditorWidget(ReportDesignWidget* reportEditor, QWidget* parent)
- : ItemEditorWidget(reportEditor,parent), m_changing(false)
-{
- initEditor();
-}
-
void ItemsBordersEditorWidget::setItemEvent(BaseDesignIntf* item)
{
QVariant borders=item->property("borders");
@@ -65,8 +53,6 @@ void ItemsBordersEditorWidget::properyChangedEvent(const QString& property, cons
void ItemsBordersEditorWidget::noBordesClicked()
{
- if (reportEditor())
- reportEditor()->setBorders(0);
updateValues(0);
}
@@ -78,14 +64,11 @@ void ItemsBordersEditorWidget::allBordesClicked()
BaseDesignIntf::BottomLine;
updateValues((BaseDesignIntf::BorderLines)borders);
- if (reportEditor())
- reportEditor()->setBorders((BaseDesignIntf::BorderLines)borders);
}
void ItemsBordersEditorWidget::buttonClicked(bool)
{
- if (!m_changing&&reportEditor())
- reportEditor()->setBorders(createBorders());
+
}
void ItemsBordersEditorWidget::initEditor()
@@ -151,4 +134,29 @@ BaseDesignIntf::BorderLines ItemsBordersEditorWidget::createBorders()
return (BaseDesignIntf::BorderLines)borders;
}
+bool ItemsBordersEditorWidget::changing() const
+{
+ return m_changing;
+}
+
+#ifdef HAVE_REPORT_DESIGNER
+void ItemsBordersEditorWidgetForDesigner::buttonClicked(bool)
+{
+ if (!changing())
+ m_reportEditor->setBorders(createBorders());
+}
+
+void ItemsBordersEditorWidgetForDesigner::noBordesClicked()
+{
+ m_reportEditor->setBorders(0);
+ ItemsBordersEditorWidget::noBordesClicked();
+}
+
+void ItemsBordersEditorWidgetForDesigner::allBordesClicked()
+{
+ ItemsBordersEditorWidget::allBordesClicked();
+ m_reportEditor->setBorders(createBorders());
+}
+#endif
+
} //namespace LimeReport
diff --git a/limereport/items/editors/lritemsborderseditorwidget.h b/limereport/items/editors/lritemsborderseditorwidget.h
index 296107e..998251c 100644
--- a/limereport/items/editors/lritemsborderseditorwidget.h
+++ b/limereport/items/editors/lritemsborderseditorwidget.h
@@ -40,19 +40,22 @@ class ItemsBordersEditorWidget : public ItemEditorWidget
{
Q_OBJECT
public:
- explicit ItemsBordersEditorWidget(ReportDesignWidget* reportEditor, const QString &title, QWidget *parent = 0);
- explicit ItemsBordersEditorWidget(ReportDesignWidget* reportEditor, QWidget *parent = 0);
-private slots:
- void noBordesClicked();
- void allBordesClicked();
- void buttonClicked(bool);
+ explicit ItemsBordersEditorWidget(const QString &title, QWidget *parent = 0)
+ : ItemEditorWidget(title, parent), m_changing(false), m_borders(0){
+ initEditor();
+ }
+ bool changing() const;
+protected slots:
+ virtual void noBordesClicked();
+ virtual void allBordesClicked();
+ virtual void buttonClicked(bool);
protected:
void setItemEvent(BaseDesignIntf *item);
void properyChangedEvent(const QString &property, const QVariant &oldValue, const QVariant &newValue);
+ BaseDesignIntf::BorderLines createBorders();
private:
void initEditor();
void updateValues(BaseDesignIntf::BorderLines borders);
- BaseDesignIntf::BorderLines createBorders();
QAction* m_noLines;
QAction* m_leftLine;
QAction* m_rightLine;
@@ -60,8 +63,24 @@ private:
QAction* m_bottomLine;
QAction* m_allLines;
bool m_changing;
+ int m_borders;
};
+#ifdef HAVE_REPORT_DESIGNER
+class ItemsBordersEditorWidgetForDesigner : public ItemsBordersEditorWidget{
+ Q_OBJECT
+public:
+ explicit ItemsBordersEditorWidgetForDesigner(ReportDesignWidget* reportEditor, const QString &title="", QWidget *parent = 0)
+ : ItemsBordersEditorWidget(title,parent), m_reportEditor(reportEditor){}
+protected slots:
+ void buttonClicked(bool);
+ void noBordesClicked();
+ void allBordesClicked();
+private:
+ ReportDesignWidget* m_reportEditor;
+};
+#endif
+
}//namespace LimeReport
#endif // LRITEMSBORDERSEDITORWIDGET_H
diff --git a/limereport/items/editors/lrtextalignmenteditorwidget.cpp b/limereport/items/editors/lrtextalignmenteditorwidget.cpp
index 50da901..8eb424b 100644
--- a/limereport/items/editors/lrtextalignmenteditorwidget.cpp
+++ b/limereport/items/editors/lrtextalignmenteditorwidget.cpp
@@ -30,27 +30,8 @@
#include "lrtextalignmenteditorwidget.h"
namespace LimeReport{
-
-TextAlignmentEditorWidget::TextAlignmentEditorWidget(ReportDesignWidget *reportEditor, const QString &title, QWidget *parent)
- :ItemEditorWidget(reportEditor,title,parent), m_textAttibutesIsChanging(false)
-{
- initEditor();
-}
-
-TextAlignmentEditorWidget::TextAlignmentEditorWidget(ReportDesignWidget *reportEditor, QWidget *parent)
- :ItemEditorWidget(reportEditor,parent), m_textAttibutesIsChanging(false)
-{
- initEditor();
-}
-
-TextAlignmentEditorWidget::TextAlignmentEditorWidget(PageDesignIntf* page, const QString& title, QWidget* parent)
- :ItemEditorWidget(page,title,parent), m_textAttibutesIsChanging(false)
-{
- initEditor();
-}
-
-TextAlignmentEditorWidget::TextAlignmentEditorWidget(PageDesignIntf* page, QWidget* parent)
- :ItemEditorWidget(page,parent), m_textAttibutesIsChanging(false)
+TextAlignmentEditorWidget::TextAlignmentEditorWidget(const QString& title, QWidget* parent)
+ :ItemEditorWidget(title, parent), m_textAttibutesIsChanging(false), m_flag(0)
{
initEditor();
}
@@ -109,15 +90,6 @@ void TextAlignmentEditorWidget::initEditor()
m_textAliginBottom->setCheckable(true);
connect(m_textAliginBottom,SIGNAL(toggled(bool)),this,SLOT(slotTextVAttribsChanged(bool)));
addAction(m_textAliginBottom);
-
- if (reportEditor()){
- connect(reportEditor(),SIGNAL(itemPropertyChanged(QString,QString,QVariant,QVariant)),
- this,SLOT(slotPropertyChanged(QString,QString,QVariant,QVariant)));
- }
- if (page()){
- connect(page(),SIGNAL(itemPropertyChanged(QString,QString,QVariant,QVariant)),
- this,SLOT(slotPropertyChanged(QString,QString,QVariant,QVariant)));
- }
setEnabled(false);
}
@@ -157,17 +129,11 @@ void TextAlignmentEditorWidget::slotTextHAttribsChanged(bool)
m_textAliginRight->setChecked(sender()==m_textAliginRight);
m_textAliginJustify->setChecked(sender()==m_textAliginJustify);
- int flag = 0;
- if (sender()==m_textAliginLeft) flag |= Qt::AlignLeft;
- if (sender()==m_textAliginHCenter) flag |= Qt::AlignHCenter;
- if (sender()==m_textAliginRight) flag |= Qt::AlignRight;
- if (sender()==m_textAliginJustify) flag |= Qt::AlignJustify;
-
- if (reportEditor()) reportEditor()->setTextAlign(true,Qt::AlignmentFlag(flag));
- if (page()) {
- //page()->setTextAlign(createAlignment());
- page()->changeSelectedGrpoupTextAlignPropperty(true,Qt::AlignmentFlag(flag));
- }
+ m_flag = 0;
+ if (sender()==m_textAliginLeft) m_flag |= Qt::AlignLeft;
+ if (sender()==m_textAliginHCenter) m_flag |= Qt::AlignHCenter;
+ if (sender()==m_textAliginRight) m_flag |= Qt::AlignRight;
+ if (sender()==m_textAliginJustify) m_flag |= Qt::AlignJustify;
m_textAttibutesIsChanging = false;
}
@@ -180,13 +146,10 @@ void TextAlignmentEditorWidget::slotTextVAttribsChanged(bool)
m_textAliginVCenter->setChecked(sender()==m_textAliginVCenter);
m_textAliginBottom->setChecked(sender()==m_textAliginBottom);
- int flag = 0;
- if (sender()==m_textAliginTop) flag |= Qt::AlignTop;
- if (sender()==m_textAliginVCenter) flag |= Qt::AlignVCenter;
- if (sender()==m_textAliginBottom) flag |= Qt::AlignBottom;
-
- if (reportEditor()) reportEditor()->setTextAlign(false,Qt::AlignmentFlag(flag));
- if (page()) page()->changeSelectedGrpoupTextAlignPropperty(false,Qt::AlignmentFlag(flag) );
+ m_flag = 0;
+ if (sender()==m_textAliginTop) m_flag |= Qt::AlignTop;
+ if (sender()==m_textAliginVCenter) m_flag |= Qt::AlignVCenter;
+ if (sender()==m_textAliginBottom) m_flag |= Qt::AlignBottom;
m_textAttibutesIsChanging = false;
}
@@ -200,5 +163,63 @@ void TextAlignmentEditorWidget::slotPropertyChanged(const QString &objectName, c
}
}
+int TextAlignmentEditorWidget::flag() const
+{
+ return m_flag;
+}
+
+void TextAlignmentEditorWidgetForPage::initEditor()
+{
+ TextAlignmentEditorWidget::initEditor();
+ connect(m_page,SIGNAL(itemPropertyChanged(QString,QString,QVariant,QVariant)),
+ this,SLOT(slotPropertyChanged(QString,QString,QVariant,QVariant)));
+}
+
+void TextAlignmentEditorWidgetForPage::slotTextHAttribsChanged(bool value)
+{
+
+ TextAlignmentEditorWidget::slotTextHAttribsChanged(value);
+ if (m_textAttibutesIsChanging) return;
+ m_textAttibutesIsChanging = true;
+ m_page->changeSelectedGrpoupTextAlignPropperty(true,Qt::AlignmentFlag(flag()));
+ m_textAttibutesIsChanging = false;
+}
+
+void TextAlignmentEditorWidgetForPage::slotTextVAttribsChanged(bool value)
+{
+ TextAlignmentEditorWidget::slotTextVAttribsChanged(value);
+ if (m_textAttibutesIsChanging) return;
+ m_textAttibutesIsChanging = true;
+ m_page->changeSelectedGrpoupTextAlignPropperty(false,Qt::AlignmentFlag(flag()) );
+ m_textAttibutesIsChanging = false;
+}
+
+#ifdef HAVE_REPORT_DESIGNER
+void TextAlignmentEditorWidgetForDesigner::initEditor()
+{
+ TextAlignmentEditorWidget::initEditor();
+ connect(m_reportEditor,SIGNAL(itemPropertyChanged(QString,QString,QVariant,QVariant)),
+ this,SLOT(slotPropertyChanged(QString,QString,QVariant,QVariant)));
+
+}
+
+void TextAlignmentEditorWidgetForDesigner::slotTextHAttribsChanged(bool value)
+{
+ TextAlignmentEditorWidget::slotTextHAttribsChanged(value);
+ if (m_textAttibutesIsChanging) return;
+ m_textAttibutesIsChanging = true;
+ m_reportEditor->setTextAlign(true,Qt::AlignmentFlag(flag()));
+ m_textAttibutesIsChanging = false;
+}
+
+void TextAlignmentEditorWidgetForDesigner::slotTextVAttribsChanged(bool value)
+{
+ TextAlignmentEditorWidget::slotTextVAttribsChanged(value);
+ if (m_textAttibutesIsChanging) return;
+ m_textAttibutesIsChanging = true;
+ m_reportEditor->setTextAlign(false,Qt::AlignmentFlag(flag()));
+ m_textAttibutesIsChanging = false;
+}
+#endif
} //namespace LimeReport
diff --git a/limereport/items/editors/lrtextalignmenteditorwidget.h b/limereport/items/editors/lrtextalignmenteditorwidget.h
index 93fd39d..97f13f5 100644
--- a/limereport/items/editors/lrtextalignmenteditorwidget.h
+++ b/limereport/items/editors/lrtextalignmenteditorwidget.h
@@ -41,23 +41,20 @@ class TextAlignmentEditorWidget:public ItemEditorWidget
{
Q_OBJECT
public:
- explicit TextAlignmentEditorWidget(ReportDesignWidget* reportEditor, const QString &title, QWidget *parent = 0);
- explicit TextAlignmentEditorWidget(ReportDesignWidget* reportEditor, QWidget *parent = 0);
- explicit TextAlignmentEditorWidget(PageDesignIntf* page, const QString &title, QWidget *parent = 0);
- explicit TextAlignmentEditorWidget(PageDesignIntf* page, QWidget *parent = 0);
+ explicit TextAlignmentEditorWidget(const QString &title, QWidget *parent = 0);
+ int flag() const;
protected:
void setItemEvent(BaseDesignIntf *item);
+ virtual void initEditor();
+ bool m_textAttibutesIsChanging;
private:
- void initEditor();
void updateValues(const Qt::Alignment& align);
Qt::Alignment createAlignment();
-private slots:
- void slotTextHAttribsChanged(bool);
- void slotTextVAttribsChanged(bool);
- void slotPropertyChanged(const QString& objectName, const QString& property, const QVariant &oldValue, const QVariant &newValue);
+protected slots:
+ virtual void slotTextHAttribsChanged(bool);
+ virtual void slotTextVAttribsChanged(bool);
+ virtual void slotPropertyChanged(const QString& objectName, const QString& property, const QVariant &oldValue, const QVariant &newValue);
private:
- bool m_textAttibutesIsChanging;
-
QAction* m_textAliginLeft;
QAction* m_textAliginRight;
QAction* m_textAliginHCenter;
@@ -65,9 +62,39 @@ private:
QAction* m_textAliginTop;
QAction* m_textAliginBottom;
QAction* m_textAliginVCenter;
-
+ int m_flag;
};
+class TextAlignmentEditorWidgetForPage: public TextAlignmentEditorWidget{
+ Q_OBJECT
+public:
+ TextAlignmentEditorWidgetForPage(PageDesignIntf* page, const QString &title, QWidget *parent = 0)
+ :TextAlignmentEditorWidget(title, parent), m_page(page){}
+protected:
+ void initEditor();
+protected slots:
+ void slotTextHAttribsChanged(bool value);
+ void slotTextVAttribsChanged(bool value);
+private:
+ PageDesignIntf* m_page;
+};
+
+#ifdef HAVE_REPORT_DESIGNER
+class TextAlignmentEditorWidgetForDesigner: public TextAlignmentEditorWidget{
+ Q_OBJECT
+public:
+ TextAlignmentEditorWidgetForDesigner(ReportDesignWidget* reportEditor, const QString &title, QWidget *parent = 0)
+ :TextAlignmentEditorWidget(title, parent), m_reportEditor(reportEditor){}
+protected:
+ void initEditor();
+protected slots:
+ void slotTextHAttribsChanged(bool value);
+ void slotTextVAttribsChanged(bool value);
+private:
+ ReportDesignWidget* m_reportEditor;
+};
+#endif
+
} //namespace LimeReport
#endif // LRTEXTALIGNMENTEDITORWIDGET_H
diff --git a/limereport/items/lrchartitemeditor.cpp b/limereport/items/lrchartitemeditor.cpp
index 0c54821..f772632 100644
--- a/limereport/items/lrchartitemeditor.cpp
+++ b/limereport/items/lrchartitemeditor.cpp
@@ -41,7 +41,7 @@ QSettings* ChartItemEditor::settings()
if (m_settings){
return m_settings;
} else {
- m_settings = new QSettings("LimeReport",QApplication::applicationName());
+ m_settings = new QSettings("LimeReport",QCoreApplication::applicationName());
m_ownedSettings = true;
return m_settings;
}
diff --git a/limereport/items/lrtextitem.cpp b/limereport/items/lrtextitem.cpp
index b4e43bc..9bd5b0e 100644
--- a/limereport/items/lrtextitem.cpp
+++ b/limereport/items/lrtextitem.cpp
@@ -483,7 +483,6 @@ TextItem::TextPtr TextItem::textDocument() const
QTextOption to;
to.setAlignment(m_alignment);
to.setTextDirection(m_textLayoutDirection);
- //to.setTextDirection(QApplication::layoutDirection());
if (m_autoWidth!=MaxStringLength)
if (m_adaptFontToSize && (!(m_autoHeight || m_autoWidth)))
diff --git a/limereport/items/lrtextitemeditor.cpp b/limereport/items/lrtextitemeditor.cpp
index 37ac44d..8b2e28b 100644
--- a/limereport/items/lrtextitemeditor.cpp
+++ b/limereport/items/lrtextitemeditor.cpp
@@ -76,7 +76,7 @@ QSettings*TextItemEditor::settings()
if (m_settings){
return m_settings;
} else {
- m_settings = new QSettings("LimeReport",QApplication::applicationName());
+ m_settings = new QSettings("LimeReport",QCoreApplication::applicationName());
m_ownedSettings = true;
return m_settings;
}
diff --git a/limereport/limereport.pri b/limereport/limereport.pri
index 385ad4d..92b2ac7 100644
--- a/limereport/limereport.pri
+++ b/limereport/limereport.pri
@@ -1,7 +1,9 @@
include(../common.pri)
-contains(CONFIG,dialogdesigner){
- include($$REPORT_PATH/dialogdesigner/dialogdesigner.pri)
+contains(CONFIG, embedded_designer){
+ contains(CONFIG,dialogdesigner){
+ include($$REPORT_PATH/dialogdesigner/dialogdesigner.pri)
+ }
}
DEFINES += INSPECT_BASEDESIGN
@@ -11,9 +13,11 @@ INCLUDEPATH += \
$$REPORT_PATH/items \
$$REPORT_PATH/bands \
$$REPORT_PATH/base \
- $$REPORT_PATH/objectinspector \
- $$REPORT_PATH/databrowser \
$$REPORT_PATH/scripteditor
+contains(CONFIG, embedded_designer){
+ INCLUDEPATH += $$REPORT_PATH/objectinspector \
+ $$REPORT_PATH/databrowser
+}
SOURCES += \
$$REPORT_PATH/bands/lrpageheader.cpp \
@@ -24,15 +28,56 @@ SOURCES += \
$$REPORT_PATH/bands/lrgroupbands.cpp \
$$REPORT_PATH/bands/lrsubdetailband.cpp \
$$REPORT_PATH/bands/lrtearoffband.cpp \
+ $$REPORT_PATH/serializators/lrxmlqrectserializator.cpp \
+ $$REPORT_PATH/serializators/lrxmlbasetypesserializators.cpp \
+ $$REPORT_PATH/serializators/lrxmlreader.cpp \
+ $$REPORT_PATH/serializators/lrxmlwriter.cpp \
+ $$REPORT_PATH/scripteditor/lrscripteditor.cpp \
+ $$REPORT_PATH/scripteditor/lrcodeeditor.cpp \
+ $$REPORT_PATH/scripteditor/lrscripthighlighter.cpp \
+ $$REPORT_PATH/items/lrhorizontallayout.cpp \
+ $$REPORT_PATH/items/editors/lritemeditorwidget.cpp \
+ $$REPORT_PATH/items/editors/lrfonteditorwidget.cpp \
+ $$REPORT_PATH/items/editors/lrtextalignmenteditorwidget.cpp \
+ $$REPORT_PATH/items/editors/lritemsborderseditorwidget.cpp \
+ $$REPORT_PATH/items/lrsimpletagparser.cpp \
+ $$REPORT_PATH/items/lrimageitem.cpp \
+ $$REPORT_PATH/items/lrtextitemeditor.cpp \
+ $$REPORT_PATH/items/lrshapeitem.cpp \
+ $$REPORT_PATH/items/lrtextitem.cpp \
+ $$REPORT_PATH/lrbanddesignintf.cpp \
+ $$REPORT_PATH/lrpageitemdesignintf.cpp \
+ $$REPORT_PATH/lrpagedesignintf.cpp \
+ $$REPORT_PATH/lrbandsmanager.cpp \
+ $$REPORT_PATH/lrglobal.cpp \
+ $$REPORT_PATH/lritemdesignintf.cpp \
+ $$REPORT_PATH/lrdatadesignintf.cpp \
+ $$REPORT_PATH/lrbasedesignintf.cpp \
+ $$REPORT_PATH/lrreportengine.cpp \
+ $$REPORT_PATH/lrdatasourcemanager.cpp \
+ $$REPORT_PATH/lrreportrender.cpp \
+ $$REPORT_PATH/lrscriptenginemanager.cpp \
+ $$REPORT_PATH/lrpreviewreportwindow.cpp \
+ $$REPORT_PATH/lrpreviewreportwidget.cpp \
+ $$REPORT_PATH/lrgraphicsviewzoom.cpp \
+ $$REPORT_PATH/lrvariablesholder.cpp \
+ $$REPORT_PATH/lrgroupfunctions.cpp \
+ $$REPORT_PATH/lrsimplecrypt.cpp \
+ $$REPORT_PATH/lraboutdialog.cpp \
+ $$REPORT_PATH/lrsettingdialog.cpp \
+ $$REPORT_PATH/lritemscontainerdesignitf.cpp \
+ $$REPORT_PATH/lrcolorindicator.cpp \
+ $$REPORT_PATH/items/lrchartitem.cpp \
+ $$REPORT_PATH/items/lrchartitemeditor.cpp \
+ $$REPORT_PATH/lrreporttranslation.cpp
+
+contains(CONFIG, embedded_designer){
+SOURCES += \
$$REPORT_PATH/databrowser/lrdatabrowser.cpp \
$$REPORT_PATH/databrowser/lrsqleditdialog.cpp \
$$REPORT_PATH/databrowser/lrconnectiondialog.cpp \
$$REPORT_PATH/databrowser/lrvariabledialog.cpp \
$$REPORT_PATH/databrowser/lrdatabrowsertree.cpp \
- $$REPORT_PATH/serializators/lrxmlqrectserializator.cpp \
- $$REPORT_PATH/serializators/lrxmlbasetypesserializators.cpp \
- $$REPORT_PATH/serializators/lrxmlreader.cpp \
- $$REPORT_PATH/serializators/lrxmlwriter.cpp \
$$REPORT_PATH/objectinspector/propertyItems/lrstringpropitem.cpp \
$$REPORT_PATH/objectinspector/propertyItems/lrrectproptem.cpp \
$$REPORT_PATH/objectinspector/propertyItems/lrintpropitem.cpp \
@@ -58,54 +103,17 @@ SOURCES += \
$$REPORT_PATH/objectinspector/lrobjectitemmodel.cpp \
$$REPORT_PATH/objectinspector/lrobjectpropitem.cpp \
$$REPORT_PATH/objectinspector/lrpropertydelegate.cpp \
- $$REPORT_PATH/objectsbrowser/lrobjectbrowser.cpp \
+ $$REPORT_PATH/objectsbrowser/lrobjectbrowser.cpp \
$$REPORT_PATH/scriptbrowser/lrscriptbrowser.cpp \
- $$REPORT_PATH/scripteditor/lrscripteditor.cpp \
- $$REPORT_PATH/scripteditor/lrcodeeditor.cpp \
- $$REPORT_PATH/scripteditor/lrscripthighlighter.cpp \
$$REPORT_PATH/items/lrsubitemparentpropitem.cpp \
$$REPORT_PATH/items/lralignpropitem.cpp \
- $$REPORT_PATH/items/lrhorizontallayout.cpp \
- $$REPORT_PATH/items/editors/lritemeditorwidget.cpp \
- $$REPORT_PATH/items/editors/lrfonteditorwidget.cpp \
- $$REPORT_PATH/items/editors/lrtextalignmenteditorwidget.cpp \
$$REPORT_PATH/items/editors/lritemsaligneditorwidget.cpp \
- $$REPORT_PATH/items/editors/lritemsborderseditorwidget.cpp \
- $$REPORT_PATH/items/lrsimpletagparser.cpp \
- $$REPORT_PATH/items/lrimageitem.cpp \
- $$REPORT_PATH/items/lrtextitemeditor.cpp \
- $$REPORT_PATH/items/lrshapeitem.cpp \
- $$REPORT_PATH/items/lrtextitem.cpp \
$$REPORT_PATH/translationeditor/translationeditor.cpp \
- $$REPORT_PATH/lrbanddesignintf.cpp \
- $$REPORT_PATH/lrpageitemdesignintf.cpp \
- $$REPORT_PATH/lrpagedesignintf.cpp \
- $$REPORT_PATH/lrbandsmanager.cpp \
- $$REPORT_PATH/lrglobal.cpp \
- $$REPORT_PATH/lritemdesignintf.cpp \
- $$REPORT_PATH/lrdatadesignintf.cpp \
+ $$REPORT_PATH/translationeditor/languageselectdialog.cpp \
$$REPORT_PATH/lrreportdesignwidget.cpp \
- $$REPORT_PATH/lrbasedesignintf.cpp \
- $$REPORT_PATH/lrreportengine.cpp \
- $$REPORT_PATH/lrdatasourcemanager.cpp \
- $$REPORT_PATH/lrreportdesignwindow.cpp \
- $$REPORT_PATH/lrreportrender.cpp \
- $$REPORT_PATH/lrscriptenginemanager.cpp \
- $$REPORT_PATH/lrpreviewreportwindow.cpp \
- $$REPORT_PATH/lrpreviewreportwidget.cpp \
- $$REPORT_PATH/lrgraphicsviewzoom.cpp \
- $$REPORT_PATH/lrvariablesholder.cpp \
- $$REPORT_PATH/lrgroupfunctions.cpp \
- $$REPORT_PATH/lrsimplecrypt.cpp \
- $$REPORT_PATH/lraboutdialog.cpp \
- $$REPORT_PATH/lrsettingdialog.cpp \
- $$REPORT_PATH/lritemscontainerdesignitf.cpp \
- $$REPORT_PATH/lrcolorindicator.cpp \
- $$REPORT_PATH/items/lrchartitem.cpp \
- $$REPORT_PATH/items/lrchartitemeditor.cpp \
- $$REPORT_PATH/lrreporttranslation.cpp \
- $$REPORT_PATH/translationeditor/languageselectdialog.cpp
-
+ $$REPORT_PATH/lrreportdesignwindow.cpp
+}
+
contains(CONFIG, staticlib){
SOURCES += $$REPORT_PATH/lrfactoryinitializer.cpp
}
@@ -126,11 +134,6 @@ HEADERS += \
$$REPORT_PATH/bands/lrtearoffband.h \
$$REPORT_PATH/bands/lrsubdetailband.h \
$$REPORT_PATH/bands/lrgroupbands.h \
- $$REPORT_PATH/databrowser/lrdatabrowser.h \
- $$REPORT_PATH/databrowser/lrsqleditdialog.h \
- $$REPORT_PATH/databrowser/lrconnectiondialog.h \
- $$REPORT_PATH/databrowser/lrvariabledialog.h \
- $$REPORT_PATH/databrowser/lrdatabrowsertree.h \
$$REPORT_PATH/serializators/lrserializatorintf.h \
$$REPORT_PATH/serializators/lrstorageintf.h \
$$REPORT_PATH/serializators/lrxmlqrectserializator.h \
@@ -138,6 +141,62 @@ HEADERS += \
$$REPORT_PATH/serializators/lrxmlbasetypesserializators.h \
$$REPORT_PATH/serializators/lrxmlreader.h \
$$REPORT_PATH/serializators/lrxmlwriter.h \
+ $$REPORT_PATH/scripteditor/lrscripteditor.h \
+ $$REPORT_PATH/scripteditor/lrcodeeditor.h \
+ $$REPORT_PATH/scripteditor/lrscripthighlighter.h \
+ $$REPORT_PATH/items/editors/lritemeditorwidget.h \
+ $$REPORT_PATH/items/editors/lrfonteditorwidget.h \
+ $$REPORT_PATH/items/lrtextitem.h \
+ $$REPORT_PATH/items/lrhorizontallayout.h \
+ $$REPORT_PATH/items/lrtextitemeditor.h \
+ $$REPORT_PATH/items/lrshapeitem.h \
+ $$REPORT_PATH/items/lrimageitem.h \
+ $$REPORT_PATH/items/lrsimpletagparser.h \
+ $$REPORT_PATH/lrbanddesignintf.h \
+ $$REPORT_PATH/lrpageitemdesignintf.h \
+ $$REPORT_PATH/lrbandsmanager.h \
+ $$REPORT_PATH/lrglobal.h \
+ $$REPORT_PATH/lrdatadesignintf.h \
+ $$REPORT_PATH/lrcollection.h \
+ $$REPORT_PATH/lrpagedesignintf.h \
+ $$REPORT_PATH/lrreportengine_p.h \
+ $$REPORT_PATH/lrdatasourcemanager.h \
+ $$REPORT_PATH/lrreportrender.h \
+ $$REPORT_PATH/lrpreviewreportwindow.h \
+ $$REPORT_PATH/lrpreviewreportwidget.h \
+ $$REPORT_PATH/lrpreviewreportwidget_p.h \
+ $$REPORT_PATH/lrgraphicsviewzoom.h \
+ $$REPORT_PATH/lrbasedesignintf.h \
+ $$REPORT_PATH/lritemdesignintf.h \
+ $$REPORT_PATH/lrdesignelementsfactory.h \
+ $$REPORT_PATH/lrscriptenginemanager.h \
+ $$REPORT_PATH/lrvariablesholder.h \
+ $$REPORT_PATH/lrgroupfunctions.h \
+ $$REPORT_PATH/lrreportengine.h \
+ $$REPORT_PATH/lrdatasourcemanagerintf.h \
+ $$REPORT_PATH/lrscriptenginemanagerintf.h \
+ $$REPORT_PATH/lrsimplecrypt.h \
+ $$REPORT_PATH/lraboutdialog.h \
+ $$REPORT_PATH/lrcallbackdatasourceintf.h \
+ $$REPORT_PATH/lrsettingdialog.h \
+ $$REPORT_PATH/lrpreviewreportwidget_p.h \
+ $$REPORT_PATH/lritemscontainerdesignitf.h \
+ $$REPORT_PATH/lrcolorindicator.h \
+ $$REPORT_PATH/items/lrchartitem.h \
+ $$REPORT_PATH/items/lrchartitemeditor.h \
+ $$REPORT_PATH/items/editors/lrtextalignmenteditorwidget.h \
+ $$REPORT_PATH/items/editors/lritemsborderseditorwidget.h \
+ $$REPORT_PATH/lrreporttranslation.h \
+ $$REPORT_PATH/lrreportdesignwindowintrerface.h
+
+contains(CONFIG, embedded_designer){
+HEADERS += \
+ $$REPORT_PATH/databrowser/lrdatabrowser.h \
+ $$REPORT_PATH/databrowser/lrsqleditdialog.h \
+ $$REPORT_PATH/databrowser/lrconnectiondialog.h \
+ $$REPORT_PATH/databrowser/lrvariabledialog.h \
+ $$REPORT_PATH/databrowser/lrdatabrowsertree.h \
+ $$REPORT_PATH/scriptbrowser/lrscriptbrowser.h \
$$REPORT_PATH/objectinspector/propertyItems/lrstringpropitem.h \
$$REPORT_PATH/objectinspector/propertyItems/lrrectproptem.h \
$$REPORT_PATH/objectinspector/propertyItems/lrdatasourcepropitem.h \
@@ -164,62 +223,15 @@ HEADERS += \
$$REPORT_PATH/objectinspector/lrobjectpropitem.h \
$$REPORT_PATH/objectinspector/lrpropertydelegate.h \
$$REPORT_PATH/objectsbrowser/lrobjectbrowser.h \
- $$REPORT_PATH/scriptbrowser/lrscriptbrowser.h \
- $$REPORT_PATH/scripteditor/lrscripteditor.h \
- $$REPORT_PATH/scripteditor/lrcodeeditor.h \
- $$REPORT_PATH/scripteditor/lrscripthighlighter.h \
- $$REPORT_PATH/items/editors/lritemeditorwidget.h \
- $$REPORT_PATH/items/editors/lrfonteditorwidget.h \
- $$REPORT_PATH/items/editors/lrtextalignmenteditorwidget.h \
+ $$REPORT_PATH/translationeditor/translationeditor.h \
+ $$REPORT_PATH/translationeditor/languageselectdialog.h \
$$REPORT_PATH/items/editors/lritemsaligneditorwidget.h \
- $$REPORT_PATH/items/editors/lritemsborderseditorwidget.h \
- $$REPORT_PATH/items/lrtextitem.h \
$$REPORT_PATH/items/lrsubitemparentpropitem.h \
$$REPORT_PATH/items/lralignpropitem.h \
- $$REPORT_PATH/items/lrhorizontallayout.h \
- $$REPORT_PATH/items/lrtextitemeditor.h \
- $$REPORT_PATH/items/lrshapeitem.h \
- $$REPORT_PATH/items/lrimageitem.h \
- $$REPORT_PATH/items/lrsimpletagparser.h \
- $$REPORT_PATH/translationeditor/translationeditor.h \
- $$REPORT_PATH/lrfactoryinitializer.h \
- $$REPORT_PATH/lrbanddesignintf.h \
- $$REPORT_PATH/lrpageitemdesignintf.h \
- $$REPORT_PATH/lrbandsmanager.h \
- $$REPORT_PATH/lrglobal.h \
- $$REPORT_PATH/lrdatadesignintf.h \
- $$REPORT_PATH/lrcollection.h \
- $$REPORT_PATH/lrpagedesignintf.h \
$$REPORT_PATH/lrreportdesignwidget.h \
- $$REPORT_PATH/lrreportengine_p.h \
- $$REPORT_PATH/lrdatasourcemanager.h \
- $$REPORT_PATH/lrreportdesignwindow.h \
- $$REPORT_PATH/lrreportrender.h \
- $$REPORT_PATH/lrpreviewreportwindow.h \
- $$REPORT_PATH/lrpreviewreportwidget.h \
- $$REPORT_PATH/lrpreviewreportwidget_p.h \
- $$REPORT_PATH/lrgraphicsviewzoom.h \
- $$REPORT_PATH/lrbasedesignintf.h \
- $$REPORT_PATH/lritemdesignintf.h \
- $$REPORT_PATH/lrdesignelementsfactory.h \
- $$REPORT_PATH/lrscriptenginemanager.h \
- $$REPORT_PATH/lrvariablesholder.h \
- $$REPORT_PATH/lrgroupfunctions.h \
- $$REPORT_PATH/lrreportengine.h \
- $$REPORT_PATH/lrdatasourcemanagerintf.h \
- $$REPORT_PATH/lrscriptenginemanagerintf.h \
- $$REPORT_PATH/lrsimplecrypt.h \
- $$REPORT_PATH/lraboutdialog.h \
- $$REPORT_PATH/lrcallbackdatasourceintf.h \
- $$REPORT_PATH/lrsettingdialog.h \
- $$REPORT_PATH/lrpreviewreportwidget_p.h \
- $$REPORT_PATH/lritemscontainerdesignitf.h \
- $$REPORT_PATH/lrcolorindicator.h \
- $$REPORT_PATH/items/lrchartitem.h \
- $$REPORT_PATH/items/lrchartitemeditor.h \
- $$REPORT_PATH/lrreporttranslation.h \
- $$REPORT_PATH/translationeditor/languageselectdialog.h
-
+ $$REPORT_PATH/lrreportdesignwindow.h
+}
+
contains(CONFIG, staticlib){
HEADERS += $$REPORT_PATH/lrfactoryinitializer.h
}
@@ -229,26 +241,32 @@ contains(CONFIG,zint){
}
FORMS += \
- $$REPORT_PATH/databrowser/lrsqleditdialog.ui \
- $$REPORT_PATH/databrowser/lrconnectiondialog.ui \
- $$REPORT_PATH/databrowser/lrdatabrowser.ui \
- $$REPORT_PATH/databrowser/lrvariabledialog.ui \
- $$REPORT_PATH/objectinspector/editors/ltextitempropertyeditor.ui \
$$REPORT_PATH/lrpreviewreportwindow.ui \
$$REPORT_PATH/lrpreviewreportwidget.ui \
$$REPORT_PATH/items/lrtextitemeditor.ui \
$$REPORT_PATH/lraboutdialog.ui \
$$REPORT_PATH/lrsettingdialog.ui \
- $$REPORT_PATH/scriptbrowser/lrscriptbrowser.ui \
$$REPORT_PATH/items/lrchartitemeditor.ui \
- $$REPORT_PATH/translationeditor/translationeditor.ui \
- $$REPORT_PATH/translationeditor/languageselectdialog.ui \
$$REPORT_PATH/scripteditor/lrscripteditor.ui
+contains(CONFIG, embedded_designer){
+FORMS += \
+ $$REPORT_PATH/databrowser/lrsqleditdialog.ui \
+ $$REPORT_PATH/databrowser/lrconnectiondialog.ui \
+ $$REPORT_PATH/databrowser/lrdatabrowser.ui \
+ $$REPORT_PATH/databrowser/lrvariabledialog.ui \
+ $$REPORT_PATH/objectinspector/editors/ltextitempropertyeditor.ui \
+ $$REPORT_PATH/scriptbrowser/lrscriptbrowser.ui \
+ $$REPORT_PATH/translationeditor/translationeditor.ui \
+ $$REPORT_PATH/translationeditor/languageselectdialog.ui
+}
+RESOURCES += \
+ $$REPORT_PATH/report.qrc \
+ $$REPORT_PATH/items/items.qrc
+contains(CONFIG, embedded_designer){
RESOURCES += \
$$REPORT_PATH/objectinspector/lobjectinspector.qrc \
$$REPORT_PATH/databrowser/lrdatabrowser.qrc \
- $$REPORT_PATH/report.qrc \
- $$REPORT_PATH/items/items.qrc \
$$REPORT_PATH/scriptbrowser/lrscriptbrowser.qrc \
$$REPORT_PATH/translationeditor/translationeditor.qrc
+}
diff --git a/limereport/limereport.pro b/limereport/limereport.pro
index 591db80..e97c92b 100644
--- a/limereport/limereport.pro
+++ b/limereport/limereport.pro
@@ -28,7 +28,7 @@ DEFINES += LIMEREPORT_EXPORTS
contains(CONFIG, staticlib){
DEFINES += HAVE_STATIC_BUILD
- message(STATIC_BUILD)
+ message(Static Build)
DEFINES -= LIMEREPORT_EXPORTS
}
@@ -39,7 +39,8 @@ EXTRA_FILES += \
$$PWD/lrreportengine.h \
$$PWD/lrscriptenginemanagerintf.h \
$$PWD/lrcallbackdatasourceintf.h \
- $$PWD/lrpreviewreportwidget.h
+ $$PWD/lrpreviewreportwidget.h \
+ $$PWD/lrreportdesignwindowintrerface.h
include(limereport.pri)
diff --git a/limereport/lrbasedesignintf.cpp b/limereport/lrbasedesignintf.cpp
index 2088387..0b41b05 100644
--- a/limereport/lrbasedesignintf.cpp
+++ b/limereport/lrbasedesignintf.cpp
@@ -365,11 +365,9 @@ void BaseDesignIntf::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
if (event->button() == Qt::LeftButton) {
m_resizeDirectionFlags = resizeDirectionFlags(event->pos());
- //m_startScenePos = event->scenePos();
m_startPos = pos();
m_oldGeometry = geometry();
QGraphicsItem::mousePressEvent(event);
- //QApplication::processEvents();
emit(itemSelected(this));
}
else QGraphicsItem::mousePressEvent(event);
@@ -1141,8 +1139,16 @@ void BaseDesignIntf::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
}
}
+QWidget* findRootWidget(QWidget* widget){
+ while (widget->parentWidget()) {
+ widget = widget->parentWidget();
+ }
+ return widget;
+}
+
void BaseDesignIntf::showEditorDialog(){
- QWidget *editor = defaultEditor();
+ QWidget *editor = defaultEditor();
+ editor->setStyleSheet(findRootWidget(scene()->views().at(0))->styleSheet());
if (editor) {
#ifdef Q_OS_WIN
diff --git a/limereport/lrdatasourcemanager.cpp b/limereport/lrdatasourcemanager.cpp
index 786ef14..6890b3e 100644
--- a/limereport/lrdatasourcemanager.cpp
+++ b/limereport/lrdatasourcemanager.cpp
@@ -1503,7 +1503,7 @@ VariableDataType DataSourceManager::variableDataType(const QString& name)
{
if (m_reportVariables.containsVariable(name))
return m_reportVariables.variableByName(name)->dataType();
- return VariableDataType::Undefined;
+ return Enums::Undefined;
}
void DataSourceManager::setVariableDataType(const QString& name, VariableDataType value)
diff --git a/limereport/lrdesignelementsfactory.h b/limereport/lrdesignelementsfactory.h
index 3afc554..9a647a2 100644
--- a/limereport/lrdesignelementsfactory.h
+++ b/limereport/lrdesignelementsfactory.h
@@ -31,7 +31,7 @@
#define LRDESIGNELEMENTSFACTORY_H
#include "lrbanddesignintf.h"
-#include "lrpageheader.h"
+//#include "lrpageheader.h"
#include "lrattribsabstractfactory.h"
#include "lrsimpleabstractfactory.h"
#include "lrsingleton.h"
diff --git a/limereport/lrdesignerplugininterface.h b/limereport/lrdesignerplugininterface.h
new file mode 100644
index 0000000..1587c39
--- /dev/null
+++ b/limereport/lrdesignerplugininterface.h
@@ -0,0 +1,28 @@
+#ifndef LRDESIGNERPLUGININTERFACE_H
+#define LRDESIGNERPLUGININTERFACE_H
+
+#include
+#include
+
+#include
+#include "lrreportdesignwindowintrerface.h"
+
+QT_BEGIN_NAMESPACE
+class QSettings;
+class QMainWindow;
+QT_END_NAMESPACE
+
+namespace LimeReport {
+ class ReportDesignWindow;
+ class ReportEnginePrivateInterface;
+}
+
+class LimeReportPluginInterface {
+public:
+ virtual ~LimeReportPluginInterface() { }
+ virtual LimeReport::ReportDesignWindowInterface* getDesignerWindow(LimeReport::ReportEnginePrivateInterface* report, QWidget *parent = 0, QSettings* settings=0) = 0;
+};
+
+Q_DECLARE_INTERFACE( LimeReportPluginInterface, "ru.limereport.LimeReport.DesignerPluginInterface/1.0" )
+
+#endif // LRDESIGNERPLUGININTERFACE_H
diff --git a/limereport/lrfactoryinitializer.cpp b/limereport/lrfactoryinitializer.cpp
index 5aef43a..ef5eb18 100644
--- a/limereport/lrfactoryinitializer.cpp
+++ b/limereport/lrfactoryinitializer.cpp
@@ -15,9 +15,10 @@
#include "items/lrhorizontallayout.h"
#include "items/lrimageitem.h"
#include "items/lrshapeitem.h"
+#include "items/lrchartitem.h"
#include "lrdesignelementsfactory.h"
-
+#ifdef HAVE_REPORT_DESIGNER
#include "objectinspector/lrobjectpropitem.h"
#include "objectinspector/propertyItems/lrboolpropitem.h"
#include "objectinspector/propertyItems/lrcolorpropitem.h"
@@ -34,6 +35,7 @@
#include "objectinspector/propertyItems/lrstringpropitem.h"
#include "items/lralignpropitem.h"
#include "items/lrsubitemparentpropitem.h"
+#endif
#include "serializators/lrxmlbasetypesserializators.h"
#include "serializators/lrxmlqrectserializator.h"
@@ -41,10 +43,13 @@
void initResources(){
Q_INIT_RESOURCE(report);
+#ifdef HAVE_REPORT_DESIGNER
Q_INIT_RESOURCE(lobjectinspector);
Q_INIT_RESOURCE(lrdatabrowser);
Q_INIT_RESOURCE(items);
Q_INIT_RESOURCE(lrscriptbrowser);
+ Q_INIT_RESOURCE(translationeditor);
+#endif
}
namespace LimeReport{
@@ -106,14 +111,18 @@ BaseDesignIntf* createHLayout(QObject *owner, LimeReport::BaseDesignIntf *paren
return new HorizontalLayout(owner, parent);
}
-BaseDesignIntf * createImageItem(QObject* owner, LimeReport::BaseDesignIntf* parent){
+BaseDesignIntf* createImageItem(QObject* owner, LimeReport::BaseDesignIntf* parent){
return new ImageItem(owner,parent);
}
-BaseDesignIntf * createShapeItem(QObject* owner, LimeReport::BaseDesignIntf* parent){
+BaseDesignIntf* createShapeItem(QObject* owner, LimeReport::BaseDesignIntf* parent){
return new ShapeItem(owner,parent);
}
+BaseDesignIntf* createChartItem(QObject* owner, LimeReport::BaseDesignIntf* parent){
+ return new ChartItem(owner,parent);
+}
+
void initReportItems(){
initResources();
DesignElementsFactory::instance().registerCreator(
@@ -139,6 +148,9 @@ void initReportItems(){
DesignElementsFactory::instance().registerCreator(
"ShapeItem", LimeReport::ItemAttribs(QObject::tr("Shape Item"),"Item"), createShapeItem
);
+ DesignElementsFactory::instance().registerCreator(
+ "ChartItem", LimeReport::ItemAttribs(QObject::tr("Chart Item"),"Item"), createChartItem
+ );
DesignElementsFactory::instance().registerCreator(
"Data",
LimeReport::ItemAttribs(QObject::tr("Data"),LimeReport::Const::bandTAG),
@@ -198,6 +210,8 @@ void initReportItems(){
}
+#ifdef HAVE_REPORT_DESIGNER
+
ObjectPropItem * createBoolPropItem(
QObject *object, LimeReport::ObjectPropItem::ObjectsList* objects, const QString& name, const QString& displayName, const QVariant& data, LimeReport::ObjectPropItem* parent, bool readonly)
{
@@ -360,7 +374,7 @@ void initObjectInspectorProperties()
);
}
-
+#endif
SerializatorIntf * createIntSerializator(QDomDocument *doc, QDomElement *node){
return new LimeReport::XmlIntSerializator(doc,node);
}
diff --git a/limereport/lrglobal.h b/limereport/lrglobal.h
index 74eeb00..13d8851 100644
--- a/limereport/lrglobal.h
+++ b/limereport/lrglobal.h
@@ -161,6 +161,7 @@ namespace Const{
Enums(){}
Q_GADGET
};
+
typedef Enums::VariableDataType VariableDataType;
} // namespace LimeReport
diff --git a/limereport/lrpreviewreportwindow.cpp b/limereport/lrpreviewreportwindow.cpp
index 49a3e89..02dd372 100644
--- a/limereport/lrpreviewreportwindow.cpp
+++ b/limereport/lrpreviewreportwindow.cpp
@@ -66,10 +66,10 @@ PreviewReportWindow::PreviewReportWindow(ReportEngine *report, QWidget *parent,
connect(m_previewReportWidget->d_ptr->m_previewPage,SIGNAL(selectionChanged()),this,SLOT(slotSelectionChanged()));
connect(m_pagesNavigator,SIGNAL(valueChanged(int)),this,SLOT(slotPageNavigatorChanged(int)));
- m_fontEditor = new FontEditorWidget(m_previewReportWidget->d_ptr->m_previewPage,tr("Font"),this);
+ m_fontEditor = new FontEditorWidgetForPage(m_previewReportWidget->d_ptr->m_previewPage,tr("Font"),this);
m_fontEditor->setObjectName("fontTools");
m_fontEditor->setIconSize(ui->toolBar->iconSize());
- m_textAlignmentEditor = new TextAlignmentEditorWidget(m_previewReportWidget->d_ptr->m_previewPage,tr("Text align"),this);
+ m_textAlignmentEditor = new TextAlignmentEditorWidgetForPage(m_previewReportWidget->d_ptr->m_previewPage,tr("Text align"),this);
m_textAlignmentEditor->setObjectName("textAlignmentTools");
m_textAlignmentEditor->setIconSize(ui->toolBar->iconSize());
addToolBar(Qt::TopToolBarArea,m_fontEditor);
@@ -183,7 +183,7 @@ QSettings*PreviewReportWindow::settings()
if (m_settings){
return m_settings;
} else {
- m_settings = new QSettings("LimeReport",QApplication::applicationName());
+ m_settings = new QSettings("LimeReport",QCoreApplication::applicationName());
m_ownedSettings = true;
return m_settings;
}
diff --git a/limereport/lrreportdesignwidget.cpp b/limereport/lrreportdesignwidget.cpp
index ff342b3..b336429 100644
--- a/limereport/lrreportdesignwidget.cpp
+++ b/limereport/lrreportdesignwidget.cpp
@@ -51,12 +51,12 @@ namespace LimeReport {
// ReportDesignIntf
-ReportDesignWidget::ReportDesignWidget(ReportEngine *report, QMainWindow *mainWindow, QWidget *parent) :
+ReportDesignWidget::ReportDesignWidget(ReportEnginePrivateInterface* report, QMainWindow *mainWindow, QWidget *parent) :
QWidget(parent),
#ifdef HAVE_QTDESIGNER_INTEGRATION
m_dialogDesignerManager(new DialogDesignerManager(this)),
#endif
- m_mainWindow(mainWindow), m_verticalGridStep(10), m_horizontalGridStep(10), m_useGrid(false), m_dialogChanged(false)
+ m_mainWindow(mainWindow), m_verticalGridStep(10), m_horizontalGridStep(10), m_useGrid(false), m_dialogChanged(false), m_useDarkTheme(false)
{
#ifdef HAVE_QT4
m_tabWidget = new LimeReportTabWidget(this);
@@ -72,20 +72,20 @@ ReportDesignWidget::ReportDesignWidget(ReportEngine *report, QMainWindow *mainWi
mainLayout->addWidget(m_tabWidget);
setLayout(mainLayout);
- if (!report) {
- m_report=new ReportEnginePrivate(this);
- m_report->setObjectName("report");
- m_report->appendPage("page1");
- }
- else {
- m_report=report->d_ptr;
+// if (!report) {
+// m_report=new ReportEnginePrivate(this);
+// m_report->setObjectName("report");
+// m_report->appendPage("page1");
+// }
+// else {
+ m_report=report;//report->d_ptr;
if (!m_report->pageCount()) m_report->appendPage("page1");
- }
+// }
createTabs();
- connect(m_report,SIGNAL(pagesLoadFinished()),this,SLOT(slotPagesLoadFinished()));
- connect(m_report,SIGNAL(cleared()),this,SIGNAL(cleared()));
+ connect(dynamic_cast(m_report), SIGNAL(pagesLoadFinished()),this,SLOT(slotPagesLoadFinished()));
+ connect(dynamic_cast(m_report), SIGNAL(cleared()),this,SIGNAL(cleared()));
connect(m_tabWidget, SIGNAL(currentChanged(int)), this, SLOT(slotCurrentTabChanged(int)));
#ifdef HAVE_UI_LOADER
connect(m_report->scriptContext(), SIGNAL(dialogDeleted(QString)), this, SLOT(slotDialogDeleted(QString)));
@@ -189,6 +189,7 @@ void ReportDesignWidget::saveState(QSettings* settings)
settings->setValue("vGridStep",m_verticalGridStep);
settings->setValue("defaultFont",m_defaultFont);
settings->setValue("useGrid",m_useGrid);
+ settings->setValue("useDarkTheme",m_useDarkTheme);
settings->setValue("ScriptEditorState", m_scriptEditor->saveState());
settings->endGroup();
}
@@ -199,6 +200,13 @@ void ReportDesignWidget::applySettings()
m_report->pageAt(i)->pageItem()->setFont(m_defaultFont);
}
applyUseGrid();
+ if (m_useDarkTheme) {
+ QFile theme(":/qdarkstyle/style.qss");
+ theme.open(QIODevice::ReadOnly);
+ QString styleSheet = theme.readAll();
+ parentWidget()->setStyleSheet(styleSheet);
+ m_report->setStyleSheet(styleSheet);
+ } else parentWidget()->setStyleSheet("");
}
void ReportDesignWidget::loadState(QSettings* settings)
@@ -223,6 +231,11 @@ void ReportDesignWidget::loadState(QSettings* settings)
m_useGrid = v.toBool();
}
+ v = settings->value("useDarkTheme");
+ if (v.isValid()){
+ m_useDarkTheme = v.toBool();
+ }
+
v = settings->value("ScriptEditorState");
if (v.isValid()){
m_scriptEditor->restoreState(v.toByteArray());
@@ -241,9 +254,11 @@ void ReportDesignWidget::createTabs(){
view->setFrameShape(QFrame::NoFrame);
view->setScene(m_report->pageAt(i));
- foreach(QGraphicsItem* item, m_report->pageAt(i)->selectedItems()){
- item->setSelected(false);
- }
+// foreach(QGraphicsItem* item, m_report->pageAt(i)->selectedItems()){
+// item->setSelected(false);
+// }
+
+ m_report->pageAt(i)->clearSelection();
view->centerOn(0,0);
view->scale(0.5,0.5);
@@ -363,12 +378,10 @@ void ReportDesignWidget::startEditMode()
PageDesignIntf * ReportDesignWidget::activePage()
{
if (activeView())
- return qobject_cast(activeView()->scene());
+ return dynamic_cast(activeView()->scene());
return 0;
}
-
-
QList ReportDesignWidget::selectedItems(){
return activePage()->selectedItems();
}
@@ -695,11 +708,13 @@ void ReportDesignWidget::editSetting()
setting.setHorizontalGridStep(m_horizontalGridStep);
setting.setDefaultFont(m_defaultFont);
setting.setSuppressAbsentFieldsAndVarsWarnings(m_report->suppressFieldAndVarError());
+ setting.setUseDarkTheme(m_useDarkTheme);
if (setting.exec()){
m_horizontalGridStep = setting.horizontalGridStep();
m_verticalGridStep = setting.verticalGridStep();
m_defaultFont = setting.defaultFont();
+ m_useDarkTheme = setting.userDarkTheme();
m_report->setSuppressFieldAndVarError(setting.suppressAbsentFieldsAndVarsWarnings());
applySettings();
}
@@ -796,7 +811,8 @@ void ReportDesignWidget::slotCurrentTabChanged(int index)
QGraphicsView* view = dynamic_cast(m_tabWidget->widget(index));
if (view) {
if (view->scene()){
- foreach (QGraphicsItem* item, view->scene()->selectedItems()) item->setSelected(false);
+ //foreach (QGraphicsItem* item, view->scene()->selectedItems()) item->setSelected(false);
+ view->scene()->clearSelection();
}
m_zoomer->setView(view);
}
@@ -807,7 +823,7 @@ void ReportDesignWidget::slotCurrentTabChanged(int index)
updateDialogs();
#endif
if (activeTabType() == Translations){
- m_traslationEditor->setReportEngine(report());
+ m_traslationEditor->setReportEngine(dynamic_cast(report()));
}
if (activeTabType() == Script){
@@ -816,6 +832,8 @@ void ReportDesignWidget::slotCurrentTabChanged(int index)
}
emit activePageChanged();
+
+ if (view) view->centerOn(0,0);
}
#ifdef HAVE_QTDESIGNER_INTEGRATION
diff --git a/limereport/lrreportdesignwidget.h b/limereport/lrreportdesignwidget.h
index 81c13fd..2887621 100644
--- a/limereport/lrreportdesignwidget.h
+++ b/limereport/lrreportdesignwidget.h
@@ -84,7 +84,7 @@ public:
Translations,
TabTypeCount
};
- ReportDesignWidget(ReportEngine* report, QMainWindow *mainWindow, QWidget *parent = 0);
+ ReportDesignWidget(ReportEnginePrivateInterface* report, QMainWindow *mainWindow, QWidget *parent = 0);
~ReportDesignWidget();
void createStartPage();
void clear();
@@ -105,7 +105,7 @@ public:
QList selectedItems();
QStringList datasourcesNames();
void scale( qreal sx, qreal sy);
- ReportEnginePrivate* report(){return m_report;}
+ ReportEnginePrivateInterface* report(){return m_report;}
QString reportFileName();
bool isNeedToSave();
bool emitLoadReport();
@@ -199,8 +199,9 @@ protected:
#endif
private:
bool eventFilter(QObject *target, QEvent *event);
+ void prepareReport();
private:
- ReportEnginePrivate* m_report;
+ ReportEnginePrivateInterface* m_report;
QGraphicsView *m_view;
ScriptEditor* m_scriptEditor;
TranslationEditor* m_traslationEditor;
@@ -221,7 +222,7 @@ private:
bool m_useGrid;
bool m_useMagnet;
bool m_dialogChanged;
- void prepareReport();
+ bool m_useDarkTheme;
};
} // namespace LimeReport
diff --git a/limereport/lrreportdesignwindow.cpp b/limereport/lrreportdesignwindow.cpp
index fc611e3..98ad4b9 100644
--- a/limereport/lrreportdesignwindow.cpp
+++ b/limereport/lrreportdesignwindow.cpp
@@ -62,8 +62,8 @@ namespace LimeReport{
ReportDesignWindow* ReportDesignWindow::m_instance=0;
-ReportDesignWindow::ReportDesignWindow(ReportEngine *report, QWidget *parent, QSettings* settings) :
- QMainWindow(parent), m_textAttibutesIsChanging(false), m_settings(settings), m_ownedSettings(false),
+ReportDesignWindow::ReportDesignWindow(ReportEnginePrivateInterface* report, QWidget *parent, QSettings* settings) :
+ ReportDesignWindowInterface(parent), m_textAttibutesIsChanging(false), m_settings(settings), m_ownedSettings(false),
m_progressDialog(0), m_showProgressDialog(true), m_editorTabType(ReportDesignWidget::Page), m_reportItemIsLocked(false)
{
initReportEditor(report);
@@ -309,11 +309,11 @@ void ReportDesignWindow::createToolBars()
//m_mainToolBar->addAction(m_printReportAction);
- m_fontEditorBar = new FontEditorWidget(m_reportDesignWidget,tr("Font"),this);
+ m_fontEditorBar = new FontEditorWidgetForDesigner(m_reportDesignWidget,tr("Font"),this);
m_fontEditorBar->setIconSize(m_mainToolBar->iconSize());
m_fontEditorBar->setObjectName("fontTools");
addToolBar(m_fontEditorBar);
- m_textAlignmentEditorBar = new TextAlignmentEditorWidget(m_reportDesignWidget,tr("Text alignment"),this);
+ m_textAlignmentEditorBar = new TextAlignmentEditorWidgetForDesigner(m_reportDesignWidget,tr("Text alignment"),this);
m_textAlignmentEditorBar->setIconSize(m_mainToolBar->iconSize());
m_textAlignmentEditorBar->setObjectName("textAlignmentTools");
addToolBar(m_textAlignmentEditorBar);
@@ -324,7 +324,7 @@ void ReportDesignWindow::createToolBars()
m_itemsAlignmentEditorBar->insertAction(m_itemsAlignmentEditorBar->actions().at(1),m_useMagnetAction);
m_itemsAlignmentEditorBar->insertSeparator(m_itemsAlignmentEditorBar->actions().at(2));
addToolBar(m_itemsAlignmentEditorBar);
- m_itemsBordersEditorBar = new ItemsBordersEditorWidget(m_reportDesignWidget,tr("Borders"),this);
+ m_itemsBordersEditorBar = new ItemsBordersEditorWidgetForDesigner(m_reportDesignWidget,tr("Borders"),this);
m_itemsBordersEditorBar->setIconSize(m_mainToolBar->iconSize());
m_itemsBordersEditorBar->setObjectName("itemsBorderTools");
addToolBar(m_itemsBordersEditorBar);
@@ -459,7 +459,7 @@ void ReportDesignWindow::createMainMenu()
m_recentFilesMenu->setDisabled(m_recentFiles.isEmpty());
}
-void ReportDesignWindow::initReportEditor(ReportEngine* report)
+void ReportDesignWindow::initReportEditor(ReportEnginePrivateInterface* report)
{
m_reportDesignWidget=new ReportDesignWidget(report,this,this);
setCentralWidget(m_reportDesignWidget);
@@ -472,16 +472,16 @@ void ReportDesignWindow::initReportEditor(ReportEngine* report)
connect(m_reportDesignWidget,SIGNAL(itemInserted(LimeReport::PageDesignIntf*,QPointF,QString)),
this,SLOT(slotItemInserted(LimeReport::PageDesignIntf*,QPointF,QString)));
connect(m_reportDesignWidget,SIGNAL(itemInsertCanceled(QString)),this,SLOT(slotItemInsertCanceled(QString)));
- connect(m_reportDesignWidget->report(),SIGNAL(datasourceCollectionLoadFinished(QString)),this,SLOT(slotUpdateDataBrowser(QString)));
+ connect(dynamic_cast(report), SIGNAL(datasourceCollectionLoadFinished(QString)),this,SLOT(slotUpdateDataBrowser(QString)));
connect(m_reportDesignWidget,SIGNAL(commandHistoryChanged()),this,SLOT(slotCommandHistoryChanged()));
connect(m_reportDesignWidget,SIGNAL(activePageChanged()),this,SLOT(slotActivePageChanged()));
connect(m_reportDesignWidget, SIGNAL(bandAdded(LimeReport::PageDesignIntf*,LimeReport::BandDesignIntf*)),
this, SLOT(slotBandAdded(LimeReport::PageDesignIntf*,LimeReport::BandDesignIntf*)));
connect(m_reportDesignWidget, SIGNAL(bandDeleted(LimeReport::PageDesignIntf*,LimeReport::BandDesignIntf*)),
this, SLOT(slotBandDeleted(LimeReport::PageDesignIntf*,LimeReport::BandDesignIntf*)));
- connect(m_reportDesignWidget->report(), SIGNAL(renderStarted()), this, SLOT(renderStarted()));
- connect(m_reportDesignWidget->report(), SIGNAL(renderPageFinished(int)), this, SLOT(renderPageFinished(int)));
- connect(m_reportDesignWidget->report(), SIGNAL(renderFinished()), this, SLOT(renderFinished()));
+ connect(dynamic_cast(report), SIGNAL(renderStarted()), this, SLOT(renderStarted()));
+ connect(dynamic_cast(report), SIGNAL(renderPageFinished(int)), this, SLOT(renderPageFinished(int)));
+ connect(dynamic_cast(report), SIGNAL(renderFinished()), this, SLOT(renderFinished()));
connect(m_reportDesignWidget, SIGNAL(pageAdded(PageDesignIntf*)), this, SLOT(slotPageAdded(PageDesignIntf*)));
connect(m_reportDesignWidget, SIGNAL(pageDeleted()), this, SLOT(slotPageDeleted()));
}
@@ -1311,7 +1311,7 @@ void ReportDesignWindow::renderStarted()
{
if (m_showProgressDialog){
m_progressDialog = new QProgressDialog(tr("Rendering report"),tr("Abort"),0,0,this);
- m_progressDialog->open(m_reportDesignWidget->report(),SLOT(cancelRender()));
+ m_progressDialog->open(dynamic_cast(m_reportDesignWidget->report()), SLOT(cancelRender()));
QApplication::processEvents();
}
}
diff --git a/limereport/lrreportdesignwindow.h b/limereport/lrreportdesignwindow.h
index a01db94..1abfcd8 100644
--- a/limereport/lrreportdesignwindow.h
+++ b/limereport/lrreportdesignwindow.h
@@ -43,6 +43,7 @@
#include "items/editors/lritemsaligneditorwidget.h"
#include "items/editors/lritemsborderseditorwidget.h"
#include "lrobjectitemmodel.h"
+#include "lrreportdesignwindowintrerface.h"
namespace LimeReport{
@@ -55,11 +56,11 @@ class BaseDesignIntf;
class PageDesignIntf;
class ObjectBrowser;
-class ReportDesignWindow : public QMainWindow
+class ReportDesignWindow : public ReportDesignWindowInterface
{
Q_OBJECT
public:
- explicit ReportDesignWindow(ReportEngine *report, QWidget *parent = 0, QSettings* settings=0);
+ explicit ReportDesignWindow(ReportEnginePrivateInterface *report, QWidget *parent = 0, QSettings* settings=0);
~ReportDesignWindow();
static ReportDesignWindow* instance(){return m_instance;}
@@ -140,7 +141,7 @@ private:
void createItemsActions();
void createObjectInspector();
void createObjectsBrowser();
- void initReportEditor(ReportEngine *report);
+ void initReportEditor(ReportEnginePrivateInterface* report);
void createDataWindow();
void createScriptWindow();
#ifdef HAVE_QTDESIGNER_INTEGRATION
diff --git a/limereport/lrreportdesignwindowintrerface.h b/limereport/lrreportdesignwindowintrerface.h
new file mode 100644
index 0000000..858881e
--- /dev/null
+++ b/limereport/lrreportdesignwindowintrerface.h
@@ -0,0 +1,23 @@
+#ifndef LRREPORTDESIGNWINDOWINTRERFACE_H
+#define LRREPORTDESIGNWINDOWINTRERFACE_H
+
+#include
+#include
+
+namespace LimeReport {
+
+class ReportDesignWindowInterface: public QMainWindow{
+public:
+ ReportDesignWindowInterface(QWidget* parent = 0): QMainWindow(parent){}
+ virtual bool checkNeedToSave() = 0;
+ virtual void showModal() = 0;
+ virtual void showNonModal() = 0;
+ virtual void setSettings(QSettings* value) = 0;
+ virtual QSettings* settings() = 0;
+ virtual void restoreSetting() = 0;
+ virtual void setShowProgressDialog(bool value) = 0;
+};
+
+} // namespace LimeReport
+
+#endif // LRREPORTDESIGNWINDOWINTRERFACE_H
diff --git a/limereport/lrreportengine.cpp b/limereport/lrreportengine.cpp
index 5768951..d3646f8 100644
--- a/limereport/lrreportengine.cpp
+++ b/limereport/lrreportengine.cpp
@@ -34,6 +34,7 @@
#include
#include
#include
+#include
#include "time.h"
@@ -42,8 +43,11 @@
#include "lrpagedesignintf.h"
#include "lrdatasourcemanager.h"
+
+#ifdef HAVE_REPORT_DESIGNER
#include "lrdatabrowser.h"
#include "lrreportdesignwindow.h"
+#endif
#include "serializators/lrxmlwriter.h"
#include "serializators/lrxmlreader.h"
@@ -51,6 +55,8 @@
#include "lrpreviewreportwindow.h"
#include "lrpreviewreportwidget.h"
#include "lrpreviewreportwidget_p.h"
+
+
#ifdef HAVE_STATIC_BUILD
#include "lrfactoryinitializer.h"
#endif
@@ -64,12 +70,14 @@ ReportEnginePrivate::ReportEnginePrivate(QObject *parent) :
m_showProgressDialog(true), m_reportName(""), m_activePreview(0),
m_previewWindowIcon(":/report/images/logo32"), m_previewWindowTitle(tr("Preview")),
m_reportRendering(false), m_resultIsEditable(true), m_passPhrase("HjccbzHjlbyfCkjy"),
- m_fileWatcher( new QFileSystemWatcher( this ) ), m_reportLanguage(QLocale::AnyLanguage)
+ m_fileWatcher( new QFileSystemWatcher( this ) ), m_reportLanguage(QLocale::AnyLanguage), m_designerFactory(0)
{
#ifdef HAVE_STATIC_BUILD
initResources();
initReportItems();
+#ifdef HAVE_REPORT_DESIGNER
initObjectInspectorProperties();
+#endif
initSerializators();
#endif
m_datasources = new DataSourceManager(this);
@@ -83,6 +91,25 @@ ReportEnginePrivate::ReportEnginePrivate(QObject *parent) :
m_datasources->setObjectName("datasources");
connect(m_datasources,SIGNAL(loadCollectionFinished(QString)),this,SLOT(slotDataSourceCollectionLoaded(QString)));
connect(m_fileWatcher,SIGNAL(fileChanged(const QString &)),this,SLOT(slotLoadFromFile(const QString &)));
+
+#ifndef HAVE_REPORT_DESIGNER
+ QDir pluginsDir = QCoreApplication::applicationDirPath();
+ pluginsDir.cd("../lib" );
+ if (!pluginsDir.exists()){
+ pluginsDir.cd("./lib");
+ if (!pluginsDir.exists()) pluginsDir.setPath(QCoreApplication::applicationDirPath());
+ }
+
+ foreach( const QString& pluginName, pluginsDir.entryList( QDir::Files ) ) {
+ QPluginLoader loader( pluginsDir.absoluteFilePath( pluginName ) );
+ if( loader.load() ) {
+ if( LimeReportPluginInterface* myPlugin = qobject_cast< LimeReportPluginInterface* >( loader.instance() ) ) {
+ m_designerFactory = myPlugin;
+ break;
+ }
+ }
+ }
+#endif
}
ReportEnginePrivate::~ReportEnginePrivate()
@@ -475,7 +502,7 @@ void ReportEnginePrivate::previewReport(PreviewHints hints)
}
w->setHideResultEditButton(resultIsEditable());
-
+ w->setStyleSheet(m_styleSheet);
m_activePreview = w;
connect(w,SIGNAL(destroyed(QObject*)), this, SLOT(slotPreviewWindowDestroyed(QObject*)));
w->exec();
@@ -486,6 +513,29 @@ void ReportEnginePrivate::previewReport(PreviewHints hints)
}
}
+ReportDesignWindowInterface*ReportEnginePrivate::getDesignerWindow()
+{
+ if (!m_designerWindow) {
+ if (m_designerFactory){
+ m_designerWindow = m_designerFactory->getDesignerWindow(this,QApplication::activeWindow(),settings());
+ m_designerWindow->setAttribute(Qt::WA_DeleteOnClose,true);
+ m_designerWindow->setWindowIcon(QIcon(":report/images/logo32"));
+ m_designerWindow->setShowProgressDialog(m_showProgressDialog);
+ } else {
+#ifdef HAVE_REPORT_DESIGNER
+ m_designerWindow = new LimeReport::ReportDesignWindow(this,QApplication::activeWindow(),settings());
+ m_designerWindow->setAttribute(Qt::WA_DeleteOnClose,true);
+ m_designerWindow->setWindowIcon(QIcon(":report/images/logo32"));
+ m_designerWindow->setShowProgressDialog(m_showProgressDialog);
+#endif
+ }
+ }
+ if (m_designerWindow){
+ m_datasources->updateDatasourceModel();
+ }
+ return m_designerWindow;
+}
+
PreviewReportWidget* ReportEnginePrivate::createPreviewWidget(QWidget* parent){
Q_Q(ReportEngine);
@@ -618,21 +668,18 @@ PageDesignIntf* ReportEngine::createPreviewScene(QObject* parent){
void ReportEnginePrivate::designReport()
{
- if (!m_designerWindow) {
- Q_Q(ReportEngine);
- m_designerWindow = new LimeReport::ReportDesignWindow(q,QApplication::activeWindow(),settings());
- m_designerWindow->setAttribute(Qt::WA_DeleteOnClose,true);
- m_designerWindow->setWindowIcon(QIcon(":report/images/logo32"));
- m_designerWindow->setShowProgressDialog(m_showProgressDialog);
- }
- m_datasources->updateDatasourceModel();
+ ReportDesignWindowInterface* designerWindow = getDesignerWindow();
+ if (designerWindow){
#ifdef Q_OS_WIN
- m_designerWindow->setWindowModality(Qt::ApplicationModal);
+ designerWindow->setWindowModality(Qt::ApplicationModal);
#endif
- if (QApplication::activeWindow()==0){
- m_designerWindow->show();;
+ if (QApplication::activeWindow()==0){
+ designerWindow->show();;
+ } else {
+ designerWindow->showModal();
+ }
} else {
- m_designerWindow->showModal();
+ qDebug()<<(tr("Designer not found!"));
}
}
@@ -885,10 +932,20 @@ void ReportEnginePrivate::activateLanguage(QLocale::Language language)
}
}
+QString ReportEnginePrivate::styleSheet() const
+{
+ return m_styleSheet;
+}
+
+void ReportEnginePrivate::setStyleSheet(const QString &styleSheet)
+{
+ m_styleSheet = styleSheet;
+}
+
bool ReportEnginePrivate::setReportLanguage(QLocale::Language language){
m_reportLanguage = language;
if (!m_translations.keys().contains(language)) return false;
-// activateLanguage(language);
+ // activateLanguage(language);
return true;
}
@@ -1089,6 +1146,12 @@ void ReportEngine::designReport()
d->designReport();
}
+ReportDesignWindowInterface*ReportEngine::getDesignerWindow()
+{
+ Q_D(ReportEngine);
+ return d->getDesignerWindow();
+}
+
PreviewReportWidget* ReportEngine::createPreviewWidget(QWidget *parent)
{
Q_D(ReportEngine);
diff --git a/limereport/lrreportengine.h b/limereport/lrreportengine.h
index 444d2f4..03b5d91 100644
--- a/limereport/lrreportengine.h
+++ b/limereport/lrreportengine.h
@@ -39,6 +39,7 @@
#include "lrdatasourcemanagerintf.h"
#include "lrscriptenginemanagerintf.h"
#include "lrpreviewreportwidget.h"
+#include "lrreportdesignwindowintrerface.h"
class QPrinter;
@@ -85,6 +86,7 @@ public:
bool printToPDF(const QString& fileName);
void previewReport(PreviewHints hints = PreviewBarsUserSetting);
void designReport();
+ ReportDesignWindowInterface* getDesignerWindow();
void setShowProgressDialog(bool value);
IDataSourceManager* dataManager();
IScriptEngineManager* scriptManager();
diff --git a/limereport/lrreportengine_p.h b/limereport/lrreportengine_p.h
index 49505ca..9dde434 100644
--- a/limereport/lrreportengine_p.h
+++ b/limereport/lrreportengine_p.h
@@ -42,6 +42,8 @@
#include "serializators/lrstorageintf.h"
#include "lrscriptenginemanager.h"
#include "lrreporttranslation.h"
+#include "lrdesignerplugininterface.h"
+#include "lrreportdesignwindowintrerface.h"
class QFileSystemWatcher;
@@ -51,9 +53,41 @@ class PageDesignIntf;
class PrintRange;
class ReportDesignWindow;
-//TODO: Add on render callback
+class ReportEnginePrivateInterface {
+public:
+ virtual PageDesignIntf* appendPage(const QString& pageName="") = 0;
+ virtual bool deletePage(PageDesignIntf *page) = 0;
+ virtual void reorderPages(const QList &reorderedPages) = 0;
+ virtual int pageCount() = 0;
+ virtual PageDesignIntf* pageAt(int index) = 0;
+ virtual void clearReport() = 0;
+ virtual ScriptEngineContext* scriptContext() = 0;
+ virtual ScriptEngineManager* scriptManager() = 0;
+ virtual DataSourceManager* dataManager() = 0;
+ virtual QString reportFileName() = 0;
+ virtual void setReportFileName(const QString& reportFileName) = 0;
+ virtual void emitSaveFinished() = 0;
+ virtual bool isNeedToSave() = 0;
+ virtual void emitSaveReport() = 0;
+ virtual bool saveToFile() = 0;
+ virtual bool saveToFile(const QString& fileName) = 0;
+ virtual bool isSaved() = 0;
+ virtual QString reportName() = 0;
+ virtual bool loadFromFile(const QString& fileName, bool autoLoadPreviewOnChange) = 0;
+ virtual bool emitLoadReport() = 0;
+ virtual void clearSelection() = 0;
+ virtual bool printReport(QPrinter *printer=0) = 0;
+ virtual void previewReport(PreviewHints hints = PreviewBarsUserSetting) = 0;
+ virtual void setCurrentReportsDir(const QString& dirName) = 0;
+ virtual QString currentReportsDir() = 0;
+ virtual bool suppressFieldAndVarError() const = 0;
+ virtual void setSuppressFieldAndVarError(bool suppressFieldAndVarError) = 0;
+ virtual void setStyleSheet(const QString& styleSheet) = 0;
+ virtual QString styleSheet() const = 0;
+};
-class ReportEnginePrivate : public QObject, public ICollectionContainer, public ITranslationContainer
+class ReportEnginePrivate : public QObject, public ICollectionContainer, public ITranslationContainer,
+ public ReportEnginePrivateInterface
{
Q_OBJECT
Q_DECLARE_PUBLIC(ReportEngine)
@@ -94,6 +128,8 @@ public:
void printToFile(const QString& fileName);
bool printToPDF(const QString& fileName);
void previewReport(PreviewHints hints = PreviewBarsUserSetting);
+
+ ReportDesignWindowInterface* getDesignerWindow();
void designReport();
void setSettings(QSettings* value);
void setShowProgressDialog(bool value){m_showProgressDialog = value;}
@@ -142,6 +178,9 @@ public:
void clearSelection();
Qt::LayoutDirection previewLayoutDirection();
void setPreviewLayoutDirection(const Qt::LayoutDirection& previewLayoutDirection);
+ QString styleSheet() const;
+ void setStyleSheet(const QString &styleSheet);
+
signals:
void pagesLoadFinished();
void datasourceCollectionLoadFinished(const QString& collectionName);
@@ -195,7 +234,7 @@ private:
QMainWindow* m_activePreview;
QIcon m_previewWindowIcon;
QString m_previewWindowTitle;
- QPointer m_designerWindow;
+ QPointer m_designerWindow;
ReportSettings m_reportSettings;
bool m_reportRendering;
bool m_resultIsEditable;
@@ -205,6 +244,8 @@ private:
QLocale::Language m_reportLanguage;
void activateLanguage(QLocale::Language language);
Qt::LayoutDirection m_previewLayoutDirection;
+ LimeReportPluginInterface* m_designerFactory;
+ QString m_styleSheet;
};
}
diff --git a/limereport/lrreportrender.cpp b/limereport/lrreportrender.cpp
index 7117960..f00d102 100644
--- a/limereport/lrreportrender.cpp
+++ b/limereport/lrreportrender.cpp
@@ -29,7 +29,6 @@
****************************************************************************/
#include
#include
-#include
#include "lrglobal.h"
#include "lrreportrender.h"
@@ -411,7 +410,7 @@ void ReportRender::replaceGroupsFunction(BandDesignIntf *band)
BandDesignIntf* ReportRender::renderBand(BandDesignIntf *patternBand, BandDesignIntf* bandData, ReportRender::DataRenderMode mode, bool isLast)
{
- QApplication::processEvents();
+ QCoreApplication::processEvents();
if (patternBand){
BandDesignIntf* bandClone = 0;
diff --git a/limereport/lrsettingdialog.cpp b/limereport/lrsettingdialog.cpp
index 0b929be..ee34440 100644
--- a/limereport/lrsettingdialog.cpp
+++ b/limereport/lrsettingdialog.cpp
@@ -1,5 +1,6 @@
#include "lrsettingdialog.h"
#include "ui_lrsettingdialog.h"
+#include
namespace LimeReport{
@@ -8,6 +9,10 @@ SettingDialog::SettingDialog(QWidget *parent) :
ui(new Ui::SettingDialog)
{
ui->setupUi(this);
+ QFile theme(":/qdarkstyle/style.qss");
+ if (!theme.exists()){
+ ui->cbbUseDarkTheme->setVisible(false);
+ }
}
SettingDialog::~SettingDialog()
@@ -32,6 +37,11 @@ QFont SettingDialog::defaultFont()
return result;
}
+bool SettingDialog::userDarkTheme()
+{
+ return ui->cbbUseDarkTheme->isChecked();
+}
+
bool SettingDialog::suppressAbsentFieldsAndVarsWarnings()
{
return ui->cbSuppressWarnings->isChecked();
@@ -57,4 +67,9 @@ void SettingDialog::setDefaultFont(const QFont &value)
ui->defaultFontSize->setValue(value.pointSize());
}
+void SettingDialog::setUseDarkTheme(bool value)
+{
+ ui->cbbUseDarkTheme->setChecked(value);
+}
+
} // namespace LimeReport
diff --git a/limereport/lrsettingdialog.h b/limereport/lrsettingdialog.h
index e9a740d..db908f9 100644
--- a/limereport/lrsettingdialog.h
+++ b/limereport/lrsettingdialog.h
@@ -19,11 +19,13 @@ public:
int verticalGridStep();
int horizontalGridStep();
QFont defaultFont();
+ bool userDarkTheme();
bool suppressAbsentFieldsAndVarsWarnings();
void setSuppressAbsentFieldsAndVarsWarnings(bool value);
void setHorizontalGridStep(int value);
void setVerticalGridStep(int value);
void setDefaultFont(const QFont& value);
+ void setUseDarkTheme(bool value);
private:
Ui::SettingDialog *ui;
};
diff --git a/limereport/lrsettingdialog.ui b/limereport/lrsettingdialog.ui
index d3a143a..b0dd1ed 100644
--- a/limereport/lrsettingdialog.ui
+++ b/limereport/lrsettingdialog.ui
@@ -108,6 +108,13 @@
+ -
+
+
+ Use dark theme
+
+
+
diff --git a/limereport/lrvariablesholder.h b/limereport/lrvariablesholder.h
index 6756240..76446b5 100644
--- a/limereport/lrvariablesholder.h
+++ b/limereport/lrvariablesholder.h
@@ -45,7 +45,7 @@ class VarDesc : public QObject{
Q_PROPERTY(bool isMandatory READ isMandatory WRITE setMandatory)
Q_PROPERTY(int dataType READ readDataTypeProperty WRITE setDataTypeProperty)
public:
- VarDesc() : m_dataType(VariableDataType::Undefined), m_mandatory(false){}
+ VarDesc() : m_dataType(Enums::Undefined), m_mandatory(false){}
enum VarType {System, User, Report};
void setVarType(VarType value){m_varType=value;}
VarType varType(){return m_varType;}
diff --git a/limereport/objectinspector/propertyItems/lrflagspropitem.cpp b/limereport/objectinspector/propertyItems/lrflagspropitem.cpp
index 987ec94..c10eceb 100644
--- a/limereport/objectinspector/propertyItems/lrflagspropitem.cpp
+++ b/limereport/objectinspector/propertyItems/lrflagspropitem.cpp
@@ -35,7 +35,6 @@
#include
#include
#include
-#include
#include
#include
diff --git a/limereport/scripteditor/lrcodeeditor.cpp b/limereport/scripteditor/lrcodeeditor.cpp
index 57a9d69..4e524c1 100644
--- a/limereport/scripteditor/lrcodeeditor.cpp
+++ b/limereport/scripteditor/lrcodeeditor.cpp
@@ -8,7 +8,6 @@
#include
#include
#include
-#include
#include "lrscripthighlighter.h"
diff --git a/limereport/scripteditor/lrscripteditor.cpp b/limereport/scripteditor/lrscripteditor.cpp
index 4db2fac..667a238 100644
--- a/limereport/scripteditor/lrscripteditor.cpp
+++ b/limereport/scripteditor/lrscripteditor.cpp
@@ -48,7 +48,7 @@ void ScriptEditor::initEditor(DataSourceManager* dm)
}
}
-void ScriptEditor::setReportEngine(ReportEnginePrivate* reportEngine)
+void ScriptEditor::setReportEngine(ReportEnginePrivateInterface* reportEngine)
{
m_reportEngine = reportEngine;
DataSourceManager* dm = m_reportEngine->dataManager();
diff --git a/limereport/scripteditor/lrscripteditor.h b/limereport/scripteditor/lrscripteditor.h
index b67be79..f9b8db7 100644
--- a/limereport/scripteditor/lrscripteditor.h
+++ b/limereport/scripteditor/lrscripteditor.h
@@ -9,7 +9,7 @@
namespace LimeReport{
-class ReportEnginePrivate;
+class ReportEnginePrivateInterface;
class BaseDesignIntf;
class PageDesignIntf;
class BandDesignIntf;
@@ -25,7 +25,7 @@ class ScriptEditor : public QWidget
public:
explicit ScriptEditor(QWidget *parent = 0);
~ScriptEditor();
- void setReportEngine(ReportEnginePrivate* reportEngine);
+ void setReportEngine(LimeReport::ReportEnginePrivateInterface* reportEngine);
void setReportPage(PageDesignIntf* page);
void setPageBand(BandDesignIntf* band);
void initCompleter();
@@ -48,7 +48,7 @@ private:
void addItemToCompleater(const QString& pageName, BaseDesignIntf* item, QStringList& dataWords);
private:
Ui::ScriptEditor *ui;
- ReportEnginePrivate* m_reportEngine;
+ ReportEnginePrivateInterface* m_reportEngine;
PageDesignIntf* m_page;
QCompleter* m_completer;