okular
textdocumentgenerator.cpp
Go to the documentation of this file.
48 DocumentViewport TextDocumentConverter::calculateViewport( QTextDocument *document, const QTextBlock &block )
89 textPage->append( text, new Okular::NormalizedRect( rect.left(), rect.top(), rect.right(), rect.bottom() ) );
113 void TextDocumentGeneratorPrivate::addAnnotation( Annotation *annotation, int cursorBegin, int cursorEnd )
128 void TextDocumentGeneratorPrivate::addTitle( int level, const QString &title, const QTextBlock &block )
138 void TextDocumentGeneratorPrivate::addMetaData( const QString &key, const QString &value, const QString &title )
156 TextDocumentUtils::calculateBoundingRect( mDocument, linkPosition.startPosition, linkPosition.endPosition,
172 TextDocumentUtils::calculateBoundingRect( mDocument, annotationPosition.startPosition, annotationPosition.endPosition,
191 Okular::DocumentViewport viewport = TextDocumentUtils::calculateViewport( mDocument, position.block );
253 TextDocumentGenerator::TextDocumentGenerator( TextDocumentConverter *converter, const QString& configName, QObject *parent, const QVariantList &args )
262 TextDocumentGenerator::TextDocumentGenerator( TextDocumentConverter *converter, QObject *parent, const QVariantList &args )
274 bool TextDocumentGenerator::loadDocument( const QString & fileName, QVector<Okular::Page*> & pagesVector )
288 Q_FOREACH ( const TextDocumentGeneratorPrivate::AnnotationPosition &annPos, d->mAnnotationPositions )
314 objects[ info.page ].append( new Okular::ObjectRect( rect.left(), rect.top(), rect.right(), rect.bottom(), false,
331 QLinkedList<Okular::Annotation*>::ConstIterator annIt = annots.at( i ).begin(), annEnd = annots.at( i ).end();
438 QVariant TextDocumentGeneratorPrivate::metaData( const QString &key, const QVariant &option ) const
456 formats.append( Okular::ExportFormat::standardFormat( Okular::ExportFormat::OpenDocumentText ) );
467 bool TextDocumentGenerator::exportTo( const QString &fileName, const Okular::ExportFormat &format )
494 } else if ( format.mimeType()->name() == QLatin1String( "application/vnd.oasis.opendocument.text" ) ) {
const Okular::DocumentSynopsis * generateDocumentSynopsis()
Returns the 'table of content' object of the document or 0 if no table of content is available...
Definition: textdocumentgenerator.cpp:429
static void calculateBoundingRect(QTextDocument *document, int startPosition, int endPosition, QRectF &rect, int &page)
Definition: textdocumentgenerator_p.h:26
Whether the Generator supports export to PDF & PS through the Print Dialog.
Definition: generator.h:208
Okular::TextPage * createTextPage(int) const
Generic Generator Implementation.
Definition: textdocumentgenerator.cpp:61
static void calculatePositions(QTextDocument *document, int page, int &start, int &end)
Definition: textdocumentgenerator_p.h:69
void addMetaData(const QString &key, const QString &value, const QString &title)
Definition: textdocumentgenerator.cpp:138
QRectF boundingRect
Definition: textdocumentgenerator_p.h:173
QList< AnnotationInfo > mAnnotationInfos
Definition: textdocumentgenerator_p.h:192
Action * link
Definition: textdocumentgenerator_p.h:166
The TextPage class represents the text of a page by providing.
Definition: textpage.h:90
QList< LinkPosition > mLinkPositions
Definition: textdocumentgenerator_p.h:168
QRectF boundingRect
Definition: textdocumentgenerator_p.h:189
virtual bool canGeneratePixmap() const
This method returns whether the generator is ready to handle a new pixmap request.
Definition: generator.cpp:211
int startPosition
Definition: textdocumentgenerator_p.h:180
Annotation * annotation
Definition: textdocumentgenerator_p.h:190
void addTitle(int level, const QString &title, const QTextBlock &position)
Definition: textdocumentgenerator.cpp:128
bool doCloseDocument()
This method is called when the document is closed and not used any longer.
Definition: textdocumentgenerator.cpp:340
NormalizedRect is a helper class which stores the coordinates of a normalized rect, which is a rectangle of.
Definition: area.h:105
QList< LinkInfo > mLinkInfos
Definition: textdocumentgenerator_p.h:176
void addAnnotation(Annotation *annotation, int cursorBegin, int cursorEnd)
Definition: textdocumentgenerator.cpp:113
DocumentViewport calculateViewport(QTextDocument *document, const QTextBlock &block)
This method can be used to calculate the viewport for a given text block.
Definition: textdocumentgenerator.cpp:48
TextDocumentSettings * generalSettings()
Config skeleton for TextDocumentSettingsWidget.
Definition: textdocumentgenerator.cpp:526
bool loadDocument(const QString &fileName, QVector< Okular::Page * > &pagesVector)
Definition: textdocumentgenerator.cpp:274
TextDocumentGeneratorPrivate * mParent
Definition: textdocumentgenerator_p.h:108
QVariant metaData(const QString &key, const QVariant &option) const
Definition: textdocumentgenerator.cpp:438
static Okular::DocumentViewport calculateViewport(QTextDocument *document, const QTextBlock &block)
Definition: textdocumentgenerator_p.h:82
Definition: generator.h:201
Okular::TextPage * textPage(Okular::Page *page)
Returns the text page for the given page.
Definition: textdocumentgenerator.cpp:406
int page
Definition: textdocumentgenerator_p.h:172
static ExportFormat standardFormat(StandardExportFormat type)
Builds a standard format for the specified type .
Definition: generator.cpp:582
QString get(const QString &key) const
Returns the value for a given key or an empty string when the key doesn't exist.
Definition: document.cpp:4657
void addPages(KConfigDialog *dlg)
Does nothing by default. You need to reimplement it in your generator.
Definition: textdocumentgenerator.cpp:520
void setObjectRects(const QLinkedList< ObjectRect * > &rects)
Sets the list of object rects of the page.
Definition: page.cpp:564
virtual ~TextDocumentGenerator()
Definition: textdocumentgenerator.cpp:270
QTextDocument * mDocument
Definition: textdocumentgenerator_p.h:150
TextDocumentSettings * mGeneralSettings
Definition: textdocumentgenerator_p.h:194
bool reparseConfig()
By default checks if the default font has changed or not.
Definition: textdocumentgenerator.cpp:507
QList< AnnotationPosition > mAnnotationPositions
Definition: textdocumentgenerator_p.h:184
Annotation * annotation
Definition: textdocumentgenerator_p.h:182
int endPosition
Definition: textdocumentgenerator_p.h:165
void generateTitleInfos()
Definition: textdocumentgenerator.cpp:180
int page
Definition: textdocumentgenerator_p.h:188
Okular::DocumentInfo mDocumentInfo
Definition: textdocumentgenerator_p.h:151
Action * link
Definition: textdocumentgenerator_p.h:174
int level
Definition: textdocumentgenerator_p.h:156
TextDocumentConverter * mConverter
Definition: textdocumentgenerator_p.h:148
Whether the Generator supports native cross-platform printing (QPainter-based).
Definition: generator.h:206
A DOM tree containing information about the document.
Definition: document.h:1073
TextDocumentGenerator(TextDocumentConverter *converter, const QString &configName, QObject *parent, const QVariantList &args)
Creates a new generator that uses the specified converter.
Definition: textdocumentgenerator.cpp:253
const Okular::DocumentInfo * generateDocumentInfo()
Returns the general information object of the document or 0 if no information are available...
Definition: textdocumentgenerator.cpp:423
void addAction(Action *action, int cursorBegin, int cursorEnd)
Definition: textdocumentgenerator.cpp:100
void set(const QString &key, const QString &value, const QString &title=QString())
Sets a value for a special key.
Definition: document.cpp:4628
QList< TitlePosition > mTitlePositions
Definition: textdocumentgenerator_p.h:160
void generateLinkInfos()
Definition: textdocumentgenerator.cpp:148
Annotation struct holds properties shared by all annotations.
Definition: annotations.h:90
void initializeGenerator()
Definition: textdocumentgenerator.cpp:216
void generateAnnotationInfos()
Definition: textdocumentgenerator.cpp:164
int startPosition
Definition: textdocumentgenerator_p.h:164
virtual void generatePixmap(PixmapRequest *request)
This method can be called to trigger the generation of a new pixmap as described by request...
Definition: generator.cpp:217
QString title
Definition: textdocumentgenerator_p.h:157
int endPosition
Definition: textdocumentgenerator_p.h:181
bool print(QPrinter &printer)
This method is called to print the document to the given printer.
Definition: textdocumentgenerator.cpp:412
Whether the Generator can extract text from the document in the form of TextPage's.
Definition: generator.h:202
bool exportTo(const QString &fileName, const Okular::ExportFormat &format)
This method is called to export the document in the given format and save it under the given fileName...
Definition: textdocumentgenerator.cpp:467
void addAnnotation(Annotation *annotation)
Adds a new annotation to the page.
Definition: page.cpp:641
QTextBlock block
Definition: textdocumentgenerator_p.h:158
Okular::DocumentSynopsis mDocumentSynopsis
Definition: textdocumentgenerator_p.h:152
A DOM tree that describes the Table of Contents.
Definition: document.h:1154
void append(const QString &text, NormalizedRect *area)
Appends the given text with the given area as new TextEntity to the page.
Definition: textpage.cpp:239
Okular::ExportFormat::List exportFormats() const
Returns the list of additional supported export formats.
Definition: textdocumentgenerator.cpp:448
void generatePixmap(Okular::PixmapRequest *request)
This method can be called to trigger the generation of a new pixmap as described by request...
Definition: textdocumentgenerator.cpp:363
TextDocumentGenerator * generator() const
Returns the generator that owns this converter.
Definition: textdocumentgenerator.cpp:53
QImage image(PixmapRequest *)
Definition: textdocumentgenerator.cpp:368
bool canGeneratePixmap() const
This method returns whether the generator is ready to handle a new pixmap request.
Definition: textdocumentgenerator.cpp:358
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:45:03 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:45:03 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.