BibleTime
Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
CExportManager Class Reference

#include <cexportmanager.h>

Public Types

enum  Format { HTML , Text }
 

Public Member Functions

 CExportManager (const bool showProgress=true, const QString &progressLabel=QString(), const FilterOptions &filterOptions=btConfig().getFilterOptions(), const DisplayOptions &displayOptions=btConfig().getDisplayOptions())
 
bool copyKey (CSwordKey const *const key, Format const format, bool const addText)
 
bool copyKeyList (CSwordModuleSearch::ModuleResultList const &list, CSwordModuleInfo const *const module, Format const format, bool const addText)
 
bool copyKeyList (QList< CSwordKey * > const &list, Format const format, bool const addText)
 
bool printByHyperlink (QString const &hyperlink, DisplayOptions const &displayOptions, FilterOptions const &filterOptions)
 Prints a key using the hyperlink created by CReferenceManager. More...
 
bool printKey (CSwordKey const *const key, DisplayOptions const &displayOptions, FilterOptions const &filterOptions)
 
bool printKey (CSwordModuleInfo const *const module, QString const &startKey, QString const &stopKey, DisplayOptions const &displayOptions, FilterOptions const &filterOptions)
 
bool printKeyList (CSwordModuleSearch::ModuleResultList const &list, CSwordModuleInfo const *const module, DisplayOptions const &displayOptions, FilterOptions const &filterOptions)
 
bool printKeyList (QStringList const &list, CSwordModuleInfo const *const module, DisplayOptions const &displayOptions, FilterOptions const &filterOptions)
 
bool saveKey (CSwordKey const *const key, Format const format, bool const addText, const BtConstModuleList &modules)
 
bool saveKeyList (CSwordModuleSearch::ModuleResultList const &list, CSwordModuleInfo const *const module, Format const format, bool const addText)
 
bool saveKeyList (QList< CSwordKey * > const &list, Format const format, bool const addText)
 
 ~CExportManager ()
 

Protected Member Functions

const QString getSaveFileName (Format const format)
 

Private Member Functions

void closeProgressDialog ()
 Closes the progress dialog immediately. More...
 
void incProgress ()
 Increments the progress by one item. More...
 
std::unique_ptr< Rendering::CTextRenderingnewRenderer (Format const format, bool const addText)
 
bool progressWasCancelled ()
 
void setProgressRange (int const items)
 

Private Attributes

DisplayOptions const m_displayOptions
 
FilterOptions const m_filterOptions
 
std::unique_ptr< QProgressDialog > const m_progressDialog
 

Detailed Description

Definition at line 31 of file cexportmanager.h.

Member Enumeration Documentation

◆ Format

The format the export actions should have.

Enumerator
HTML 
Text 

Definition at line 36 of file cexportmanager.h.

Constructor & Destructor Documentation

◆ CExportManager()

CExportManager::CExportManager ( const bool  showProgress = true,
const QString &  progressLabel = QString(),
const FilterOptions filterOptions = btConfig().getFilterOptions(),
const DisplayOptions displayOptions = btConfig().getDisplayOptions() 
)

Definition at line 40 of file cexportmanager.cpp.

◆ ~CExportManager()

CExportManager::~CExportManager ( )
default

Member Function Documentation

◆ closeProgressDialog()

void CExportManager::closeProgressDialog ( )
private

Closes the progress dialog immediately.

Closes the progress dialog immediatly.

Definition at line 443 of file cexportmanager.cpp.

References m_progressDialog.

Referenced by copyKeyList(), printKeyList(), and saveKeyList().

◆ copyKey()

bool CExportManager::copyKey ( CSwordKey const *const  key,
Format const  format,
bool const  addText 
)

◆ copyKeyList() [1/2]

bool CExportManager::copyKeyList ( CSwordModuleSearch::ModuleResultList const &  list,
CSwordModuleInfo const *const  module,
Format const  format,
bool const  addText 
)

◆ copyKeyList() [2/2]

bool CExportManager::copyKeyList ( QList< CSwordKey * > const &  list,
Format const  format,
bool const  addText 
)

◆ getSaveFileName()

const QString CExportManager::getSaveFileName ( Format const  format)
protected
Returns
a filename to save a file.

Returns a filename to save a file.

Definition at line 379 of file cexportmanager.cpp.

