ExportObject.cs 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  1. using FastReport.Utils;
  2. using System;
  3. using System.IO;
  4. namespace FastReport.Export
  5. {
  6. class ExportIEMObject
  7. {
  8. #region Private fields
  9. private TextRenderType textRenderType;
  10. private string text;
  11. private string originalText;
  12. private string bookmark;
  13. private Hyperlink hyperlink;
  14. private int styleIndex;
  15. private ExportIEMStyle style;
  16. private bool isText;
  17. private bool isRichText;
  18. private float left;
  19. private float top;
  20. private float width;
  21. private float height;
  22. private int counter;
  23. private System.Drawing.Image metafile;
  24. private MemoryStream pictureStream;
  25. private bool isBand;
  26. private string hash;
  27. private bool isBase;
  28. private object value;
  29. private bool isNumeric;
  30. private bool isDateTime;
  31. private bool isPercent;
  32. private bool isSvg;
  33. private Utils.InlineImageCache inlineImageCache;
  34. private ParagraphFormat paragraphFormat;
  35. private float tabWidth;
  36. private FloatCollection tabPositions;
  37. private int fx;
  38. private int fy;
  39. private int fdx;
  40. private int fdy;
  41. private bool exist;
  42. #endregion
  43. #region Private methods
  44. #endregion
  45. #region Public properties
  46. public bool Base
  47. {
  48. get { return isBase; }
  49. set { isBase = value; }
  50. }
  51. public string Hash
  52. {
  53. get { return hash; }
  54. set { hash = value; }
  55. }
  56. public TextRenderType TextRenderType
  57. {
  58. get { return textRenderType; }
  59. set { textRenderType = value; }
  60. }
  61. /// <summary>
  62. /// This property for internal use only.
  63. /// </summary>
  64. public bool HtmlTags
  65. {
  66. get
  67. {
  68. switch (textRenderType)
  69. {
  70. case TextRenderType.HtmlTags:
  71. case TextRenderType.HtmlParagraph:
  72. return true;
  73. default:
  74. return false;
  75. }
  76. }
  77. set { textRenderType = value ? TextRenderType.HtmlTags : TextRenderType.Default; }
  78. }
  79. public string Text
  80. {
  81. get { return text; }
  82. set { text = value; }
  83. }
  84. public FloatCollection TabPositions
  85. {
  86. get { return tabPositions; }
  87. set { tabPositions = value; }
  88. }
  89. public string OriginalText
  90. {
  91. get { return originalText; }
  92. set { originalText = value; }
  93. }
  94. public string URL
  95. {
  96. get { return Hyperlink != null && Hyperlink.Kind == HyperlinkKind.URL ? Hyperlink.Value : ""; }
  97. }
  98. public string Bookmark
  99. {
  100. get { return bookmark; }
  101. set { bookmark = value; }
  102. }
  103. public Hyperlink Hyperlink
  104. {
  105. get { return hyperlink; }
  106. set { hyperlink = value; }
  107. }
  108. public int StyleIndex
  109. {
  110. get { return styleIndex; }
  111. set { styleIndex = value; }
  112. }
  113. public bool IsText
  114. {
  115. get { return isText; }
  116. set { isText = value; }
  117. }
  118. public bool IsRichText
  119. {
  120. get { return isRichText; }
  121. set { isRichText = value; }
  122. }
  123. public bool IsSvg
  124. {
  125. get { return isSvg; }
  126. set { isSvg = value; }
  127. }
  128. public float Left
  129. {
  130. get { return left; }
  131. set { left = value; }
  132. }
  133. public float Top
  134. {
  135. get { return top; }
  136. set { top = value; }
  137. }
  138. public float Width
  139. {
  140. get { return width; }
  141. set { width = value; }
  142. }
  143. public float Height
  144. {
  145. get { return height; }
  146. set { height = value; }
  147. }
  148. public ExportIEMStyle Style
  149. {
  150. get { return style; }
  151. set { style = value; }
  152. }
  153. public int Counter
  154. {
  155. get { return counter; }
  156. set { counter = value; }
  157. }
  158. public System.Drawing.Image Metafile
  159. {
  160. get { return metafile; }
  161. set { metafile = value; }
  162. }
  163. public MemoryStream PictureStream
  164. {
  165. get { return pictureStream; }
  166. set { pictureStream = value; }
  167. }
  168. public bool IsBand
  169. {
  170. get { return isBand; }
  171. set { isBand = value; }
  172. }
  173. public object Value
  174. {
  175. get { return value; }
  176. set { this.value = value; }
  177. }
  178. public bool IsNumeric
  179. {
  180. get { return isNumeric; }
  181. set { isNumeric = value; }
  182. }
  183. public bool IsDateTime
  184. {
  185. get { return isDateTime; }
  186. set { isDateTime = value; }
  187. }
  188. public bool IsPercent
  189. {
  190. get { return isPercent; }
  191. set { isPercent = value; }
  192. }
  193. public int x
  194. {
  195. get { return fx; }
  196. set { fx = value; }
  197. }
  198. public int y
  199. {
  200. get { return fy; }
  201. set { fy = value; }
  202. }
  203. public int dx
  204. {
  205. get { return fdx; }
  206. set { fdx = value; }
  207. }
  208. public int dy
  209. {
  210. get { return fdy; }
  211. set { fdy = value; }
  212. }
  213. public bool Exist
  214. {
  215. get { return exist; }
  216. set { exist = value; }
  217. }
  218. public Utils.InlineImageCache InlineImageCache
  219. {
  220. get { return inlineImageCache; }
  221. set { inlineImageCache = value; }
  222. }
  223. public ParagraphFormat ParagraphFormat
  224. {
  225. get { return paragraphFormat; }
  226. set { paragraphFormat = value; }
  227. }
  228. public float TabWidth
  229. {
  230. get { return tabWidth; }
  231. set { tabWidth = value; }
  232. }
  233. #endregion
  234. public ExportIEMObject()
  235. {
  236. isText = true;
  237. isNumeric = false;
  238. text = String.Empty;
  239. isBase = true;
  240. originalText = null;
  241. }
  242. }
  243. }