42 class DatasetInterface;
44 class BaseItemInterface;
45 class StorageInterface;
46 class StorageOptionsInterface;
47 class RendererInterface;
48 class RenderedPageInterface;
49 class PrinterInterface;
51 class SerializerInterface;
52 class ImportInterface;
53 class ExportInterface;
55 class ReportInterface;
56 class RenderedReportInterface;
57 class ReportPluginInterface;
58 class ScriptExtensionInterface;
59 class DesignerItemInterface;
88 explicit ReportCore(QObject *parent = 0, QSettings *settings = 0,
bool interactive =
true,
bool initLogSytem =
true);
89 explicit ReportCore(QSettings *settings,
bool interactive =
true);
92 int versionMajor()
const;
93 int versionMinor()
const;
94 QString license()
const;
103 bool interactive()
const;
125 void restoreState(
bool cleanRestore =
true);
132 bool setDefaultStorage(
const QString &objectName);
133 QString defaultStorageName()
const;
135 bool setDefaultPrinter(
const QString objectName);
136 QString defaultPrinterName()
const;
138 bool setDefaultRenderer(
const QString &objectName);
139 QString defaultRendererName()
const;
144 void setRootWidget(QWidget * widget);
145 QWidget * rootWidget();
152 const QList<ReportPluginInterface *> modules(
ModuleType moduleType)
const;
160 QStringList moduleNames(
ModuleType moduleType,
bool shortName =
false)
const;
163 QString moduleTypeToString(
ModuleType type)
const;
164 ModuleType moduleTypeFromString(
const QString & type)
const;
176 void setModuleOptions(
ReportPluginInterface * module,
const QStringList & options,
bool setObjectNameIfDefined =
true);
177 QString moduleOptionsStr(
ReportPluginInterface * module,
bool includeObjectName =
true,
const QString & delimiter = QString());
178 void setModuleOptionsStr(
ReportPluginInterface * module,
const QString & options,
bool setObjectNameIfDefined =
true);
187 void deleteStorage(
const QString & objectName);
194 void deleteRenderer(
const QString & objectName);
196 QList<PrinterInterface *> printerList(
ReportInterface * report = 0)
const;
200 void deletePrinter(
const QString & objectName);
208 QList<ReportInterface *> reports()
const;
227 QByteArray serialize(
const QObject *
object,
bool *ok = 0, QString * error = 0,
const QString & moduleName = QString());
228 QObject * deserialize(
const QByteArray &data,
bool *ok = 0, QString * error = 0,
const QString & moduleName = QString());
233 bool reportExists(
const QString & urlString);
236 QString * errorText = 0);
238 bool saveObject(
const QString & urlString,
240 const QByteArray &objectData,
241 QString * errorText = 0);
243 QByteArray loadObject(
const QString & urlString,
245 QString * errorText = 0);
249 QList<StorageObjectInfo> objectsList(
const QString & url,
ReportInterface *report,
const QStringList & nameFilters, QDir::Filters filters,
250 QDir::SortFlags sort, QString *errorText = 0);
255 bool render(
const QString & reportUrl,
const QString &
rendererName = QString());
261 void renderDataclearAll();
264 void print(
ReportInterface* report,
const QString & printerName = QString());
265 void print(
const QString url,
const QString & printerName = QString());
268 QStringList importExtensions()
const;
269 bool canImport(
const QString &reportUrl)
const;
270 QStringList importModulesForFile(
const QString &reportUrl)
const;
271 ReportInterface *
import(
const QString &reportUrl,
const QString & moduleName = QString())
const;
276 void exportTo(
ReportInterface* report,
const QString & format,
const QString & outputUrl = QString(),
const QStringList & options = QStringList());
277 void exportTo(
const QString &reportUrl,
const QString & format,
const QString & outputUrl = QString(),
const QStringList & options = QStringList());
279 static void log(
LogLevel level,
const QString & sender,
const QString & message);
280 static void log(
LogLevel level,
const QString & sender,
const QString & shortMessage,
const QString & fullMessage);
282 static bool isNameUnique(QObject *
object,
const QString &name, QObject * rootObject);
283 static QString uniqueName(QObject *
object,
const QString &proposedName, QObject *rootObject);
285 int maxRenderingThreads()
const;
286 void setMaxRenderingThreads(
int maxRenderingThreads);
291 QSet<QString> getReportParameters(
ReportInterface *report, QString *error = 0);
293 QSettings * settings();
296 QString resourcesPath()
const;
297 QString imagesPath()
const;
298 QString pluginsPath()
const;
299 QString settingsPath()
const;
301 bool inheritReport(
ReportInterface * report,
const QString & baseReportUrl);
302 bool inheritReport(
ReportInterface * report,
const QString & baseReportFileName,
const QString &baseReportPath);
303 bool detachReport(
ReportInterface * report,
bool ownInheritedItems =
false);
311 void syncMessage(
const QString & moduleName,
const QString & message);
315 void rendererDone(
const QString & reportUrl,
bool success);
321 void printingDone(
const QString & reportUrl,
bool successfully);
324 void exportDone(
const QString & reportUrl,
bool successfully);
331 void _rendererStarted();
332 void _rendererDone(
bool successful);
333 void _rendererMessage(
int logLevel, QString message);
334 void _rendererProcessingPage(
int page,
int total,
int pass,
int passTotal);
339 static bool loadPlugins(QSettings *settings);
340 static void processModuleList(QList<ReportPluginInterface *> &list);
342 ReportPluginInterface * getOriginalModuleByName(
const QString & moduleName,
const QList<ReportPluginInterface *> &list)
const;
343 ReportPluginInterface * getExtendedModuleByName(
const QString & origModuleName,
const QList<ReportPluginInterface *> &list)
const;
344 ReportPluginInterface * getModuleByName(
const QString & moduleName,
const QList<ReportPluginInterface *> &list);
345 void saveObjectsOptions(
const QString & prefix,
const QList<ReportPluginInterface*> & objects,
bool clearPrefix =
true);
346 void loadObjectsOptions(
const QString & prefix, QList<ReportPluginInterface*> & objects,
const QList<ReportPluginInterface*> * plugins);
347 bool removeObject(
const QString & objectName, QList<ReportPluginInterface*> & objects);
348 bool replaceObject(
ReportPluginInterface*
object, QList<ReportPluginInterface*> & objects, QPointer<ReportPluginInterface> defaultObject);
349 QStringList objectNames(
const QList<ReportPluginInterface *> &objects)
const;
350 ReportPluginInterface * getObjectByName(
const QString & objectName,
const QList<ReportPluginInterface *> &list)
const;
351 void createLocalObjects(QList<ReportPluginInterface*> & objects,
const QList<ReportPluginInterface*> * plugins);
352 ReportPluginInterface * findDefaultObject(
const QString &type,
const QString &fullModuleNameList, QList<ReportPluginInterface*> & objects);
355 void init(QSettings * settings,
bool initLogSystem);
365 static int m_refCount;
367 static QList<ReportPluginInterface*> * m_itemPlugins;
368 static QList<ReportPluginInterface*> * m_pagePlugins;
369 static QList<ReportPluginInterface*> * m_datasetPlugins;
370 static QList<ReportPluginInterface*> * m_storagePlugins;
371 static QList<ReportPluginInterface*> * m_serializePlugins;
372 static QList<ReportPluginInterface*> * m_rendererPlugins;
373 static QList<ReportPluginInterface*> * m_printerPlugins;
374 static QList<ReportPluginInterface*> * m_formPlugins;
375 static QList<ReportPluginInterface*> * m_importPlugins;
376 static QList<ReportPluginInterface*> * m_exportPlugins;
377 static QList<ReportPluginInterface*> * m_scriptExtensionPlugins;
379 QPointer<ReportPluginInterface> m_defaultStorage;
380 QPointer<ReportPluginInterface> m_defaultRenderer;
381 QPointer<ReportPluginInterface> m_defaultPrinter;
382 QPointer<ReportPluginInterface> m_defaultSerializer;
384 QWidget* m_rootWidget;
385 QList<ReportPluginInterface*> m_storages;
386 QList<ReportPluginInterface*> m_renderers;
387 QList<ReportPluginInterface*> m_printers;
388 QList<ReportPluginInterface*> m_serializers;
389 QList<ReportPluginInterface*> m_exporters;
391 QSettings * m_settings;
394 QList<QueueReport*> m_waitingQueue;
395 QHash<RendererInterface*, QueueReport*> m_renderingQueue;
396 int m_maxRenderingThreads;
400 #endif // REPORTCORE_H
Definition: reportcore.h:76
Definition: abstractpainterdelegate.h:42
RenderingDestination destination
Definition: reportcore.h:69
Definition: datasetinterface.h:56
Definition: pageinterface.h:74
Definition: printerinterface.h:44
TODO v2: rename to ReportObject.
Definition: reportinterface.h:71
ReportInterface * report
Definition: reportcore.h:67
RenderingDestination
Definition: reportcore.h:62
Definition: reportcore.h:62
Definition: reportplugininterface.h:53
Definition: reportcore.h:62
Definition: reportcore.h:64
ModuleType
Definition: cutereport_types.h:127
Definition: cutereport_types.h:310
bool success
Definition: reportcore.h:72
BaseType
Definition: reportcore.h:61
Definition: reportcore.h:62
LogLevel
Definition: cutereport_types.h:146
Definition: reportcore.h:61
Definition: reportcore.h:61
QString rendererName
Definition: reportcore.h:70
Definition: pageinterface.h:305
Definition: scriptextensioninterface.h:44
#define CUTEREPORT_EXPORTS
Definition: cutereport_globals.h:47
QString url
Definition: reportcore.h:68
Definition: rendererinterface.h:49
Definition: exportinterface.h:44
MetricType
Definition: cutereport_types.h:166
Definition: baseiteminterface.h:107
QString destinationName
Definition: reportcore.h:71
Definition: storageinterface.h:56