References anonymous_namespace{btbookshelfworkspage.cpp}::filter(), HTML, and Text.

Referenced by saveKey(), and saveKeyList().

◆ incProgress()

void CExportManager::incProgress ( )
private

Increments the progress by one item.

Increments the progress by one item.

Definition at line 433 of file cexportmanager.cpp.

References m_progressDialog.

Referenced by copyKeyList(), printKeyList(), and saveKeyList().

◆ newRenderer()

std::unique_ptr< CTextRendering > CExportManager::newRenderer ( Format const  format,
bool const  addText 
)
private

◆ printByHyperlink()

bool CExportManager::printByHyperlink ( QString const &  hyperlink,
DisplayOptions const &  displayOptions,
FilterOptions const &  filterOptions 
)

Prints a key using the hyperlink created by CReferenceManager.

Todo:
Verify that items in tree are properly freed.

Definition at line 284 of file cexportmanager.cpp.

References CSwordModuleInfo::Bible, CSwordModuleInfo::Commentary, and ReferenceManager::decodeHyperlink().

Referenced by BtModelViewReadDisplay::print().

◆ printKey() [1/2]

bool CExportManager::printKey ( CSwordKey const *const  key,
DisplayOptions const &  displayOptions,
FilterOptions const &  filterOptions 
)
Todo:
Verify that items in tree are properly freed.

Definition at line 256 of file cexportmanager.cpp.

References CSwordKey::key(), and CSwordKey::module().

Referenced by BtModelViewReadDisplay::print().

◆ printKey() [2/2]

bool CExportManager::printKey ( CSwordModuleInfo const *const  module,
QString const &  startKey,
QString const &  stopKey,
DisplayOptions const &  displayOptions,
FilterOptions const &  filterOptions 
)

Definition at line 267 of file cexportmanager.cpp.

◆ printKeyList() [1/2]

bool CExportManager::printKeyList ( CSwordModuleSearch::ModuleResultList const &  list,
CSwordModuleInfo const *const  module,
DisplayOptions const &  displayOptions,
FilterOptions const &  filterOptions 
)
Todo:
Verify that items in tree are properly freed.

Definition at line 331 of file cexportmanager.cpp.

References closeProgressDialog(), incProgress(), progressWasCancelled(), and setProgressRange().

◆ printKeyList() [2/2]

bool CExportManager::printKeyList ( QStringList const &  list,
CSwordModuleInfo const *const  module,
DisplayOptions const &  displayOptions,
FilterOptions const &  filterOptions 
)
Todo:
Verify that items in tree are properly freed.

Definition at line 355 of file cexportmanager.cpp.

References closeProgressDialog(), incProgress(), progressWasCancelled(), and setProgressRange().

◆ progressWasCancelled()

bool CExportManager::progressWasCancelled ( )
private

Definition at line 438 of file cexportmanager.cpp.

References m_progressDialog.

Referenced by copyKeyList(), printKeyList(), and saveKeyList().

◆ saveKey()

bool CExportManager::saveKey ( CSwordKey const *const  key,
Format const  format,
bool const  addText,
const BtConstModuleList modules 
)

◆ saveKeyList() [1/2]

bool CExportManager::saveKeyList ( CSwordModuleSearch::ModuleResultList const &  list,
CSwordModuleInfo const *const  module,
Format const  format,
bool const  addText 
)

◆ saveKeyList() [2/2]

bool CExportManager::saveKeyList ( QList< CSwordKey * > const &  list,
Format const  format,
bool const  addText 
)

◆ setProgressRange()

void CExportManager::setProgressRange ( int const  items)
private
Returns
the CSS string used in HTML pages.

Definition at line 420 of file cexportmanager.cpp.

References m_progressDialog.

Referenced by copyKeyList(), printKeyList(), and saveKeyList().

Member Data Documentation

◆ m_displayOptions

DisplayOptions const CExportManager::m_displayOptions
private

Definition at line 127 of file cexportmanager.h.

Referenced by newRenderer().

◆ m_filterOptions

FilterOptions const CExportManager::m_filterOptions
private

Definition at line 126 of file cexportmanager.h.

Referenced by newRenderer().

◆ m_progressDialog

std::unique_ptr<QProgressDialog> const CExportManager::m_progressDialog
private

The documentation for this class was generated from the following files: