svn path=/trunk/playground/graphics/okular/; revision=617097remotes/origin/KDE/4.0
parent
8add3d7863
commit
48a772be4b
6 changed files with 81 additions and 44 deletions
@ -0,0 +1,51 @@ |
||||
/***************************************************************************
|
||||
* Copyright (C) 2006 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. * |
||||
***************************************************************************/ |
||||
|
||||
// qt/kde includes
|
||||
#include <klocale.h> |
||||
|
||||
// local includes
|
||||
#include "annotationguiutils.h" |
||||
#include "core/annotations.h" |
||||
|
||||
QString AnnotationGuiUtils::captionForAnnotation( Okular::Annotation * ann ) |
||||
{ |
||||
if ( !ann ) |
||||
return QString(); |
||||
|
||||
QString ret; |
||||
switch( ann->subType() ) |
||||
{ |
||||
case Okular::Annotation::AText: |
||||
if( ( (Okular::TextAnnotation*)ann )->textType() == Okular::TextAnnotation::Linked ) |
||||
ret = i18n( "Note" ); |
||||
else |
||||
ret = i18n( "FreeText" ); |
||||
break; |
||||
case Okular::Annotation::ALine: |
||||
ret = i18n( "Line" ); |
||||
break; |
||||
case Okular::Annotation::AGeom: |
||||
ret = i18n( "Geom" ); |
||||
break; |
||||
case Okular::Annotation::AHighlight: |
||||
ret = i18n( "Highlight" ); |
||||
break; |
||||
case Okular::Annotation::AStamp: |
||||
ret = i18n( "Stamp" ); |
||||
break; |
||||
case Okular::Annotation::AInk: |
||||
ret = i18n( "Ink" ); |
||||
break; |
||||
case Okular::Annotation::A_BASE: |
||||
break; |
||||
} |
||||
return ret; |
||||
} |
||||
|
||||
@ -0,0 +1,27 @@ |
||||
/***************************************************************************
|
||||
* Copyright (C) 2006 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 ANNOTATIONGUIUTILS_H |
||||
#define ANNOTATIONGUIUTILS_H |
||||
|
||||
namespace Okular { |
||||
class Annotation; |
||||
} |
||||
|
||||
class AnnotationGuiUtils |
||||
{ |
||||
public: |
||||
/**
|
||||
* Returns the translated string with the type of the given @p annotation. |
||||
*/ |
||||
static QString captionForAnnotation( Okular::Annotation * annotation ); |
||||
}; |
||||
|
||||
|
||||
#endif |
||||
Loading…
Reference in new issue