Skip to content

Commit

Permalink
empty mango reports
Browse files Browse the repository at this point in the history
  • Loading branch information
WajdyEssam committed Aug 10, 2012
1 parent abbcb5a commit 8420261
Show file tree
Hide file tree
Showing 7 changed files with 119 additions and 0 deletions.
1 change: 1 addition & 0 deletions MangoApp.pro
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ TEMPLATE = subdirs
SUBDIRS += MangoModel \
MangoDatabase \
MangoService \
MangoReports \
Mango
34 changes: 34 additions & 0 deletions MangoReports/MangoReports.pro
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
12 changes: 12 additions & 0 deletions MangoReports/MangoReports_global.h
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
16 changes: 16 additions & 0 deletions MangoReports/logginreport.cpp
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";
}
16 changes: 16 additions & 0 deletions MangoReports/logginreport.h
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
19 changes: 19 additions & 0 deletions MangoReports/report.cpp
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;
}
21 changes: 21 additions & 0 deletions MangoReports/report.h
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

0 comments on commit 8420261

Please sign in to comment.