generator_plucker.h 2 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12
/***************************************************************************
 *   Copyright (C) 2007 by Tobias Koenig <tokoe@kde.org>                   *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 ***************************************************************************/

#ifndef _OKULAR_GENERATOR_PLUCKER_H_
#define _OKULAR_GENERATOR_PLUCKER_H_

13 14
#include <core/document.h>
#include <core/generator.h>
15

Pino Toscano's avatar
Pino Toscano committed
16 17
#include <QtGui/QTextBlock>

18 19 20 21 22 23 24
#include "qunpluck.h"

class QTextDocument;

class PluckerGenerator : public Okular::Generator
{
    Q_OBJECT
25
    Q_INTERFACES( Okular::Generator )
26 27

    public:
28
        PluckerGenerator( QObject *parent, const QVariantList &args );
29 30 31
        virtual ~PluckerGenerator();

        // [INHERITED] load a document and fill up the pagesVector
32
        bool loadDocument( const QString & fileName, QVector<Okular::Page*> & pagesVector ) override;
33 34

        // [INHERITED] document information
35
        Okular::DocumentInfo generateDocumentInfo( const QSet<Okular::DocumentInfo::Key> &keys ) const override;
36 37
        
        // [INHERITED] perform actions on document / pages
38
        QImage image( Okular::PixmapRequest *request ) override;
39 40

        // [INHERITED] text exporting
41 42
        Okular::ExportFormat::List exportFormats() const override;
        bool exportTo( const QString &fileName, const Okular::ExportFormat &format ) override;
43 44

        // [INHERITED] print document using already configured kprinter
45
        bool print( QPrinter& printer ) override;
46

47
    protected:
48
        bool doCloseDocument() override;
49

50 51 52 53 54 55 56 57
    private:
      QList<QTextDocument*> mPages;
      QSet<int> mLinkAdded;
      Link::List mLinks;
      Okular::DocumentInfo mDocumentInfo;
};

#endif