diff --git a/CMakeLists.txt b/CMakeLists.txt index e1b205f7f..8250b0ede 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,6 +42,7 @@ set(okularcore_SRCS core/pagetransition.cpp core/rotationjob.cpp core/sound.cpp + core/sourcereference.cpp core/textpage.cpp core/utils.cpp ) diff --git a/core/document.cpp b/core/document.cpp index 0b9815cfb..116d9f97a 100644 --- a/core/document.cpp +++ b/core/document.cpp @@ -32,15 +32,16 @@ // local includes #include "bookmarkmanager.h" #include "chooseenginedialog.h" +#include "configinterface.h" #include "document.h" #include "generator.h" +#include "guiinterface.h" #include "link.h" #include "observer.h" #include "page.h" -#include "settings.h" #include "printinterface.h" -#include "guiinterface.h" -#include "configinterface.h" +#include "settings.h" +#include "sourcereference.h" using namespace Okular; diff --git a/core/generator.cpp b/core/generator.cpp index 0b2f3977d..628ecea8d 100644 --- a/core/generator.cpp +++ b/core/generator.cpp @@ -289,47 +289,6 @@ KIcon ExportFormat::icon() const return d->mIcon; } -class SourceReference::Private -{ - public: - Private() - : row( 0 ), column( 0 ) - { - } - - QString filename; - int row; - int column; -}; - -SourceReference::SourceReference( const QString &fileName, int row, int column ) - : d( new Private ) -{ - d->filename = fileName; - d->row = row; - d->column = column; -} - -SourceReference::~SourceReference() -{ - delete d; -} - -QString SourceReference::fileName() const -{ - return d->filename; -} - -int SourceReference::row() const -{ - return d->row; -} - -int SourceReference::column() const -{ - return d->column; -} - kdbgstream& operator<<( kdbgstream &str, const Okular::PixmapRequest &req ) { QString s = QString( "%1 PixmapRequest (id: %2) (%3x%4), prio %5, pageNo %6" ) diff --git a/core/generator.h b/core/generator.h index 47bdecdef..7cb06f2b4 100644 --- a/core/generator.h +++ b/core/generator.h @@ -215,14 +215,11 @@ class OKULAR_EXPORT Generator : public QObject /** * This enum identifies the metric of the page size. - * - * @li None - page size is not defined in a physical metric - * @li Points - page size is given in 1/72 inches */ enum PageSizeMetric { - None, - Points + None, ///< The page size is not defined in a physical metric. + Points ///< The page size is given in 1/72 inches. }; /** @@ -424,43 +421,6 @@ class OKULAR_EXPORT PixmapRequest Private* const d; }; -/** - * @short Defines a source reference - * - * A source reference is a reference to one of the source(s) of the loaded - * document. - */ -class OKULAR_EXPORT SourceReference -{ - public: - /** - * Creates a reference to the row @p row and column @p column of the - * source @p fileName - */ - SourceReference( const QString &fileName, int row, int column = 0 ); - - ~SourceReference(); - - /** - * Returns the filename of the source. - */ - QString fileName() const; - - /** - * Returns the row of the position in the source file. - */ - int row() const; - - /** - * Returns the column of the position in the source file. - */ - int column() const; - - private: - class Private; - Private* const d; -}; - } kdbgstream& operator<<( kdbgstream &str, const Okular::PixmapRequest &req ); diff --git a/core/sourcereference.cpp b/core/sourcereference.cpp new file mode 100644 index 000000000..0a93d2446 --- /dev/null +++ b/core/sourcereference.cpp @@ -0,0 +1,56 @@ +/*************************************************************************** + * Copyright (C) 2007 by Pino Toscano * + * * + * 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. * + ***************************************************************************/ + +#include + +#include "sourcereference.h" + +using namespace Okular; + +class SourceReference::Private +{ + public: + Private() + : row( 0 ), column( 0 ) + { + } + + QString filename; + int row; + int column; +}; + +SourceReference::SourceReference( const QString &fileName, int row, int column ) + : d( new Private ) +{ + d->filename = fileName; + d->row = row; + d->column = column; +} + +SourceReference::~SourceReference() +{ + delete d; +} + +QString SourceReference::fileName() const +{ + return d->filename; +} + +int SourceReference::row() const +{ + return d->row; +} + +int SourceReference::column() const +{ + return d->column; +} + diff --git a/core/sourcereference.h b/core/sourcereference.h new file mode 100644 index 000000000..1f44f037a --- /dev/null +++ b/core/sourcereference.h @@ -0,0 +1,62 @@ +/*************************************************************************** + * Copyright (C) 2007 by Pino Toscano * + * * + * 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_SOURCEREFERENCE_H +#define OKULAR_SOURCEREFERENCE_H + +#include "okular_export.h" + +class QString; + +namespace Okular { + +/** + * @short Defines a source reference + * + * A source reference is a reference to one of the source(s) of the loaded + * document. + */ +class OKULAR_EXPORT SourceReference +{ + public: + /** + * Creates a reference to the row @p row and column @p column of the + * source @p fileName + */ + SourceReference( const QString &fileName, int row, int column = 0 ); + + /** + * Destroys the source reference. + */ + ~SourceReference(); + + /** + * Returns the filename of the source. + */ + QString fileName() const; + + /** + * Returns the row of the position in the source file. + */ + int row() const; + + /** + * Returns the column of the position in the source file. + */ + int column() const; + + private: + class Private; + Private* const d; +}; + +} + +#endif + diff --git a/generators/dvi/generator_dvi.cpp b/generators/dvi/generator_dvi.cpp index c255eb6d4..48d9f8bdf 100644 --- a/generators/dvi/generator_dvi.cpp +++ b/generators/dvi/generator_dvi.cpp @@ -10,6 +10,7 @@ #include "generator_dvi.h" #include "core/page.h" #include "core/link.h" +#include "core/sourcereference.h" #include "core/utils.h" #include "dviFile.h" #include "dviPageInfo.h" diff --git a/generators/poppler/generator_pdf.cpp b/generators/poppler/generator_pdf.cpp index cd5bb589c..2583a38d9 100644 --- a/generators/poppler/generator_pdf.cpp +++ b/generators/poppler/generator_pdf.cpp @@ -29,6 +29,7 @@ #include "core/annotations.h" #include "core/pagetransition.h" #include "core/sound.h" +#include "core/sourcereference.h" #include "settings.h" #include