00001
00002
00003
00004
00005
00006 #ifndef H_CPPPDFElement
00007 #define H_CPPPDFElement
00008
00009 #include <SDF/Obj.h>
00010 #include <PDF/GState.h>
00011 #include <PDF/Rect.h>
00012 #include <PDF/CharData.h>
00013 #include <PDF/PathData.h>
00014 #include <PDF/Struct/SElement.h>
00015 #include <C/PDF/TRN_Element.h>
00016
00017 namespace pdftron {
00018 namespace PDF {
00019
00020
00033 class Element
00034 {
00035 public:
00036
00037
00038 enum Type
00039 {
00040 e_null,
00041 e_path,
00042 e_text_begin,
00043 e_text,
00044 e_text_new_line,
00045 e_text_end,
00046 e_image,
00047 e_inline_image,
00048 e_shading,
00049 e_form,
00050 e_group_begin,
00051 e_group_end,
00052 e_marked_content_begin,
00053 e_marked_content_end,
00054 e_marked_content_point
00055 };
00056
00057 Element();
00058 Element(const Element& c);
00059 Element& operator=(const Element&c);
00060 operator bool () { return mp_elem!=0;}
00061
00065 Type GetType();
00066
00070 GState GetGState();
00071
00076 Common::Matrix2D GetCTM();
00077
00098 Rect GetBBox();
00099
00100 #ifndef SWIG
00101 bool GetBBox(Rect& out_bbox);
00102 #endif
00103
00109 Struct::SElement GetParentStructElement();
00110
00118 int GetStructMCID();
00119
00130 bool IsOCVisible();
00131
00132
00133
00138 bool IsClippingPath();
00139
00143 bool IsStroked();
00144
00148 bool IsFilled();
00149
00167 bool IsWindingFill();
00168
00173 bool IsClipWindingFill();
00174
00180 PathData GetPathData() const;
00181
00182
00183
00188 void SetPathData(const PathData& data);
00189
00193 void SetPathClip(bool clip);
00194
00198 void SetPathStroke(bool stroke);
00199
00203 void SetPathFill(bool fill);
00204
00210 void SetWindingFill(bool winding_rule);
00211
00217 void SetClipWindingFill(bool winding_rule);
00218
00219
00220
00224 SDF::Obj GetXObject();
00225
00226
00227
00228
00232 Filters::Filter GetImageData() const;
00233
00237 int GetImageDataSize() const;
00238
00250 #if defined(_WIN32) && !defined(WINCE)
00251 Gdiplus::Bitmap* GetBitmap() const;
00252 #endif
00253
00260 ColorSpace GetImageColorSpace() const;
00261
00265 int GetImageWidth() const;
00266
00270 int GetImageHeight() const;
00271
00280 SDF::Obj GetDecodeArray() const;
00281
00287 int GetBitsPerComponent() const;
00288
00292 int GetComponentNum() const;
00293
00294
00298 bool IsImageMask() const;
00299
00303 bool IsImageInterpolate() const;
00304
00312 SDF::Obj GetMask() const;
00313
00317 GState::RenderingIntent GetImageRenderingIntent() const;
00318
00319
00320
00338 UString GetTextString();
00339
00354 #ifdef SWIG
00355 std::vector<unsigned char> GetTextData();
00356 #else
00357 const UChar* GetTextData();
00358 #endif
00359
00363 UInt32 GetTextDataSize();
00364
00368 Common::Matrix2D GetTextMatrix();
00369
00400 CharIterator GetCharIterator();
00401
00416 double GetTextLength();
00417
00427 double GetPosAdjustment();
00428
00429
00430
00438 Point GetNewTextLineOffset();
00439
00440 #ifndef SWIG
00441 void GetNewTextLineOffset(double& out_x, double& out_y);
00442 #endif
00443
00448 void SetNewTextLineOffset(double dx, double dy);
00449
00450
00451
00452
00458 bool HasTextMatrix();
00459
00460
00461
00462
00468 void SetTextData(const UChar* text_data, int text_data_size);
00469
00475 void SetTextMatrix(Common::Matrix2D& mtx);
00476
00496 void SetTextMatrix(double a, double b, double c, double d, double h, double v);
00497
00504 void SetPosAdjustment(double adjust);
00505
00515 void UpdateTextMetrics();
00516
00517
00518
00519
00523 Shading GetShading();
00524
00525
00526
00527
00536 SDF::Obj GetMCPropertyDict();
00537
00542 SDF::Obj GetMCTag();
00543
00544 ~Element() {}
00545
00546
00548 #ifndef SWIGHIDDEN
00549 Element(TRN_Element impl);
00550 TRN_Element mp_elem;
00551 #endif
00553 };
00554
00555
00556 #include <Impl/Element.inl>
00557
00558 };
00559 };
00560
00561 #endif