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/Struct/SElement.h>
00014 #include <C/PDF/TRN_Element.h>
00015
00016 namespace pdftron {
00017 namespace PDF {
00018
00019
00032 class Element
00033 {
00034 public:
00035
00036
00037 enum Type
00038 {
00039 e_null,
00040 e_path,
00041 e_text_begin,
00042 e_text,
00043 e_text_new_line,
00044 e_text_end,
00045 e_image,
00046 e_inline_image,
00047 e_shading,
00048 e_form,
00049 e_group_begin,
00050 e_group_end,
00051 e_marked_content_begin,
00052 e_marked_content_end,
00053 e_marked_content_point
00054 };
00055
00056 Element();
00057 Element(const Element& c);
00058 Element& operator=(const Element&c);
00059 operator bool () { return mp_elem!=0;}
00060
00064 Type GetType();
00065
00069 GState GetGState();
00070
00075 Common::Matrix2D GetCTM();
00076
00097 bool GetBBox(Rect& out_bbox);
00098
00104 Struct::SElement GetParentStructElement();
00105
00113 int GetStructMCID();
00114
00125 bool IsOCVisible();
00126
00127
00128
00133 bool IsClippingPath();
00134
00138 bool IsStroked();
00139
00143 bool IsFilled();
00144
00162 bool IsWindingFill();
00163
00168 bool IsClipWindingFill();
00169
00170 enum PathSegmentType
00171 {
00172
00173
00174 e_moveto = 1,
00175
00176
00177
00178
00179 e_lineto,
00180
00181
00182
00183
00184
00185 e_cubicto,
00186
00187
00188
00189
00190
00191
00192 e_conicto,
00193
00194
00195
00196 e_rect,
00197
00198
00199
00200
00201 e_closepath
00202 };
00203
00211 const char* GetPathTypes();
00212
00216 int GetPathTypesCount();
00217
00226 const double* GetPathPoints();
00227
00231 int GetPointCount();
00232
00233
00234
00235
00239 void SetPathClip(bool clip);
00240
00244 void SetPathStroke(bool stroke);
00245
00249 void SetPathFill(bool fill);
00250
00256 void SetWindingFill(bool winding_rule);
00257
00264 void SetClipWindingFill(bool winding_rule);
00265
00266
00275 void SetPathPoints(const double* in_points, int count);
00276
00284 void SetPathTypes(const char* in_seg_types, int count);
00285
00286
00287
00288
00292 SDF::Obj GetXObject();
00293
00294
00295
00296
00300 Filters::Filter GetImageData();
00301
00305 int GetImageDataSize();
00306
00318 #if defined(_WIN32) && !defined(WINCE)
00319 Gdiplus::Bitmap* GetBitmap();
00320 #endif
00321
00330 SDF::Obj GetImageColorSpace();
00331
00335 int GetImageWidth();
00336
00340 int GetImageHeight();
00341
00350 SDF::Obj GetDecodeArray();
00351
00357 int GetBitsPerComponent();
00358
00362 int GetComponentNum();
00363
00364
00368 bool IsImageMask();
00369
00373 bool IsImageInterpolate();
00374
00382 SDF::Obj GetMask();
00383
00387 GState::RenderingIntent GetImageRenderingIntent();
00388
00389
00390
00408 const UString* GetTextString();
00409
00424 const UChar* GetTextData();
00425
00429 UInt GetTextDataSize();
00430
00434 Common::Matrix2D GetTextMatrix();
00435
00466 CharIterator GetCharIterator();
00467
00482 double GetTextLength();
00483
00493 double GetPosAdjustment();
00494
00495
00496
00504 void GetNewTextLineOffset(double& out_x, double& out_y);
00505
00506
00507
00513 bool HasTextMatrix();
00514
00515
00516
00517
00523 void SetTextData(const UChar* text_data, int text_data_size);
00524
00530 void SetTextMatrix(Common::Matrix2D& mtx);
00531
00551 void SetTextMatrix(double a, double b, double c, double d, double h, double v);
00552
00556 void SetPosAdjustment(double adjust);
00557
00567 void UpdateTextMetrics();
00568
00569
00570
00571
00576 void SetNewTextLineOffset(double dx, double dy);
00577
00578
00579
00580
00584 SDF::Obj GetShading();
00585
00586
00587
00588
00597 SDF::Obj GetMCPropertyDict();
00598
00603 SDF::Obj GetMCTag();
00604
00605 ~Element() {}
00606
00607
00609 Element(TRN_Element impl);
00610 TRN_Element mp_elem;
00612 };
00613
00614
00615 #include <Impl/Element.inl>
00616
00617 };
00618 };
00619
00620 #endif