svn path=/trunk/playground/graphics/okular/; revision=619076remotes/origin/KDE/4.0
parent
472f4028c2
commit
2aa8a4c31b
8 changed files with 127 additions and 86 deletions
@ -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 |
||||
|
||||
Loading…
Reference in new issue