|
|
|
|
@ -15,6 +15,7 @@ |
|
|
|
|
#include <QtGui/QColor> |
|
|
|
|
|
|
|
|
|
// local includes
|
|
|
|
|
#include "document.h" |
|
|
|
|
#include "page_p.h" |
|
|
|
|
|
|
|
|
|
using namespace Okular; |
|
|
|
|
@ -2145,3 +2146,87 @@ void CaretAnnotation::store( QDomNode & node, QDomDocument & document ) const |
|
|
|
|
if ( d->m_symbol != None ) |
|
|
|
|
caretElement.setAttribute( "symbol", caretSymbolToString( d->m_symbol ) ); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** FileAttachmentAnnotation [Annotation] */ |
|
|
|
|
|
|
|
|
|
class Okular::FileAttachmentAnnotationPrivate : public Okular::AnnotationPrivate |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
FileAttachmentAnnotationPrivate() |
|
|
|
|
: AnnotationPrivate(), icon( "PushPin" ), embfile( 0 ) |
|
|
|
|
{ |
|
|
|
|
} |
|
|
|
|
~FileAttachmentAnnotationPrivate() |
|
|
|
|
{ |
|
|
|
|
delete embfile; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// data fields
|
|
|
|
|
QString icon; |
|
|
|
|
EmbeddedFile *embfile; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
FileAttachmentAnnotation::FileAttachmentAnnotation() |
|
|
|
|
: Annotation( *new FileAttachmentAnnotationPrivate() ) |
|
|
|
|
{ |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
FileAttachmentAnnotation::FileAttachmentAnnotation( const QDomNode & node ) |
|
|
|
|
: Annotation( *new FileAttachmentAnnotationPrivate(), node ) |
|
|
|
|
{ |
|
|
|
|
// loop through the whole children looking for a 'fileattachment' element
|
|
|
|
|
QDomNode subNode = node.firstChild(); |
|
|
|
|
while( subNode.isElement() ) |
|
|
|
|
{ |
|
|
|
|
QDomElement e = subNode.toElement(); |
|
|
|
|
subNode = subNode.nextSibling(); |
|
|
|
|
if ( e.tagName() != "fileattachment" ) |
|
|
|
|
continue; |
|
|
|
|
|
|
|
|
|
// loading complete
|
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
FileAttachmentAnnotation::~FileAttachmentAnnotation() |
|
|
|
|
{ |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void FileAttachmentAnnotation::store( QDomNode & node, QDomDocument & document ) const |
|
|
|
|
{ |
|
|
|
|
// recurse to parent objects storing properties
|
|
|
|
|
Annotation::store( node, document ); |
|
|
|
|
|
|
|
|
|
// create [fileattachment] element
|
|
|
|
|
QDomElement fileAttachmentElement = document.createElement( "fileattachment" ); |
|
|
|
|
node.appendChild( fileAttachmentElement ); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Annotation::SubType FileAttachmentAnnotation::subType() const |
|
|
|
|
{ |
|
|
|
|
return AFileAttachment; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
QString FileAttachmentAnnotation::fileIconName() const |
|
|
|
|
{ |
|
|
|
|
Q_D( const FileAttachmentAnnotation ); |
|
|
|
|
return d->icon; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void FileAttachmentAnnotation::setFileIconName( const QString &icon ) |
|
|
|
|
{ |
|
|
|
|
Q_D( FileAttachmentAnnotation ); |
|
|
|
|
d->icon = icon; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
EmbeddedFile* FileAttachmentAnnotation::embeddedFile() const |
|
|
|
|
{ |
|
|
|
|
Q_D( const FileAttachmentAnnotation ); |
|
|
|
|
return d->embfile; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void FileAttachmentAnnotation::setEmbeddedFile( EmbeddedFile *ef ) |
|
|
|
|
{ |
|
|
|
|
Q_D( FileAttachmentAnnotation ); |
|
|
|
|
d->embfile = ef; |
|
|
|
|
} |
|
|
|
|
|