Moved SourceReference into its own file

svn path=/trunk/playground/graphics/okular/; revision=619076
remotes/origin/KDE/4.0
Tobias Koenig 19 years ago
parent 472f4028c2
commit 2aa8a4c31b
  1. 1
      CMakeLists.txt
  2. 7
      core/document.cpp
  3. 41
      core/generator.cpp
  4. 44
      core/generator.h
  5. 56
      core/sourcereference.cpp
  6. 62
      core/sourcereference.h
  7. 1
      generators/dvi/generator_dvi.cpp
  8. 1
      generators/poppler/generator_pdf.cpp

@ -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
)

@ -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;

@ -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" )

@ -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 );

@ -0,0 +1,56 @@
/***************************************************************************
* Copyright (C) 2007 by Pino Toscano <pino@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. *
***************************************************************************/
#include <QtCore/QString>
#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;
}

@ -0,0 +1,62 @@
/***************************************************************************
* Copyright (C) 2007 by Pino Toscano <pino@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_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

@ -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"

@ -29,6 +29,7 @@
#include "core/annotations.h"
#include "core/pagetransition.h"
#include "core/sound.h"
#include "core/sourcereference.h"
#include "settings.h"
#include <config.h>

Loading…
Cancel
Save