12#ifndef _PDF_OBJECTS_H_
13#define _PDF_OBJECTS_H_
16#include <wx/dynarray.h>
17#include <wx/mstream.h>
24#define OBJTYPE_BOOLEAN 2
25#define OBJTYPE_NUMBER 3
26#define OBJTYPE_STRING 4
28#define OBJTYPE_ARRAY 6
29#define OBJTYPE_DICTIONARY 7
30#define OBJTYPE_STREAM 8
31#define OBJTYPE_INDIRECT 9
57 void SetObjNum(
int objNum,
int objGen = 0);
105 bool IsNull() {
return (m_type == OBJTYPE_NULL); }
111 bool IsBoolean() {
return (m_type == OBJTYPE_BOOLEAN); }
117 bool IsNumber() {
return (m_type == OBJTYPE_NUMBER); }
123 bool IsString() {
return (m_type == OBJTYPE_STRING); }
129 bool IsName() {
return (m_type == OBJTYPE_NAME); }
135 bool IsArray() {
return (m_type == OBJTYPE_ARRAY); }
147 bool IsStream() {
return (m_type == OBJTYPE_STREAM); }
236 wxString GetAsString();
385 void Add(
double value);
398 size_t GetSize() {
return m_array.GetCount(); }
401 wxArrayPtrVoid m_array;
451 wxPdfDictionaryMap* m_hashMap;
492 void SetBuffer(wxMemoryOutputStream* buffer) { m_buffer = buffer; }
530 int GetObjOffset(
int index)
const;
535 wxMemoryOutputStream* m_buffer;
536 bool m_hasObjOffsets;
537 wxArrayInt m_objOffsets;
592 int m_originalObjectId;
593 int m_actualObjectId;
Class representing an array object. (For internal use only)
Definition: pdfobjects.h:361
size_t GetSize()
Get the size of the array.
Definition: pdfobjects.h:398
Class representing a boolean object. (For internal use only)
Definition: pdfobjects.h:215
bool GetValue()
Get boolean value.
Definition: pdfobjects.h:230
Class representing a dictionary object. (For internal use only)
Definition: pdfobjects.h:409
wxPdfDictionaryMap * GetHashMap()
Get the dictionary map.
Definition: pdfobjects.h:448
Class representing an indirect reference object. (For internal use only)
Definition: pdfobjects.h:176
Class representing a literal object. (For internal use only)
Definition: pdfobjects.h:191
wxString GetValue()
Get string value of the literal.
Definition: pdfobjects.h:207
Class representing a name object. (For internal use only)
Definition: pdfobjects.h:335
wxString GetName()
Get name.
Definition: pdfobjects.h:353
Class representing a null object. (For internal use only)
Definition: pdfobjects.h:165
Class representing a numeric object. (For internal use only)
Definition: pdfobjects.h:280
int GetInt()
Get value as integer.
Definition: pdfobjects.h:313
bool IsInt()
Check whether value is integer.
Definition: pdfobjects.h:325
double GetValue()
Get value as floating point.
Definition: pdfobjects.h:307
wxString GetAsString()
Get value as string.
Definition: pdfobjects.h:319
Class representing a queue of objects. (For internal use only)
Definition: pdfobjects.h:542
wxPdfObject * GetObject() const
Get associated object.
Definition: pdfobjects.h:571
int GetActualObjectId() const
Get actual object id.
Definition: pdfobjects.h:565
int GetOriginalObjectId() const
Get original object id.
Definition: pdfobjects.h:559
void SetNext(wxPdfObjectQueue *next)
Set next queue entry.
Definition: pdfobjects.h:589
void SetObject(wxPdfObject *object)
Set associated object.
Definition: pdfobjects.h:577
virtual ~wxPdfObjectQueue()
Destructor.
Definition: pdfobjects.h:553
wxPdfObjectQueue * GetNext() const
Get next queue entry.
Definition: pdfobjects.h:583
Class representing a base PDF object. (For internal use only)
Definition: pdfobjects.h:35
void SetActualId(int actualId)
Set actual object id.
Definition: pdfobjects.h:75
int m_objNum
Object number.
Definition: pdfobjects.h:157
bool IsStream()
Checks whether this PdfObject is of the type PdfStream.
Definition: pdfobjects.h:147
bool IsDictionary()
Checks whether this is a wxPdfDictionary object.
Definition: pdfobjects.h:141
int GetType()
Get the type of the object.
Definition: pdfobjects.h:50
void SetCreatedIndirect(bool indirect)
Flag this object as created through an indirect reference.
Definition: pdfobjects.h:87
bool IsCreatedIndirect()
Check whether this object was created through an indirect reference.
Definition: pdfobjects.h:93
int GetActualId()
Definition: pdfobjects.h:81
bool m_indirect
Flag whether created through indirect reference.
Definition: pdfobjects.h:160
int GetGeneration()
Get generation number.
Definition: pdfobjects.h:69
bool IsString()
Checks whether this is a wxPdfString object.
Definition: pdfobjects.h:123
bool IsIndirect()
Checks if this is an indirect object.
Definition: pdfobjects.h:153
bool IsName()
Checks whether this is a wxPdfName object.
Definition: pdfobjects.h:129
int m_type
Object type.
Definition: pdfobjects.h:156
bool IsBoolean()
Checks whether this is a wxPdfBoolean object.
Definition: pdfobjects.h:111
bool IsNull()
Checks whether this is a wxPdfNull object.
Definition: pdfobjects.h:105
bool IsArray()
Checks whether this is a wxPdfArray object.
Definition: pdfobjects.h:135
int m_objGen
Object generation.
Definition: pdfobjects.h:158
int m_actualId
Actual object id.
Definition: pdfobjects.h:159
int GetNumber()
Get object number.
Definition: pdfobjects.h:63
bool IsNumber()
Checks whether this is a wxPdfNumber object.
Definition: pdfobjects.h:117
Class representing a stream object. (For internal use only)
Definition: pdfobjects.h:456
void SetDictionary(wxPdfDictionary *dictionary)
Set the associated stream dictionary.
Definition: pdfobjects.h:480
void SetBuffer(wxMemoryOutputStream *buffer)
Set the stream data buffer.
Definition: pdfobjects.h:492
wxMemoryOutputStream * GetBuffer()
Get the stream data buffer.
Definition: pdfobjects.h:498
void SetHasObjOffsets(bool hasObjOffsets)
Set flag whether an object stream has already read the object index.
Definition: pdfobjects.h:511
off_t GetOffset()
Get the offset of the stream data.
Definition: pdfobjects.h:474
wxArrayInt * GetObjOffsets()
Get a pointer to the object offsets array.
Definition: pdfobjects.h:523
bool HasObjOffsets()
Get flag whether the offsets of objects in an object stream are available.
Definition: pdfobjects.h:517
wxPdfDictionary * GetDictionary()
Get the associated stream dictionary.
Definition: pdfobjects.h:486
Class representing a normal string object. (For internal use only)
Definition: pdfobjects.h:244
bool IsHexString() const
Check whether string is hexadecimal.
Definition: pdfobjects.h:271
wxString GetValue()
Get value of the string.
Definition: pdfobjects.h:259
void SetIsHexString(bool isHexString)
Set hexadecimal string flag.
Definition: pdfobjects.h:265
Compile time switches for the wxPdfDocument component.
WX_DECLARE_HASH_MAP_WITH_DECL(long, wxPdfObjectQueue *, wxIntegerHash, wxIntegerEqual, wxPdfObjectMap, class WXDLLIMPEXP_PDFDOC)
Hashmap class for object queue entries (For internal use only)
WX_DECLARE_STRING_HASH_MAP_WITH_DECL(wxPdfObject *, wxPdfDictionaryMap, class WXDLLIMPEXP_PDFDOC)
Hash map class for dictionaries. (For internal use only)