#pragma once #include #include #include #include #include #include #include #include #include "office_elements_create.h" #include "stylefamily.h" #include "textalign.h" #include "length.h" #include "styleverticalrel.h" #include "styleverticalpos.h" #include "percent.h" #include "verticalalign.h" #include "pageusage.h" #include "tablecentering.h" #include "layoutgridmode.h" #include "direction.h" #include "linestyle.h" #include "styletype.h" #include "noteclass.h" #include "gradientstyle.h" #include "hatchstyle.h" #include "common_attlists.h" #include "header_footer.h" #include "styles_list.h" #include "style_map.h" namespace cpdoccore { namespace odf_writer { class style_text_properties; class style_paragraph_properties; class style_graphic_properties; class style_section_properties; class style_table_cell_properties; class style_table_row_properties; class style_table_column_properties; class style_chart_properties; class style_table_properties; class style_drawing_page_properties; class style_content : noncopyable { public: style_content(odf_conversion_context * _context){Context = _context;} void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name); void add_child_element( const office_element_ptr & child); void serialize(std::wostream & strm); style_text_properties * get_style_text_properties(); style_paragraph_properties * get_style_paragraph_properties() ; style_graphic_properties * get_style_graphic_properties() ; style_table_properties * get_style_table_properties(); style_section_properties * get_style_section_properties(); style_table_cell_properties * get_style_table_cell_properties(); style_table_row_properties * get_style_table_row_properties() ; style_table_column_properties * get_style_table_column_properties() ; style_chart_properties * get_style_chart_properties() ; //style_drawing_page_properties* get_style_drawing_page_properties(); private: odf_conversion_context * Context; odf_types::style_family style_family_; office_element_ptr style_text_properties_; office_element_ptr style_paragraph_properties_; office_element_ptr style_section_properties_; office_element_ptr style_ruby_properties_; office_element_ptr style_table_properties_; office_element_ptr style_table_column_properties_; office_element_ptr style_table_row_properties_; office_element_ptr style_chart_properties_; office_element_ptr style_graphic_properties_; office_element_ptr style_table_cell_properties_; office_element_ptr style_drawing_page_properties_; }; /// \class default_style /// style:default-style class default_style : public office_element_impl { public: static const wchar_t * ns; static const wchar_t * name; static const xml::NodeType xml_type = xml::typeElement; static const ElementType type = typeStyleDefaultStyle; CPDOCCORE_DEFINE_VISITABLE() public: default_style() : style_content_(getContext()) {} virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name); virtual void add_child_element( const office_element_ptr & child); virtual void serialize(std::wostream & strm); odf_types::style_family style_family_; style_content style_content_; }; CP_REGISTER_OFFICE_ELEMENT2(default_style) ///////////////////////////////////////////////////////////////////////////////////////////////// /// \class style_draw_gradient class draw_gradient : public office_element_impl { public: static const wchar_t * ns; static const wchar_t * name; static const xml::NodeType xml_type = xml::typeElement; static const ElementType type = typeStyleDrawGradient; CPDOCCORE_DEFINE_VISITABLE() std::wstring get_style_name(){return draw_name_.get_value_or(L"");} _CP_OPT(odf_types::color) draw_start_color_; _CP_OPT(odf_types::color) draw_end_color_; _CP_OPT(odf_types::percent) draw_end_intensity_; _CP_OPT(odf_types::percent) draw_start_intensity_; _CP_OPT(odf_types::percent) draw_cy_;//% _CP_OPT(odf_types::percent) draw_cx_; _CP_OPT(odf_types::percent) draw_border_; _CP_OPT(int) draw_angle_; _CP_OPT(odf_types::gradient_style) draw_style_; _CP_OPT(std::wstring) draw_name_; _CP_OPT(std::wstring) draw_display_name_; virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name); virtual void serialize(std::wostream & strm); }; CP_REGISTER_OFFICE_ELEMENT2(draw_gradient) ///////////////////////////////////////////////////////////////////////////////////////////////// /// \class style_draw_hatch class draw_hatch : public office_element_impl { public: static const wchar_t * ns; static const wchar_t * name; static const xml::NodeType xml_type = xml::typeElement; static const ElementType type = typeStyleDrawHatch; CPDOCCORE_DEFINE_VISITABLE() std::wstring get_style_name(){return draw_name_.get_value_or(L"");} _CP_OPT(odf_types::hatch_style) draw_style_; _CP_OPT(int) draw_rotation_; _CP_OPT(odf_types::length) draw_distance_; _CP_OPT(odf_types::color) draw_color_; _CP_OPT(std::wstring) draw_name_; _CP_OPT(std::wstring) draw_display_name_; virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name); virtual void serialize(std::wostream & strm); }; CP_REGISTER_OFFICE_ELEMENT2(draw_hatch) ///////////////////////////////////////////////////////////////////////////////////////////////// /// \class style_draw_gradient class draw_opacity : public office_element_impl { public: static const wchar_t * ns; static const wchar_t * name; static const xml::NodeType xml_type = xml::typeElement; static const ElementType type = typeStyleDrawOpacity; CPDOCCORE_DEFINE_VISITABLE() std::wstring get_style_name(){return draw_name_.get_value_or(L"");} _CP_OPT(odf_types::gradient_style) draw_style_;//linear, radial, .. _CP_OPT(int) draw_angle_; _CP_OPT(odf_types::percent) draw_cy_;//% _CP_OPT(odf_types::percent) draw_cx_; _CP_OPT(odf_types::percent) draw_start_; _CP_OPT(odf_types::percent) draw_end_; _CP_OPT(odf_types::percent) draw_border_; _CP_OPT(std::wstring) draw_name_; _CP_OPT(std::wstring) draw_display_name_; virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name); virtual void serialize(std::wostream & strm); }; CP_REGISTER_OFFICE_ELEMENT2(draw_opacity) /// \class style_draw_fill_image class draw_fill_image : public office_element_impl { public: static const wchar_t * ns; static const wchar_t * name; static const xml::NodeType xml_type = xml::typeElement; static const ElementType type = typeStyleDrawFillImage; CPDOCCORE_DEFINE_VISITABLE() std::wstring get_style_name(){return draw_name_.get_value_or(L"");} odf_types::common_xlink_attlist xlink_attlist_; _CP_OPT(std::wstring) draw_name_; _CP_OPT(std::wstring) draw_display_name_; virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name); virtual void serialize(std::wostream & strm); }; CP_REGISTER_OFFICE_ELEMENT2(draw_fill_image) /// \class style_draw_marker class draw_marker : public office_element_impl { public: static const wchar_t * ns; static const wchar_t * name; static const xml::NodeType xml_type = xml::typeElement; static const ElementType type = typeStyleDrawMarker; CPDOCCORE_DEFINE_VISITABLE() std::wstring get_style_name(){return draw_name_.get_value_or(L"");} _CP_OPT(std::wstring) svg_viewBox_; _CP_OPT(std::wstring) svg_d_; _CP_OPT(std::wstring) draw_name_; _CP_OPT(std::wstring) draw_display_name_; virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name); virtual void serialize(std::wostream & strm); }; CP_REGISTER_OFFICE_ELEMENT2(draw_marker) ///////////////////////////////////////////////////////////////////////////////////////////////// class style; typedef shared_ptr