forked from WajdyEssam/mangotalaat
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
abbcb5a
commit 8420261
Showing
7 changed files
with
119 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,5 @@ TEMPLATE = subdirs | |
SUBDIRS += MangoModel \ | ||
MangoDatabase \ | ||
MangoService \ | ||
MangoReports \ | ||
Mango |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#------------------------------------------------- | ||
# | ||
# Project created by QtCreator 2012-08-10T17:19:22 | ||
# | ||
#------------------------------------------------- | ||
|
||
QT -= gui | ||
|
||
TARGET = MangoReports | ||
TEMPLATE = lib | ||
|
||
DEFINES += MANGOREPORTS_LIBRARY | ||
|
||
SOURCES += report.cpp \ | ||
logginreport.cpp | ||
|
||
HEADERS += report.h\ | ||
MangoReports_global.h \ | ||
logginreport.h | ||
|
||
unix:DESTDIR = ../bin | ||
unix:OBJECTS_DIR = build/_obj | ||
unix:MOC_DIR = build/_moc | ||
unix:RCC_DIR = build/_rcc | ||
unix:UI_DIR = build/_ui | ||
|
||
win32:DESTDIR = ../bin | ||
win32:OBJECTS_DIR = build/_obj | ||
win32:MOC_DIR = build/_moc | ||
win32:RCC_DIR = build/_rcc | ||
win32:UI_DIR = build/_ui | ||
|
||
LIBS += -L$$PWD/../bin/ -lMangoModel | ||
LIBS += -L$$PWD/../bin/ -lMangoService |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#ifndef MANGOREPORTS_GLOBAL_H | ||
#define MANGOREPORTS_GLOBAL_H | ||
|
||
#include <QtCore/qglobal.h> | ||
|
||
#if defined(MANGOREPORTS_LIBRARY) | ||
# define MANGOREPORTSSHARED_EXPORT Q_DECL_EXPORT | ||
#else | ||
# define MANGOREPORTSSHARED_EXPORT Q_DECL_IMPORT | ||
#endif | ||
|
||
#endif // MANGOREPORTS_GLOBAL_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#include "logginreport.h" | ||
|
||
LogginReport::LogginReport(const QDateTime& from, const QDateTime& to) | ||
:Report(from, to) | ||
{ | ||
} | ||
|
||
QString LogginReport::getHTML() | ||
{ | ||
|
||
} | ||
|
||
QString LogginReport::getReportTemplateName() | ||
{ | ||
return ":/reports/LogginReport.html"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#ifndef LOGGINREPORT_H | ||
#define LOGGINREPORT_H | ||
|
||
#include "MangoReports_global.h" | ||
#include "report.h" | ||
|
||
class MANGOREPORTSSHARED_EXPORT LogginReport: public Report | ||
{ | ||
public: | ||
LogginReport(const QDateTime& from, const QDateTime& to); | ||
|
||
virtual QString getHTML(); | ||
virtual QString getReportTemplateName(); | ||
}; | ||
|
||
#endif // LOGGINREPORT_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#include "report.h" | ||
|
||
Report::Report(const QDateTime& from, const QDateTime& to) | ||
{ | ||
this->m_from = from; | ||
this->m_to = to; | ||
} | ||
|
||
QString Report::getTemplateFileContent() | ||
{ | ||
QFile *reportFile = new QFile(getReportTemplateName()); | ||
|
||
if ( ! reportFile->open(QIODevice::ReadOnly | QIODevice::Text) ) { | ||
return "Error"; | ||
} | ||
|
||
QString htmlContent = reportFile->readAll(); | ||
return htmlContent; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#ifndef REPORT_H | ||
#define REPORT_H | ||
|
||
#include "MangoReports_global.h" | ||
|
||
#include <QDateTime> | ||
#include <QFile> | ||
|
||
class MANGOREPORTSSHARED_EXPORT Report { | ||
public: | ||
Report(const QDateTime& from, const QDateTime& to); | ||
QString getTemplateFileContent(); | ||
|
||
virtual QString getHTML() = 0; | ||
virtual QString getReportTemplateName() = 0; | ||
|
||
private: | ||
QDateTime m_from, m_to; | ||
}; | ||
|
||
#endif // REPORT_H |