~ubuntu-branches/ubuntu/jaunty/bibletime/jaunty

« back to all changes in this revision

Viewing changes to bibletime/frontend/cexportmanager.h

  • Committer: Bazaar Package Importer
  • Author(s): Ralph Janke
  • Date: 2008-05-10 15:18:16 UTC
  • mfrom: (1.1.6 upstream) (3.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080510151816-bqp8y1to705zd0fm
Tags: 1.6.5.1-1
* New upstream version (Closes: #441161, #271502)
* fixes for new autotools and gcc 4.3 (Closes: #407291)
* added poxml to Build-Depends
* No DFSG necessary anymore since biblestudy howto has 
  now Commons Licence 
* Added libclucene-dev to dev-depends (Closes: #436677)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*********
 
2
*
 
3
* This file is part of BibleTime's source code, http://www.bibletime.info/.
 
4
*
 
5
* Copyright 1999-2006 by the BibleTime developers.
 
6
* The BibleTime source code is licensed under the GNU General Public License version 2.0.
 
7
*
 
8
**********/
 
9
 
 
10
 
 
11
 
 
12
#ifndef CEXPORTMANAGER_H
 
13
#define CEXPORTMANAGER_H
 
14
 
 
15
//BibleTime includes
 
16
#include "backend/cswordbackend.h"
 
17
#include "cbtconfig.h"
 
18
 
 
19
#include "util/cpointers.h"
 
20
 
 
21
//Qt includes
 
22
#include <qstring.h>
 
23
#include <qptrlist.h>
 
24
 
 
25
class ListKey;
 
26
class CSwordKey;
 
27
class CSwordModuleInfo;
 
28
class QProgressDialog;
 
29
 
 
30
/** Contains the functions to export text to disk, clipboard or printer.
 
31
  * @author The BibleTime team
 
32
  */
 
33
class CExportManager : CPointers {
 
34
public:
 
35
        /** The format the export actions should have
 
36
        */
 
37
        enum Format {
 
38
                HTML,
 
39
                Text
 
40
        };
 
41
 
 
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());
 
43
 
 
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 );
 
47
 
 
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 );
 
51
 
 
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);
 
57
        
 
58
protected: // Protected methods
 
59
        /**
 
60
        * Returns the string for the filedialogs to show the correct files.
 
61
        */
 
62
        const QString filterString( const Format format );
 
63
        /**
 
64
        * Returns a filename to save a file.
 
65
        */
 
66
        const QString getSaveFileName(const Format format);
 
67
        /**
 
68
        * Returns a string containing the linebreak for the current format.
 
69
        */
 
70
        const QString lineBreak( const Format format );
 
71
 
 
72
private:
 
73
        QString m_caption;
 
74
        QString m_progressLabel;
 
75
        bool m_showProgress;
 
76
        CSwordBackend::FilterOptions m_filterOptions;
 
77
        CSwordBackend::DisplayOptions m_displayOptions;
 
78
 
 
79
        QProgressDialog* m_progressDialog;
 
80
 
 
81
        /**
 
82
        * Creates the progress dialog with the correct settings.
 
83
        */
 
84
        QProgressDialog* const progressDialog();
 
85
        /**
 
86
        * Returns the CSS string used in HTML pages.
 
87
        */
 
88
        void setProgressRange( const int item );
 
89
        /**
 
90
        * Increments the progress by one item.
 
91
        */
 
92
        inline void incProgress();
 
93
        const bool progressWasCancelled();
 
94
        /**
 
95
        * Closes the progress dialog immediatly.
 
96
        */
 
97
        void closeProgressDialog();
 
98
};
 
99
 
 
100
#endif