mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-07-11 07:23:34 +08:00
git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@62950 954022d7-b5bf-4e40-9824-e11837661b57
385 lines
11 KiB
C++
385 lines
11 KiB
C++
#pragma once
|
|
|
|
#include "draw_base.h"
|
|
|
|
#include "common_attlists.h"
|
|
|
|
|
|
namespace cpdoccore
|
|
{
|
|
|
|
namespace odf_writer {
|
|
|
|
|
|
class draw_shape : public draw_base
|
|
{
|
|
public:
|
|
static const wchar_t * ns;
|
|
static const wchar_t * name;
|
|
|
|
static const ElementType type = typeDrawShape;
|
|
static const xml::NodeType xml_type = xml::typeElement;
|
|
|
|
virtual void serialize(std::wostream & _Wostream);
|
|
virtual void serialize_attlist(CP_ATTR_NODE);
|
|
|
|
odf_types::common_xlink_attlist common_xlink_attlist_;
|
|
|
|
_CP_OPT(std::wstring) draw_id_;//èñïîëüçóåòñÿ äëÿ àíèìàøåê
|
|
|
|
|
|
CPDOCCORE_DEFINE_VISITABLE();
|
|
|
|
int sub_type_;
|
|
|
|
};
|
|
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
class draw_rect_attlist
|
|
{
|
|
public:
|
|
|
|
_CP_OPT(std::wstring) draw_filter_name_;
|
|
void serialize(CP_ATTR_NODE);
|
|
|
|
|
|
};
|
|
|
|
class draw_rect : public draw_shape
|
|
{
|
|
public:
|
|
static const wchar_t * ns;
|
|
static const wchar_t * name;
|
|
|
|
static const ElementType type = typeDrawRect;
|
|
static const xml::NodeType xml_type = xml::typeElement;
|
|
|
|
virtual void serialize(std::wostream & _Wostream);
|
|
|
|
draw_rect_attlist draw_rect_attlist_;
|
|
|
|
};
|
|
|
|
CP_REGISTER_OFFICE_ELEMENT2(draw_rect);
|
|
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
class draw_ellipse_attlist
|
|
{
|
|
public:
|
|
_CP_OPT(std::wstring) draw_filter_name_;
|
|
void serialize(CP_ATTR_NODE);
|
|
|
|
};
|
|
|
|
class draw_ellipse : public draw_shape
|
|
{
|
|
public:
|
|
static const wchar_t * ns;
|
|
static const wchar_t * name;
|
|
|
|
static const ElementType type = typeDrawEllipse;
|
|
static const xml::NodeType xml_type = xml::typeElement;
|
|
|
|
virtual void serialize(std::wostream & _Wostream);
|
|
|
|
draw_ellipse_attlist draw_ellipse_attlist_;
|
|
};
|
|
|
|
CP_REGISTER_OFFICE_ELEMENT2(draw_ellipse);
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
class draw_circle : public draw_shape
|
|
{
|
|
public:
|
|
static const wchar_t * ns;
|
|
static const wchar_t * name;
|
|
|
|
static const ElementType type = typeDrawCircle;
|
|
static const xml::NodeType xml_type = xml::typeElement;
|
|
|
|
virtual void serialize(std::wostream & _Wostream);
|
|
};
|
|
|
|
CP_REGISTER_OFFICE_ELEMENT2(draw_circle);
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
class draw_line_attlist
|
|
{
|
|
public:
|
|
_CP_OPT(odf_types::length) svg_x1_;
|
|
_CP_OPT(odf_types::length) svg_y1_;
|
|
|
|
_CP_OPT(odf_types::length) svg_x2_;
|
|
_CP_OPT(odf_types::length) svg_y2_;
|
|
|
|
void serialize(CP_ATTR_NODE);
|
|
};
|
|
/////////////////////////////////////////////////////////////////////////
|
|
class draw_line : public draw_shape
|
|
{
|
|
public:
|
|
static const wchar_t * ns;
|
|
static const wchar_t * name;
|
|
|
|
static const ElementType type = typeDrawLine;
|
|
static const xml::NodeType xml_type = xml::typeElement;
|
|
|
|
virtual void serialize(std::wostream & _Wostream);
|
|
|
|
draw_line_attlist draw_line_attlist_;
|
|
|
|
};
|
|
|
|
CP_REGISTER_OFFICE_ELEMENT2(draw_line);
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
class draw_path_attlist
|
|
{
|
|
public:
|
|
_CP_OPT(std::wstring) svg_d_;
|
|
_CP_OPT(std::wstring) svg_viewbox_;
|
|
|
|
void serialize(CP_ATTR_NODE);
|
|
};
|
|
/////////////////////////////////////////////////////////////////////////
|
|
class draw_path : public draw_shape
|
|
{
|
|
public:
|
|
static const wchar_t * ns;
|
|
static const wchar_t * name;
|
|
|
|
static const ElementType type = typeDrawPath;
|
|
static const xml::NodeType xml_type = xml::typeElement;
|
|
|
|
virtual void serialize(std::wostream & _Wostream);
|
|
|
|
draw_path_attlist draw_path_attlist_;
|
|
|
|
void reset_svg_path();
|
|
};
|
|
|
|
CP_REGISTER_OFFICE_ELEMENT2(draw_path);
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
class draw_polygon_attlist
|
|
{
|
|
public:
|
|
_CP_OPT(std::wstring) draw_points_;
|
|
_CP_OPT(std::wstring) svg_viewbox_;
|
|
|
|
void serialize(CP_ATTR_NODE);
|
|
};
|
|
/////////////////////////////////////////////////////////////////////////
|
|
class draw_polygon : public draw_shape
|
|
{
|
|
public:
|
|
static const wchar_t * ns;
|
|
static const wchar_t * name;
|
|
|
|
static const ElementType type = typeDrawPolygon;
|
|
static const xml::NodeType xml_type = xml::typeElement;
|
|
|
|
virtual void serialize(std::wostream & _Wostream);
|
|
|
|
draw_polygon_attlist draw_polygon_attlist_;
|
|
|
|
void reset_polygon_path();//÷àñòíûé ñëó÷àé svg - âñå òî÷êè ñîåäèíåíû ïðÿìûìè
|
|
};
|
|
|
|
CP_REGISTER_OFFICE_ELEMENT2(draw_polygon);
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
/////////////////////////////////////////////////////////////////////////
|
|
class draw_custom_shape : public draw_shape
|
|
{
|
|
public:
|
|
static const wchar_t * ns;
|
|
static const wchar_t * name;
|
|
|
|
static const ElementType type = typeDrawCustomShape;
|
|
static const xml::NodeType xml_type = xml::typeElement;
|
|
|
|
virtual void serialize(std::wostream & _Wostream);
|
|
virtual void add_child_element( const office_element_ptr & child_element);
|
|
|
|
office_element_ptr draw_enhanced_geometry_;
|
|
};
|
|
|
|
CP_REGISTER_OFFICE_ELEMENT2(draw_custom_shape);
|
|
//draw:enhanced-geometry
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
//////////////////////////////////////////////////////
|
|
class draw_equation_attlist//óáðàòü ñòðèíãè ... ñäåëàòü ïàðñèíã ñì ñòð 378 îàçèñ !!!!!!!!!!!
|
|
{
|
|
public:
|
|
_CP_OPT(std::wstring) draw_name_;
|
|
_CP_OPT(std::wstring) draw_formula_;
|
|
|
|
void serialize(CP_ATTR_NODE);
|
|
};
|
|
/////////////////////////////////////////////////////////////////
|
|
class draw_equation : public office_element_impl<draw_equation>
|
|
{
|
|
public:
|
|
|
|
static const wchar_t * ns;
|
|
static const wchar_t * name;
|
|
|
|
static const ElementType type = typeDrawEquation;
|
|
static const xml::NodeType xml_type = xml::typeElement;
|
|
CPDOCCORE_DEFINE_VISITABLE();
|
|
|
|
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name){}
|
|
virtual void add_child_element( const office_element_ptr & child_element){}
|
|
|
|
virtual void serialize(std::wostream & _Wostream);
|
|
|
|
draw_equation_attlist draw_equation_attlist_;
|
|
};
|
|
|
|
CP_REGISTER_OFFICE_ELEMENT2(draw_equation);
|
|
////////////////
|
|
struct draw_handle_geometry
|
|
{
|
|
int min;
|
|
int max;
|
|
};
|
|
//////////////////////////////////////////////////////
|
|
class draw_handle_attlist//óáðàòü ñòðèíãè ... ñäåëàòü ïàðñèíã ñì ñòð 378 îàçèñ !!!!!!!!!!!
|
|
{
|
|
public:
|
|
_CP_OPT(std::wstring) draw_handle_position_;
|
|
|
|
_CP_OPT(std::wstring) draw_handle_range_y_maximum_;
|
|
_CP_OPT(std::wstring) draw_handle_range_y_minimum_;
|
|
|
|
_CP_OPT(std::wstring) draw_handle_range_x_maximum_;
|
|
_CP_OPT(std::wstring) draw_handle_range_x_minimum_;
|
|
|
|
_CP_OPT(std::wstring) draw_handle_radius_range_maximum_;
|
|
_CP_OPT(std::wstring) draw_handle_radius_range_minimum_;
|
|
|
|
_CP_OPT(std::wstring) draw_handle_polar_;
|
|
|
|
void serialize(CP_ATTR_NODE);
|
|
};
|
|
|
|
class draw_handle : public office_element_impl<draw_handle>
|
|
{
|
|
public:
|
|
|
|
static const wchar_t * ns;
|
|
static const wchar_t * name;
|
|
|
|
static const ElementType type = typeDrawHandle;
|
|
static const xml::NodeType xml_type = xml::typeElement;
|
|
CPDOCCORE_DEFINE_VISITABLE();
|
|
|
|
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name){}
|
|
virtual void add_child_element( const office_element_ptr & child_element){}
|
|
|
|
virtual void serialize(std::wostream & _Wostream);
|
|
|
|
draw_handle_attlist draw_handle_attlist_;
|
|
|
|
};
|
|
|
|
CP_REGISTER_OFFICE_ELEMENT2(draw_handle);
|
|
/////////////////
|
|
class draw_enhanced_geometry_attlist
|
|
{
|
|
public:
|
|
_CP_OPT(std::wstring) draw_type_;
|
|
_CP_OPT(std::wstring) draw_modifiers_;
|
|
_CP_OPT(std::wstring) draw_enhanced_path_;
|
|
_CP_OPT(std::wstring) draw_text_areas_;
|
|
_CP_OPT(std::wstring) draw_glue_points_;
|
|
|
|
_CP_OPT(odf_types::Bool) draw_mirror_vertical_;
|
|
_CP_OPT(odf_types::Bool) draw_mirror_horizontal_;
|
|
|
|
_CP_OPT(odf_types::Bool) draw_text_path_;
|
|
_CP_OPT(odf_types::Bool) draw_text_path_same_letter_heights_;
|
|
_CP_OPT(std::wstring) draw_text_path_mode_;
|
|
_CP_OPT(std::wstring) draw_text_path_scale_;
|
|
|
|
void serialize(CP_ATTR_NODE);
|
|
};
|
|
/////////////////////////////////////////////////////////////////////////
|
|
class draw_enhanced_geometry : public office_element_impl<draw_enhanced_geometry>
|
|
{
|
|
public:
|
|
|
|
static const wchar_t * ns;
|
|
static const wchar_t * name;
|
|
|
|
static const ElementType type = typeDrawEnhancedGeometry;
|
|
static const xml::NodeType xml_type = xml::typeElement;
|
|
|
|
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name);
|
|
virtual void add_child_element( const office_element_ptr & child_element);
|
|
|
|
virtual void serialize(std::wostream & _Wostream);
|
|
|
|
draw_enhanced_geometry_attlist draw_enhanced_geometry_attlist_;
|
|
|
|
_CP_OPT(std::wstring) svg_viewbox_;
|
|
|
|
typedef std::pair<std::wstring,std::wstring> pair_string_value;
|
|
|
|
std::vector<draw_handle_geometry> draw_handle_geometry_; //ïàðàìåòðû â óäîáíîâàðèìîì âèäå
|
|
std::vector<pair_string_value> draw_equation_array_;
|
|
|
|
office_element_ptr_array draw_handle_;
|
|
office_element_ptr_array draw_equation_;//íåêîòîðûå çàäàííûå ïàðàìåòðû îòðèñîâêè êîòîðûå èñïîëüçóþòñÿ â draw_handle - àâòîçàìåíà îáùèõ ÷àñòåé
|
|
|
|
static int parsing(_CP_OPT(std::wstring) val);//todoooo íàîáîðîò
|
|
|
|
CPDOCCORE_DEFINE_VISITABLE();
|
|
};
|
|
|
|
CP_REGISTER_OFFICE_ELEMENT2(draw_enhanced_geometry);
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
class draw_caption : public draw_shape
|
|
{
|
|
public:
|
|
static const wchar_t * ns;
|
|
static const wchar_t * name;
|
|
|
|
static const ElementType type = typeDrawCaption;
|
|
static const xml::NodeType xml_type = xml::typeElement;
|
|
|
|
virtual void serialize(std::wostream & _Wostream);
|
|
};
|
|
|
|
CP_REGISTER_OFFICE_ELEMENT2(draw_caption);
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
class draw_connector_attlist
|
|
{
|
|
public:
|
|
_CP_OPT(std::wstring) svg_d_;
|
|
_CP_OPT(std::wstring) svg_viewbox_;
|
|
_CP_OPT(std::wstring) draw_type_;
|
|
|
|
void serialize(CP_ATTR_NODE);
|
|
};
|
|
/////////////////////////////////////////////////////////////////////////
|
|
class draw_connector : public draw_line
|
|
{
|
|
public:
|
|
static const wchar_t * ns;
|
|
static const wchar_t * name;
|
|
|
|
static const ElementType type = typeDrawConnector;
|
|
static const xml::NodeType xml_type = xml::typeElement;
|
|
|
|
virtual void serialize(std::wostream & _Wostream);
|
|
|
|
draw_connector_attlist draw_connector_attlist_;
|
|
|
|
void reset_svg_path();
|
|
void reset_svg_attributes();
|
|
};
|
|
|
|
CP_REGISTER_OFFICE_ELEMENT2(draw_connector);
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
}
|
|
} |