summaryrefslogtreecommitdiff
path: root/sdext/source/pdfimport/inc/pdfparse.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'sdext/source/pdfimport/inc/pdfparse.hxx')
-rw-r--r--sdext/source/pdfimport/inc/pdfparse.hxx46
1 files changed, 23 insertions, 23 deletions
diff --git a/sdext/source/pdfimport/inc/pdfparse.hxx b/sdext/source/pdfimport/inc/pdfparse.hxx
index 6dae97c309b7..76db849b6b30 100644
--- a/sdext/source/pdfimport/inc/pdfparse.hxx
+++ b/sdext/source/pdfimport/inc/pdfparse.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -48,15 +48,15 @@ class EmitContext
virtual unsigned int getCurPos() = 0;
virtual bool copyOrigBytes( unsigned int nOrigOffset, unsigned int nLen ) = 0;
virtual unsigned int readOrigBytes( unsigned int nOrigOffset, unsigned int nLen, void* pBuf ) = 0;
-
+
EmitContext( const PDFContainer* pTop = NULL );
virtual ~EmitContext();
-
+
// set this to deflate contained streams
bool m_bDeflate;
// set this to decrypt the PDF file
bool m_bDecrypt;
-
+
private:
friend struct PDFEntry;
EmitImplData* m_pImplData;
@@ -66,10 +66,10 @@ struct PDFEntry
{
PDFEntry() {}
virtual ~PDFEntry();
-
+
virtual bool emit( EmitContext& rWriteContext ) const = 0;
virtual PDFEntry* clone() const = 0;
-
+
protected:
EmitImplData* getEmitData( EmitContext& rContext ) const;
void setEmitData( EmitContext& rContext, EmitImplData* pNewEmitData ) const;
@@ -102,7 +102,7 @@ struct PDFName : public PDFValue
virtual ~PDFName();
virtual bool emit( EmitContext& rWriteContext ) const;
virtual PDFEntry* clone() const;
-
+
rtl::OUString getFilteredName() const;
};
@@ -115,7 +115,7 @@ struct PDFString : public PDFValue
virtual ~PDFString();
virtual bool emit( EmitContext& rWriteContext ) const;
virtual PDFEntry* clone() const;
-
+
rtl::OString getFilteredString() const;
};
@@ -145,7 +145,7 @@ struct PDFObjectRef : public PDFValue
{
unsigned int m_nNumber;
unsigned int m_nGeneration;
-
+
PDFObjectRef( unsigned int nNr, unsigned int nGen )
: PDFValue(), m_nNumber( nNr ), m_nGeneration( nGen ) {}
virtual ~PDFObjectRef();
@@ -173,7 +173,7 @@ struct PDFContainer : public PDFEntry
virtual ~PDFContainer();
virtual bool emitSubElements( EmitContext& rWriteContext ) const;
virtual void cloneSubElements( std::vector<PDFEntry*>& rNewSubElements ) const;
-
+
PDFObject* findObject( unsigned int nNumber, unsigned int nGeneration ) const;
PDFObject* findObject( PDFObjectRef* pRef ) const
{ return findObject( pRef->m_nNumber, pRef->m_nGeneration ); }
@@ -191,12 +191,12 @@ struct PDFDict : public PDFContainer
{
typedef std::hash_map<rtl::OString,PDFEntry*,rtl::OStringHash> Map;
Map m_aMap;
-
+
PDFDict() {}
virtual ~PDFDict();
virtual bool emit( EmitContext& rWriteContext ) const;
virtual PDFEntry* clone() const;
-
+
// inserting a value of NULL will remove rName and the previous value
// from the dictionary
void insertValue( const rtl::OString& rName, PDFEntry* pValue );
@@ -212,20 +212,20 @@ struct PDFStream : public PDFEntry
unsigned int m_nBeginOffset;
unsigned int m_nEndOffset; // offset of the byte after the stream
PDFDict* m_pDict;
-
+
PDFStream( unsigned int nBegin, unsigned int nEnd, PDFDict* pStreamDict )
: PDFEntry(), m_nBeginOffset( nBegin ), m_nEndOffset( nEnd ), m_pDict( pStreamDict ) {}
virtual ~PDFStream();
virtual bool emit( EmitContext& rWriteContext ) const;
virtual PDFEntry* clone() const;
-
+
unsigned int getDictLength( const PDFContainer* pObjectContainer = NULL ) const; // get contents of the "Length" entry of the dict
};
struct PDFTrailer : public PDFContainer
{
PDFDict* m_pDict;
-
+
PDFTrailer() : PDFContainer(), m_pDict( NULL ) {}
virtual ~PDFTrailer();
virtual bool emit( EmitContext& rWriteContext ) const;
@@ -241,23 +241,23 @@ struct PDFFile : public PDFContainer
public:
unsigned int m_nMajor; // PDF major
unsigned int m_nMinor; // PDF minor
-
+
PDFFile()
: PDFContainer(),
m_pData( NULL ),
m_nMajor( 0 ), m_nMinor( 0 )
{}
virtual ~PDFFile();
-
+
virtual bool emit( EmitContext& rWriteContext ) const;
virtual PDFEntry* clone() const;
-
+
bool isEncrypted() const;
// this method checks whether rPwd is compatible with
// either user or owner password and sets up decrypt data in that case
// returns true if decryption can be done
bool setupDecryptionData( const rtl::OString& rPwd ) const;
-
+
bool decrypt( const sal_uInt8* pInBuffer, sal_uInt32 nLen,
sal_uInt8* pOutBuffer,
unsigned int nObject, unsigned int nGeneration ) const;
@@ -269,16 +269,16 @@ struct PDFObject : public PDFContainer
PDFStream* m_pStream;
unsigned int m_nNumber;
unsigned int m_nGeneration;
-
+
PDFObject( unsigned int nNr, unsigned int nGen )
: m_pObject( NULL ), m_pStream( NULL ), m_nNumber( nNr ), m_nGeneration( nGen ) {}
virtual ~PDFObject();
virtual bool emit( EmitContext& rWriteContext ) const;
virtual PDFEntry* clone() const;
-
+
// writes only the contained stream, deflated if necessary
bool writeStream( EmitContext& rContext, const PDFFile* pPDFFile ) const;
-
+
private:
// returns true if stream is deflated
// fills *ppStream and *pBytes with start of stream and count of bytes
@@ -300,7 +300,7 @@ class PDFReader
public:
PDFReader() {}
~PDFReader() {}
-
+
PDFEntry* read( const char* pFileName );
PDFEntry* read( const char* pBuffer, unsigned int nLen );
};