2006-09-13 11:14:10 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* Copyright (C) 2006 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 OOO_CONVERTER_H
|
|
|
|
#define OOO_CONVERTER_H
|
|
|
|
|
2018-08-31 09:23:45 +00:00
|
|
|
#include <QTextCharFormat>
|
|
|
|
#include <QDomDocument>
|
2006-09-13 11:14:10 +00:00
|
|
|
|
2011-06-01 08:49:49 +00:00
|
|
|
#include <core/textdocumentgenerator.h>
|
2007-01-13 23:59:46 +00:00
|
|
|
|
2006-09-13 11:14:10 +00:00
|
|
|
#include "styleinformation.h"
|
|
|
|
|
2006-09-16 13:18:26 +00:00
|
|
|
class QDomElement;
|
|
|
|
class QDomText;
|
|
|
|
|
2006-09-13 11:14:10 +00:00
|
|
|
namespace OOO {
|
|
|
|
|
2007-01-13 23:59:46 +00:00
|
|
|
class Converter : public Okular::TextDocumentConverter
|
2006-09-16 13:18:26 +00:00
|
|
|
{
|
2016-10-29 14:32:24 +00:00
|
|
|
Q_OBJECT
|
|
|
|
|
2006-09-16 13:18:26 +00:00
|
|
|
public:
|
2007-01-13 23:59:46 +00:00
|
|
|
Converter();
|
2019-12-18 11:51:13 +00:00
|
|
|
~Converter() override;
|
2006-09-13 11:14:10 +00:00
|
|
|
|
2017-03-02 19:38:50 +00:00
|
|
|
Okular::Document::OpenResult convertWithPassword( const QString &fileName, const QString &password ) override;
|
2006-09-13 11:14:10 +00:00
|
|
|
|
2006-09-20 11:48:04 +00:00
|
|
|
private:
|
2006-09-16 13:18:26 +00:00
|
|
|
bool convertBody( const QDomElement &element );
|
|
|
|
bool convertText( const QDomElement &element );
|
|
|
|
bool convertHeader( QTextCursor *cursor, const QDomElement &element );
|
2008-02-28 00:17:34 +00:00
|
|
|
bool convertParagraph( QTextCursor *cursor, const QDomElement &element, const QTextBlockFormat &format = QTextBlockFormat(), bool merge = false );
|
2006-09-16 13:18:26 +00:00
|
|
|
bool convertTextNode( QTextCursor *cursor, const QDomText &element, const QTextCharFormat &format );
|
|
|
|
bool convertSpan( QTextCursor *cursor, const QDomElement &element, const QTextCharFormat &format );
|
2006-09-20 11:48:04 +00:00
|
|
|
bool convertLink( QTextCursor *cursor, const QDomElement &element, const QTextCharFormat &format );
|
2009-01-06 06:48:28 +00:00
|
|
|
bool convertList( QTextCursor *cursor, const QDomElement &element );
|
2006-09-16 13:18:26 +00:00
|
|
|
bool convertTable( const QDomElement &element );
|
2006-09-16 15:52:00 +00:00
|
|
|
bool convertFrame( const QDomElement &element );
|
2006-11-29 16:43:55 +00:00
|
|
|
bool convertAnnotation( QTextCursor *cursor, const QDomElement &element );
|
2006-09-13 11:14:10 +00:00
|
|
|
|
|
|
|
QTextDocument *mTextDocument;
|
|
|
|
QTextCursor *mCursor;
|
|
|
|
|
|
|
|
StyleInformation *mStyleInformation;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|