Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
onlyoffice_core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
onlyoffice_core
Commits
b90e3a3c
Commit
b90e3a3c
authored
Apr 03, 2017
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
f074d125
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
509 additions
and
0 deletions
+509
-0
ASCOfficeOdfFileW/source/OdfFormat/anim_elements.cpp
ASCOfficeOdfFileW/source/OdfFormat/anim_elements.cpp
+147
-0
ASCOfficeOdfFileW/source/OdfFormat/anim_elements.h
ASCOfficeOdfFileW/source/OdfFormat/anim_elements.h
+129
-0
ASCOfficeOdfFileW/source/OdfFormat/style_presentation.cpp
ASCOfficeOdfFileW/source/OdfFormat/style_presentation.cpp
+102
-0
ASCOfficeOdfFileW/source/OdfFormat/style_presentation.h
ASCOfficeOdfFileW/source/OdfFormat/style_presentation.h
+131
-0
No files found.
ASCOfficeOdfFileW/source/OdfFormat/anim_elements.cpp
0 → 100644
View file @
b90e3a3c
/*
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#include "anim_elements.h"
#include <boost/make_shared.hpp>
#include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h>
#include <cpdoccore/xml/simple_xml_writer.h>
namespace
cpdoccore
{
using
namespace
odf_types
;
namespace
odf_writer
{
///////////////////////////////////////////////////////////////////////////////////////////////////////
const
wchar_t
*
anim_par
::
ns
=
L"anim"
;
const
wchar_t
*
anim_par
::
name
=
L"par"
;
void
anim_par
::
create_child_element
(
const
std
::
wstring
&
Ns
,
const
std
::
wstring
&
Name
)
{
if
CP_CHECK_NAME
(
L"anim"
,
L"par"
)
CP_CREATE_ELEMENT
(
anim_par_
);
else
if
CP_CHECK_NAME
(
L"anim"
,
L"seq"
)
CP_CREATE_ELEMENT
(
anim_seq_array_
);
//более 1 элемента- взаимосвязанная анимация (между фигурами)
else
CP_CREATE_ELEMENT
(
content_
);
}
void
anim_par
::
add_child_element
(
const
office_element_ptr
&
child_element
)
{
ElementType
type
=
child_element
->
get_type
();
if
(
type
==
typeAnimPar
)
anim_par_
=
child_element
;
else
if
(
type
==
typeAnimSeq
)
anim_seq_array_
.
push_back
(
child_element
);
else
content_
.
push_back
(
child_element
);
}
void
anim_par
::
serialize
(
std
::
wostream
&
_Wostream
)
{
CP_XML_WRITER
(
_Wostream
)
{
CP_XML_NODE_SIMPLE
()
{
if
(
anim_par_
)
anim_par_
->
serialize
(
CP_XML_STREAM
());
for
(
size_t
i
=
0
;
i
<
anim_seq_array_
.
size
();
i
++
)
{
anim_seq_array_
[
i
]
->
serialize
(
CP_XML_STREAM
());
}
for
(
size_t
i
=
0
;
i
<
content_
.
size
();
i
++
)
{
content_
[
i
]
->
serialize
(
CP_XML_STREAM
());
}
}
}
}
///////////////////////////////////////////////////////////////////////////////////////////////////////
const
wchar_t
*
anim_seq
::
ns
=
L"anim"
;
const
wchar_t
*
anim_seq
::
name
=
L"seq"
;
void
anim_seq
::
serialize
(
std
::
wostream
&
_Wostream
)
{
CP_XML_WRITER
(
_Wostream
)
{
CP_XML_NODE_SIMPLE
()
{
for
(
size_t
i
=
0
;
i
<
anim_par_array_
.
size
();
i
++
)
{
anim_par_array_
[
i
]
->
serialize
(
CP_XML_STREAM
());
}
}
}
}
void
anim_seq
::
create_child_element
(
const
std
::
wstring
&
Ns
,
const
std
::
wstring
&
Name
)
{
if
CP_CHECK_NAME
(
L"anim"
,
L"par"
)
CP_CREATE_ELEMENT
(
anim_par_array_
);
}
void
anim_seq
::
add_child_element
(
const
office_element_ptr
&
child
)
{
anim_par_array_
.
push_back
(
child
);
}
////////////////////////////////////////////////////////////////
void
anim_transition_filter_attlist
::
serialize
(
CP_ATTR_NODE
)
{
CP_XML_ATTR_OPT
(
L"smil:direction"
,
smil_direction_
);
CP_XML_ATTR_OPT
(
L"smil:subtype"
,
smil_subtype_
);
CP_XML_ATTR_OPT
(
L"smil:type"
,
smil_type_
);
CP_XML_ATTR_OPT
(
L"smil:fadeColor"
,
smil_fadeColor_
);
CP_XML_ATTR_OPT
(
L"smil:mode"
,
smil_mode_
);
CP_XML_ATTR_OPT
(
L"smil:dur"
,
smil_dur_
);
}
const
wchar_t
*
anim_transitionFilter
::
ns
=
L"anim"
;
const
wchar_t
*
anim_transitionFilter
::
name
=
L"transitionFilter"
;
void
anim_transitionFilter
::
serialize
(
std
::
wostream
&
_Wostream
)
{
CP_XML_WRITER
(
_Wostream
)
{
CP_XML_NODE_SIMPLE
()
{
common_anim_smil_attlist_
.
serialize
(
CP_GET_XML_NODE
());
anim_transition_filter_attlist_
.
serialize
(
CP_GET_XML_NODE
());
}
}
}
////////////////////////////////////////////////////////////////
}
}
ASCOfficeOdfFileW/source/OdfFormat/anim_elements.h
0 → 100644
View file @
b90e3a3c
/*
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#pragma once
#include <cpdoccore/CPOptional.h>
#include <cpdoccore/xml/xmlelement.h>
#include <cpdoccore/xml/nodetype.h>
#include "office_elements.h"
#include "office_elements_create.h"
#include "common_attlists.h"
#include "smil_transitiontype.h"
namespace
cpdoccore
{
namespace
odf_writer
{
class
anim_par
:
public
office_element_impl
<
anim_par
>
//Параллельные анимации
{
public:
static
const
wchar_t
*
ns
;
static
const
wchar_t
*
name
;
static
const
xml
::
NodeType
xml_type
=
xml
::
typeElement
;
static
const
ElementType
type
=
typeAnimPar
;
CPDOCCORE_DEFINE_VISITABLE
();
office_element_ptr
anim_par_
;
office_element_ptr_array
anim_seq_array_
;
office_element_ptr_array
content_
;
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
);
};
CP_REGISTER_OFFICE_ELEMENT2
(
anim_par
);
class
anim_seq
:
public
office_element_impl
<
anim_seq
>
//Последовательные анимации
{
public:
static
const
wchar_t
*
ns
;
static
const
wchar_t
*
name
;
static
const
xml
::
NodeType
xml_type
=
xml
::
typeElement
;
static
const
ElementType
type
=
typeAnimSeq
;
CPDOCCORE_DEFINE_VISITABLE
();
office_element_ptr_array
anim_par_array_
;
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
);
};
CP_REGISTER_OFFICE_ELEMENT2
(
anim_seq
);
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//anim:iterate
//class anim_iterate : public office_element_impl<anim_iterate>//Итеративные анимации
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//----------------------------------------------------------------------------------------------------------------/
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class
anim_transition_filter_attlist
{
public:
void
serialize
(
CP_ATTR_NODE
);
_CP_OPT
(
std
::
wstring
)
smil_direction_
;
_CP_OPT
(
std
::
wstring
)
smil_subtype_
;
_CP_OPT
(
odf_types
::
smil_transition_type
)
smil_type_
;
_CP_OPT
(
std
::
wstring
)
smil_mode_
;
_CP_OPT
(
odf_types
::
color
)
smil_fadeColor_
;
_CP_OPT
(
odf_types
::
clockvalue
)
smil_dur_
;
};
class
anim_transitionFilter
:
public
office_element_impl
<
anim_transitionFilter
>
{
public:
static
const
wchar_t
*
ns
;
static
const
wchar_t
*
name
;
static
const
xml
::
NodeType
xml_type
=
xml
::
typeElement
;
static
const
ElementType
type
=
typeAnimTransitionFilter
;
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
){}
virtual
void
serialize
(
std
::
wostream
&
strm
);
///////////////////////////////////////////////////////////
odf_types
::
common_anim_smil_attlist
common_anim_smil_attlist_
;
anim_transition_filter_attlist
anim_transition_filter_attlist_
;
};
CP_REGISTER_OFFICE_ELEMENT2
(
anim_transitionFilter
);
//anim:audio
//anim:command
}
}
ASCOfficeOdfFileW/source/OdfFormat/style_presentation.cpp
0 → 100644
View file @
b90e3a3c
/*
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#include "style_presentation.h"
#include <iostream>
#include <cpdoccore/xml/simple_xml_writer.h>
#include <cpdoccore/xml/attributes.h>
namespace
cpdoccore
{
using
namespace
odf_types
;
namespace
odf_writer
{
//////////////////////////////////////////////////////////////////////////////////////////////////
const
wchar_t
*
presentation_placeholder
::
ns
=
L"presentation"
;
const
wchar_t
*
presentation_placeholder
::
name
=
L"placeholder"
;
void
presentation_placeholder
::
serialize
(
std
::
wostream
&
strm
)
{
CP_XML_WRITER
(
strm
)
{
CP_XML_NODE_SIMPLE
()
{
CP_XML_ATTR_OPT
(
L"presentation:object"
,
presentation_object_
);
CP_XML_ATTR_OPT
(
L"svg:height"
,
svg_height_
);
CP_XML_ATTR_OPT
(
L"svg:width"
,
svg_width_
);
CP_XML_ATTR_OPT
(
L"svg:x"
,
svg_x_
);
CP_XML_ATTR_OPT
(
L"svg:y"
,
svg_y_
);
}
}
}
//-----------------------------------------------------------------------------------------------------------------------
void
drawing_page_properties
::
serialize
(
std
::
wostream
&
strm
,
const
wchar_t
*
ns
,
const
wchar_t
*
name
)
{
CP_XML_WRITER
(
strm
)
{
CP_XML_NODE_SIMPLE
()
{
common_draw_fill_attlist_
.
serialize
(
CP_GET_XML_NODE
());
anim_transition_filter_attlist_
.
serialize
(
CP_GET_XML_NODE
());
CP_XML_ATTR_OPT
(
L"draw:fill-image-height"
,
draw_fill_image_height_
);
CP_XML_ATTR_OPT
(
L"draw:fill-image-width"
,
draw_fill_image_width_
);
CP_XML_ATTR_OPT
(
L"draw:background-size"
,
draw_background_size_
);
CP_XML_ATTR_OPT
(
L"presentation:transition-type"
,
presentation_transition_type_
);
CP_XML_ATTR_OPT
(
L"presentation:transition-style"
,
presentation_transition_style_
);
CP_XML_ATTR_OPT
(
L"presentation:transition-speed"
,
presentation_transition_speed_
);
CP_XML_ATTR_OPT
(
L"presentation:display-footer"
,
presentation_display_footer_
);
CP_XML_ATTR_OPT
(
L"presentation:display-page-number"
,
presentation_display_page_number_
);
CP_XML_ATTR_OPT
(
L"presentation:display-date-time"
,
presentation_display_date_time_
);
CP_XML_ATTR_OPT
(
L"presentation:display-header"
,
presentation_display_header_
);
}
}
}
//-----------------------------------------------------------------------------------------------------------------------
const
wchar_t
*
style_drawing_page_properties
::
ns
=
L"style"
;
const
wchar_t
*
style_drawing_page_properties
::
name
=
L"drawing-page-properties"
;
void
style_drawing_page_properties
::
serialize
(
std
::
wostream
&
strm
)
{
content_
.
serialize
(
strm
,
ns
,
name
);
}
}
}
ASCOfficeOdfFileW/source/OdfFormat/style_presentation.h
0 → 100644
View file @
b90e3a3c
/*
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#pragma once
#include "common_attlists.h"
#include <cpdoccore/xml/xmlelement.h>
#include <cpdoccore/xml/nodetype.h>
#include "office_elements.h"
#include "office_elements_create.h"
#include "anim_elements.h"
#include "presentationclass.h"
#include "drawfill.h"
namespace
cpdoccore
{
namespace
odf_writer
{
class
presentation_placeholder
:
public
office_element_impl
<
presentation_placeholder
>
{
public:
static
const
wchar_t
*
ns
;
static
const
wchar_t
*
name
;
static
const
xml
::
NodeType
xml_type
=
xml
::
typeElement
;
static
const
ElementType
type
=
typeStylePresentationPlaceholder
;
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
){}
virtual
void
serialize
(
std
::
wostream
&
strm
);
_CP_OPT
(
odf_types
::
length
)
svg_x_
;
_CP_OPT
(
odf_types
::
length
)
svg_y_
;
_CP_OPT
(
odf_types
::
length
)
svg_width_
;
_CP_OPT
(
odf_types
::
length
)
svg_height_
;
_CP_OPT
(
odf_types
::
presentation_class
)
presentation_object_
;
};
CP_REGISTER_OFFICE_ELEMENT2
(
presentation_placeholder
);
//////////////////////////////////////////////
class
drawing_page_properties
{
public:
void
apply_from
(
const
drawing_page_properties
&
Other
);
void
serialize
(
std
::
wostream
&
strm
,
const
wchar_t
*
ns
,
const
wchar_t
*
name
);
odf_types
::
common_draw_fill_attlist
common_draw_fill_attlist_
;
anim_transition_filter_attlist
anim_transition_filter_attlist_
;
_CP_OPT
(
odf_types
::
length_or_percent
)
draw_fill_image_height_
;
_CP_OPT
(
odf_types
::
length_or_percent
)
draw_fill_image_width_
;
_CP_OPT
(
std
::
wstring
)
draw_background_size_
;
//"border" or "full"
_CP_OPT
(
std
::
wstring
)
presentation_transition_type_
;
//manual, automatic, semi-automatic (переход отделен от эффектов кликом)
_CP_OPT
(
std
::
wstring
)
presentation_transition_style_
;
//none, fade, move, uncover,clockwise, .... игнор если smil
_CP_OPT
(
std
::
wstring
)
presentation_transition_speed_
;
//slow, medium, fast
_CP_OPT
(
bool
)
presentation_display_footer_
;
_CP_OPT
(
bool
)
presentation_display_page_number_
;
_CP_OPT
(
bool
)
presentation_display_date_time_
;
_CP_OPT
(
bool
)
presentation_display_header_
;
//presentation:background-objects-visible
//presentation:background-visible
//style:repeat
//presentation:page-duration
//presentation:visibility.
//presentation:sound.
//draw:background-size
};
class
style_drawing_page_properties
:
public
office_element_impl
<
style_drawing_page_properties
>
{
public:
static
const
wchar_t
*
ns
;
static
const
wchar_t
*
name
;
static
const
xml
::
NodeType
xml_type
=
xml
::
typeElement
;
static
const
ElementType
type
=
typeStyleDrawingPageProperties
;
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
){}
virtual
void
serialize
(
std
::
wostream
&
strm
);
drawing_page_properties
content_
;
};
CP_REGISTER_OFFICE_ELEMENT2
(
style_drawing_page_properties
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment