00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00031
00032 #pragma once
00033
00034 #include "../api_core.h"
00035 #include "../System/sharedptr.h"
00036
00037 class CL_CSSBox;
00038 class CL_CSSInlineTextBox;
00039 class CL_CSSInlineObjectBox;
00040 class CL_DomElement;
00041 class CL_CSSBoxLayout_Impl;
00042
00045 class CL_API_CORE CL_CSSBoxLayout
00046 {
00049
00050 public:
00052 CL_CSSBoxLayout();
00053
00054 CL_CSSBoxLayout(CL_SharedPtr<CL_CSSBoxLayout_Impl> impl);
00055
00057 ~CL_CSSBoxLayout();
00058
00062
00063 public:
00064
00068 CL_CSSBox get_body_box();
00069
00073
00074 public:
00075
00079 CL_CSSBox create_inline_box();
00080
00086 CL_CSSInlineTextBox create_inline_text_box(const CL_StringRef &text);
00087
00093 CL_CSSInlineObjectBox create_inline_object_box(const CL_DomElement &element);
00094
00098 CL_CSSBox create_block_box();
00099
00103 CL_CSSBox create_list_item_box();
00104
00108 CL_CSSBox create_run_in_box();
00109
00113 CL_CSSBox create_compact_box();
00114
00118 CL_CSSBox create_marker_box();
00119
00123 CL_CSSBox create_table_box();
00124
00128 CL_CSSBox create_inline_table_box();
00129
00133 CL_CSSBox create_table_row_group_box();
00134
00138 CL_CSSBox create_table_header_group_box();
00139
00143 CL_CSSBox create_table_footer_group_box();
00144
00148 CL_CSSBox create_table_row_box();
00149
00153 CL_CSSBox create_table_column_group_box();
00154
00158 CL_CSSBox create_table_column_box();
00159
00163 CL_CSSBox create_table_cell_box();
00164
00168 CL_CSSBox create_table_caption_box();
00169
00173
00174 private:
00175 CL_SharedPtr<CL_CSSBoxLayout_Impl> impl;
00177 };
00178
00179 class CL_CSSBox_Impl;
00180
00183 class CL_API_CORE CL_CSSBox
00184 {
00187
00188 public:
00189 CL_CSSBox();
00190
00191 CL_CSSBox(CL_SharedPtr<CL_CSSBox_Impl> impl);
00192
00193 ~CL_CSSBox();
00194
00198
00199 public:
00200
00204 CL_CSSBoxLayout get_box_layout();
00205
00206 enum Type
00207 {
00208 NULL_BOX,
00209 INLINE_BOX,
00210 INLINE_TEXT_BOX,
00211 INLINE_OBJECT_BOX,
00212 BLOCK_BOX,
00213 LIST_ITEM_BOX,
00214 RUN_IN_BOX,
00215 COMPACT_BOX,
00216 MARKER_BOX,
00217 TABLE_BOX,
00218 INLINE_TABLE_BOX,
00219 TABLE_ROW_GROUP_BOX,
00220 TABLE_HEADER_GROUP_BOX,
00221 TABLE_FOOTER_GROUP_BOX,
00222 TABLE_ROW_BOX,
00223 TABLE_COLUMN_GROUP_BOX,
00224 TABLE_COLUMN_BOX,
00225 TABLE_CELL_BOX,
00226 TABLE_CAPTION_BOX
00227 };
00228
00232 Type get_type() const;
00233
00235
00236 CL_CSSBox get_parent_box() const;
00237
00239
00240 CL_CSSBox get_first_child() const;
00241
00243
00244 CL_CSSBox get_last_child() const;
00245
00247
00248 CL_CSSBox get_previous_sibling() const;
00249
00251
00252 CL_CSSBox get_next_sibling() const;
00253
00255 bool is_null() const;
00256
00258 bool is_anonymous() const;
00259
00261 bool is_inline_box() const;
00262
00264 bool is_inline_text_box() const;
00265
00267 bool is_inline_object_box() const;
00268
00270 bool is_block_box() const;
00271
00273 bool is_list_item_box() const;
00274
00276 bool is_run_in_box() const;
00277
00279 bool is_compact_box() const;
00280
00282 bool is_marker_box() const;
00283
00285 bool is_table_box() const;
00286
00288 bool is_inline_table_box() const;
00289
00291 bool is_table_row_group_box() const;
00292
00294 bool is_table_header_group_box() const;
00295
00297 bool is_table_footer_group_box() const;
00298
00300 bool is_table_row_box() const;
00301
00303 bool is_table_column_group_box() const;
00304
00306 bool is_table_column_box() const;
00307
00309 bool is_table_cell_box() const;
00310
00312 bool is_table_caption_box() const;
00313
00317
00318 public:
00319
00323 CL_CSSInlineTextBox to_inline_text_box() const;
00324
00328 CL_CSSInlineObjectBox to_inline_object_box() const;
00329
00331
00337 CL_CSSBox append_child(CL_CSSBox new_child);
00338
00340 CL_CSSBox remove_child(CL_CSSBox child);
00341
00345
00346 protected:
00347 CL_SharedPtr<CL_CSSBox_Impl> impl;
00349 };
00350
00353 class CL_API_CORE CL_CSSInlineTextBox : CL_CSSBox
00354 {
00357
00358 public:
00359 CL_CSSInlineTextBox();
00360
00361 CL_CSSInlineTextBox(CL_SharedPtr<CL_CSSBox_Impl> impl);
00362
00363 ~CL_CSSInlineTextBox();
00364
00368
00369 public:
00370
00374 CL_StringRef get_text() const;
00376 };
00377
00380 class CL_API_CORE CL_CSSInlineObjectBox : CL_CSSBox
00381 {
00384
00385 public:
00386 CL_CSSInlineObjectBox();
00387
00388 CL_CSSInlineObjectBox(CL_SharedPtr<CL_CSSBox_Impl> impl);
00389
00390 ~CL_CSSInlineObjectBox();
00391
00395
00396 public:
00397
00401 CL_DomElement get_object_element() const;
00403 };
00404