3
* This file is part of BibleTime's source code, http://www.bibletime.info/.
5
* Copyright 1999-2006 by the BibleTime developers.
6
* The BibleTime source code is licensed under the GNU General Public License version 2.0.
12
#ifndef CEXPORTMANAGER_H
13
#define CEXPORTMANAGER_H
16
#include "backend/cswordbackend.h"
17
#include "cbtconfig.h"
19
#include "util/cpointers.h"
27
class CSwordModuleInfo;
28
class QProgressDialog;
30
/** Contains the functions to export text to disk, clipboard or printer.
31
* @author The BibleTime team
33
class CExportManager : CPointers {
35
/** The format the export actions should have
42
CExportManager(const QString& caption, const bool showProgress = true, const QString& progressLabel = QString::null, const CSwordBackend::FilterOptions filterOptions = CBTConfig::getFilterOptionDefaults(), const CSwordBackend::DisplayOptions displayOptions = CBTConfig::getDisplayOptionDefaults());
44
const bool saveKey(CSwordKey* key, const Format format, const bool addText);
45
const bool saveKeyList(sword::ListKey* list, CSwordModuleInfo* module, const Format format, const bool addText);
46
const bool saveKeyList(QPtrList<CSwordKey>& list, const Format format, const bool addText );
48
const bool copyKey(CSwordKey* key, const Format format, const bool addText);
49
const bool copyKeyList(sword::ListKey* list, CSwordModuleInfo* module, const Format format, const bool addText);
50
const bool copyKeyList(QPtrList<CSwordKey>& list, const Format format, const bool addText );
52
const bool printKey(CSwordKey* key, CSwordBackend::DisplayOptions displayOptions, CSwordBackend::FilterOptions filterOptions);
53
const bool printKey( CSwordModuleInfo* module, const QString& startKey, const QString& stopKey, CSwordBackend::DisplayOptions displayOptions, CSwordBackend::FilterOptions filterOptions );
54
const bool printByHyperlink(const QString& hyperlink, CSwordBackend::DisplayOptions displayOptions, CSwordBackend::FilterOptions filterOptions);
55
const bool printKeyList(sword::ListKey* list, CSwordModuleInfo* module, CSwordBackend::DisplayOptions displayOptions, CSwordBackend::FilterOptions filterOptions);
56
const bool printKeyList(const QStringList& list,CSwordModuleInfo* module, CSwordBackend::DisplayOptions displayOptions, CSwordBackend::FilterOptions filterOptions);
58
protected: // Protected methods
60
* Returns the string for the filedialogs to show the correct files.
62
const QString filterString( const Format format );
64
* Returns a filename to save a file.
66
const QString getSaveFileName(const Format format);
68
* Returns a string containing the linebreak for the current format.
70
const QString lineBreak( const Format format );
74
QString m_progressLabel;
76
CSwordBackend::FilterOptions m_filterOptions;
77
CSwordBackend::DisplayOptions m_displayOptions;
79
QProgressDialog* m_progressDialog;
82
* Creates the progress dialog with the correct settings.
84
QProgressDialog* const progressDialog();
86
* Returns the CSS string used in HTML pages.
88
void setProgressRange( const int item );
90
* Increments the progress by one item.
92
inline void incProgress();
93
const bool progressWasCancelled();
95
* Closes the progress dialog immediatly.
97
void closeProgressDialog();