diff options
Diffstat (limited to 'oox/inc/oox/vml')
-rw-r--r-- | oox/inc/oox/vml/vmldrawing.hxx | 71 | ||||
-rw-r--r-- | oox/inc/oox/vml/vmldrawingfragment.hxx | 1 | ||||
-rw-r--r-- | oox/inc/oox/vml/vmlformatting.hxx | 31 | ||||
-rw-r--r-- | oox/inc/oox/vml/vmlinputstream.hxx | 1 | ||||
-rw-r--r-- | oox/inc/oox/vml/vmlshape.hxx | 69 | ||||
-rw-r--r-- | oox/inc/oox/vml/vmlshapecontainer.hxx | 7 | ||||
-rw-r--r-- | oox/inc/oox/vml/vmlshapecontext.hxx | 51 | ||||
-rwxr-xr-x | oox/inc/oox/vml/vmltextbox.hxx | 95 | ||||
-rwxr-xr-x | oox/inc/oox/vml/vmltextboxcontext.hxx | 82 |
9 files changed, 359 insertions, 49 deletions
diff --git a/oox/inc/oox/vml/vmldrawing.hxx b/oox/inc/oox/vml/vmldrawing.hxx index c2f8432dca6f..0d87dae3138b 100644 --- a/oox/inc/oox/vml/vmldrawing.hxx +++ b/oox/inc/oox/vml/vmldrawing.hxx @@ -30,6 +30,7 @@ #include <map> #include <memory> +#include <vector> #include "oox/ole/oleobjecthelper.hxx" namespace com { namespace sun { namespace star { @@ -37,17 +38,21 @@ namespace com { namespace sun { namespace star { namespace awt { class XControlModel; } namespace drawing { class XDrawPage; } namespace drawing { class XShape; } + namespace drawing { class XShapes; } } } } -namespace oox { namespace core { class XmlFilterBase; } } -namespace oox { namespace ole { class EmbeddedForm; } } +namespace oox { + namespace core { class XmlFilterBase; } + namespace ole { class EmbeddedControl; } + namespace ole { class EmbeddedForm; } +} namespace oox { namespace vml { class ShapeBase; class ShapeContainer; -struct ShapeClientData; +struct ClientData; // ============================================================================ @@ -114,6 +119,9 @@ public: /** Returns the form object used to process ActiveX form controls. */ ::oox::ole::EmbeddedForm& getControlForm() const; + /** Registers a block of shape identifiers reserved by this drawing. Block + size is 1024, shape identifiers are one-based (block 1 => 1025-2048). */ + void registerBlockId( sal_Int32 nBlockId ); /** Registers the passed embedded OLE object. The related shape will then load the OLE object data from the specified fragment. */ void registerOleObject( const OleObjectInfo& rOleObject ); @@ -125,36 +133,65 @@ public: void finalizeFragmentImport(); /** Creates and inserts all UNO shapes into the passed container. The virtual - function notifyShapeInserted() will be called for each new shape. */ + function notifyXShapeInserted() will be called for each new shape. */ void convertAndInsert() const; + /** Returns the local shape index from the passed global shape identifier. */ + sal_Int32 getLocalShapeIndex( const ::rtl::OUString& rShapeId ) const; /** Returns the registered info structure for an OLE object, if extant. */ const OleObjectInfo* getOleObjectInfo( const ::rtl::OUString& rShapeId ) const; /** Returns the registered info structure for a form control, if extant. */ const ControlInfo* getControlInfo( const ::rtl::OUString& rShapeId ) const; + /** Creates a new UNO shape object, inserts it into the passed UNO shape + container, and sets the shape position and size. */ + ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > + createAndInsertXShape( + const ::rtl::OUString& rService, + const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes, + const ::com::sun::star::awt::Rectangle& rShapeRect ) const; + + /** Creates a new UNO shape object for a form control, inserts the control + model into the form, and the shape into the passed UNO shape container. */ + ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > + createAndInsertXControlShape( + const ::oox::ole::EmbeddedControl& rControl, + const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes, + const ::com::sun::star::awt::Rectangle& rShapeRect, + sal_Int32& rnCtrlIndex ) const; + /** Derived classes may disable conversion of specific shapes. */ virtual bool isShapeSupported( const ShapeBase& rShape ) const; + /** Derived classes may return additional base names for automatic shape + name creation. */ + virtual ::rtl::OUString getShapeBaseName( const ShapeBase& rShape ) const; + /** Derived classes may calculate the shape rectangle from a non-standard anchor information string. */ - virtual bool convertShapeClientAnchor( + virtual bool convertClientAnchor( ::com::sun::star::awt::Rectangle& orShapeRect, const ::rtl::OUString& rShapeAnchor ) const; - /** Derived classes may convert additional form control properties from the - passed VML shape client data. */ - virtual void convertControlClientData( - const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& rxCtrlModel, - const ShapeClientData& rClientData ) const; - - /** Derived classes may want to know that a shape has been inserted. Will - be called from the convertAndInsert() implementation. */ - virtual void notifyShapeInserted( + /** Derived classes create a UNO shape according to the passed shape model. + Called for shape models that specify being under host control. */ + virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > + createAndInsertClientXShape( + const ShapeBase& rShape, + const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes, + const ::com::sun::star::awt::Rectangle& rShapeRect ) const; + + /** Derived classes may want to know that a UNO shape has been inserted. + Will be called from the convertAndInsert() implementation. + @param bGroupChild True = inserted into a group shape, + false = inserted directly into this drawing. */ + virtual void notifyXShapeInserted( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& rxShape, - const ::com::sun::star::awt::Rectangle& rShapeRect ); + const ::com::sun::star::awt::Rectangle& rShapeRect, + const ShapeBase& rShape, bool bGroupChild ); private: + typedef ::std::vector< sal_Int32 > BlockIdVector; typedef ::std::auto_ptr< ::oox::ole::EmbeddedForm > EmbeddedFormPtr; typedef ::std::auto_ptr< ShapeContainer > ShapeContainerPtr; typedef ::std::map< ::rtl::OUString, OleObjectInfo > OleObjectInfoMap; @@ -163,7 +200,8 @@ private: ::oox::core::XmlFilterBase& mrFilter; /// Filter object that imports/exports the VML drawing. ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > mxDrawPage; /// UNO draw page used to insert the shapes. - mutable EmbeddedFormPtr mxCtrlForm; /// The control form used to process ActiveX controls. + mutable EmbeddedFormPtr mxCtrlForm; /// The control form used to process embedded controls. + mutable BlockIdVector maBlockIds; /// Block identifiers used by this drawing. ShapeContainerPtr mxShapes; /// All shapes and shape templates. OleObjectInfoMap maOleObjects; /// Info about all embedded OLE objects, mapped by shape id. ControlInfoMap maControls; /// Info about all embedded form controls, mapped by control name. @@ -176,4 +214,3 @@ private: } // namespace oox #endif - diff --git a/oox/inc/oox/vml/vmldrawingfragment.hxx b/oox/inc/oox/vml/vmldrawingfragment.hxx index e0ffcd9c5203..0c961db1aabf 100644 --- a/oox/inc/oox/vml/vmldrawingfragment.hxx +++ b/oox/inc/oox/vml/vmldrawingfragment.hxx @@ -63,4 +63,3 @@ private: } // namespace oox #endif - diff --git a/oox/inc/oox/vml/vmlformatting.hxx b/oox/inc/oox/vml/vmlformatting.hxx index db67d7a85af4..934be61e5a65 100644 --- a/oox/inc/oox/vml/vmlformatting.hxx +++ b/oox/inc/oox/vml/vmlformatting.hxx @@ -34,6 +34,7 @@ namespace oox { class GraphicHelper; class ModelObjectHelper; class PropertyMap; + namespace drawingml { class Color; } } namespace oox { @@ -112,6 +113,35 @@ public: bool bPixelX, bool bDefaultAsPixel ); + /** Converts VML color attributes to a DrawingML color. + + @param roVmlColor The VML string representation of the color. If + existing, this can be a 3-digit or 6-digit hexadecimal RGB value + with leading '#' character, a predefined color name (e.g. 'black', + 'red', etc.), the index into an application defined color palette + in brackets with leading color name (e.g. 'red [9]' or + 'windowColor [64]'), or a color modifier used in one-color + gradients (e.g. 'fill darken(128)' or 'fill lighten(0)'). + + @param roVmlOpacity The opacity of the color. If existing, this should + be a floating-point value in the range [0.0;1.0]. + + @param nDefaultRgb Deafult RGB color used if the parameter roVmlColor + is empty. + + @param nPrimaryRgb If set to something else than API_RGB_TRANSPARENT, + specifies the color to be used to resolve the color modifiers used + in one-color gradients. + + @return The resulting DrawingML color. + */ + static ::oox::drawingml::Color decodeColor( + const GraphicHelper& rGraphicHelper, + const OptValue< ::rtl::OUString >& roVmlColor, + const OptValue< double >& roVmlOpacity, + sal_Int32 nDefaultRgb, + sal_Int32 nPrimaryRgb = API_RGB_TRANSPARENT ); + private: ConversionHelper(); ~ConversionHelper(); @@ -187,4 +217,3 @@ struct FillModel } // namespace oox #endif - diff --git a/oox/inc/oox/vml/vmlinputstream.hxx b/oox/inc/oox/vml/vmlinputstream.hxx index 311fc17df960..a425425cd0cb 100644 --- a/oox/inc/oox/vml/vmlinputstream.hxx +++ b/oox/inc/oox/vml/vmlinputstream.hxx @@ -66,4 +66,3 @@ public: } // namespace oox #endif - diff --git a/oox/inc/oox/vml/vmlshape.hxx b/oox/inc/oox/vml/vmlshape.hxx index 7c770df28477..ee95c6b61e29 100644 --- a/oox/inc/oox/vml/vmlshape.hxx +++ b/oox/inc/oox/vml/vmlshape.hxx @@ -45,6 +45,19 @@ namespace vml { class Drawing; struct ShapeParentAnchor; class ShapeContainer; +class TextBox; + +// ============================================================================ + +const sal_Int32 VML_CLIENTDATA_UNCHECKED = 0; +const sal_Int32 VML_CLIENTDATA_CHECKED = 1; +const sal_Int32 VML_CLIENTDATA_MIXED = 2; + +const sal_Int32 VML_CLIENTDATA_TEXT = 0; +const sal_Int32 VML_CLIENTDATA_INTEGER = 1; +const sal_Int32 VML_CLIENTDATA_NUMBER = 2; +const sal_Int32 VML_CLIENTDATA_REFERENCE = 3; +const sal_Int32 VML_CLIENTDATA_FORMULA = 4; // ============================================================================ @@ -52,7 +65,7 @@ class ShapeContainer; struct ShapeTypeModel { ::rtl::OUString maShapeId; /// Unique identifier of the shape. - ::rtl::OUString maName; /// Name of the shape, if present. + ::rtl::OUString maShapeName; /// Name of the shape, if present. OptValue< sal_Int32 > moShapeType; /// Builtin shape type identifier. OptValue< Int32Pair > moCoordPos; /// Top-left position of coordinate system for children scaling. @@ -93,6 +106,8 @@ public: /** Returns the shape identifier (which is unique through the containing drawing). */ inline const ::rtl::OUString& getShapeId() const { return maTypeModel.maShapeId; } + /** Returns the application defined shape type. */ + sal_Int32 getShapeType() const; /** Returns the fragment path to the embedded graphic used by this shape. */ ::rtl::OUString getGraphicPath() const; @@ -116,19 +131,39 @@ protected: // ============================================================================ /** Excel specific shape client data (such as cell anchor). */ -struct ShapeClientData +struct ClientData { ::rtl::OUString maAnchor; /// Cell anchor as comma-separated string. - ::rtl::OUString maPictureLink; /// Target cell range of picture links. - ::rtl::OUString maLinkedCell; /// Link to value cell associated to the control. - ::rtl::OUString maSourceRange; /// Link to cell range used as data source for the control. + ::rtl::OUString maFmlaMacro; /// Link to macro associated to the control. + ::rtl::OUString maFmlaPict; /// Target cell range of picture links. + ::rtl::OUString maFmlaLink; /// Link to value cell associated to the control. + ::rtl::OUString maFmlaRange; /// Link to cell range used as data source for the control. + ::rtl::OUString maFmlaGroup; /// Link to value cell associated to a group of option buttons. sal_Int32 mnObjType; /// Type of the shape. + sal_Int32 mnTextHAlign; /// Horizontal text alignment. + sal_Int32 mnTextVAlign; /// Vertical text alignment. sal_Int32 mnCol; /// Column index for spreadsheet cell note. sal_Int32 mnRow; /// Row index for spreadsheet cell note. + sal_Int32 mnChecked; /// State for checkboxes and option buttons. + sal_Int32 mnDropStyle; /// Drop down box style (read-only or editable). + sal_Int32 mnDropLines; /// Number of lines in drop down box. + sal_Int32 mnVal; /// Current value of spin buttons and scroll bars. + sal_Int32 mnMin; /// Minimum value of spin buttons and scroll bars. + sal_Int32 mnMax; /// Maximum value of spin buttons and scroll bars. + sal_Int32 mnInc; /// Small increment of spin buttons and scroll bars. + sal_Int32 mnPage; /// Large increment of spin buttons and scroll bars. + sal_Int32 mnSelType; /// Listbox selection type. + sal_Int32 mnVTEdit; /// Data type of the textbox. bool mbPrintObject; /// True = print the object. bool mbVisible; /// True = cell note is visible. - - explicit ShapeClientData(); + bool mbDde; /// True = object is linked through DDE. + bool mbNo3D; /// True = flat style, false = 3D style. + bool mbNo3D2; /// True = flat style, false = 3D style (listboxes and dropdowns). + bool mbMultiLine; /// True = textbox allows line breaks. + bool mbVScroll; /// True = textbox has a vertical scrollbar. + bool mbSecretEdit; /// True = textbox is a password edit field. + + explicit ClientData(); }; // ---------------------------------------------------------------------------- @@ -136,16 +171,21 @@ struct ShapeClientData struct ShapeModel { typedef ::std::vector< ::com::sun::star::awt::Point > PointVector; - typedef ::std::auto_ptr< ShapeClientData > ShapeClientDataPtr; + typedef ::std::auto_ptr< TextBox > TextBoxPtr; + typedef ::std::auto_ptr< ClientData > ClientDataPtr; ::rtl::OUString maType; /// Shape template with default properties. PointVector maPoints; /// Points for the polyline shape. - ShapeClientDataPtr mxClientData; /// Excel specific shape client data. + TextBoxPtr mxTextBox; /// Text contents and properties. + ClientDataPtr mxClientData; /// Excel specific client data. explicit ShapeModel(); + ~ShapeModel(); + /** Creates and returns a new shape textbox structure. */ + TextBox& createTextBox(); /** Creates and returns a new shape client data structure. */ - ShapeClientData& createClientData(); + ClientData& createClientData(); }; // ---------------------------------------------------------------------------- @@ -160,9 +200,17 @@ public: /** Returns read access to the shape model structure. */ inline const ShapeModel& getShapeModel() const { return maShapeModel; } + /** Returns read access to the shape textbox. */ + inline const TextBox* getTextBox() const { return maShapeModel.mxTextBox.get(); } + /** Returns read access to the shape client data structure. */ + inline const ClientData* getClientData() const { return maShapeModel.mxClientData.get(); } + /** Final processing after import of the drawing fragment. */ virtual void finalizeFragmentImport(); + /** Returns the real shape name if existing, or a generated shape name. */ + ::rtl::OUString getShapeName() const; + /** Returns the shape template with the passed identifier from the child shapes. */ virtual const ShapeType* getChildTypeById( const ::rtl::OUString& rShapeId ) const; /** Returns the shape with the passed identifier from the child shapes. */ @@ -327,4 +375,3 @@ private: } // namespace oox #endif - diff --git a/oox/inc/oox/vml/vmlshapecontainer.hxx b/oox/inc/oox/vml/vmlshapecontainer.hxx index a878fda2b74c..7b13763e0e40 100644 --- a/oox/inc/oox/vml/vmlshapecontainer.hxx +++ b/oox/inc/oox/vml/vmlshapecontainer.hxx @@ -29,7 +29,8 @@ #define OOX_VML_VMLSHAPECONTAINER_HXX #include <com/sun/star/awt/Rectangle.hpp> -#include "oox/helper/containerhelper.hxx" +#include "oox/helper/refmap.hxx" +#include "oox/helper/refvector.hxx" namespace com { namespace sun { namespace star { namespace drawing { class XShapes; } @@ -59,6 +60,9 @@ public: explicit ShapeContainer( Drawing& rDrawing ); ~ShapeContainer(); + /** Returns the drawing this shape container is part of. */ + inline Drawing& getDrawing() { return mrDrawing; } + /** Creates and returns a new shape template object. */ ShapeType& createShapeType(); /** Creates and returns a new shape object of the specified type. */ @@ -136,4 +140,3 @@ const ShapeBase* ShapeContainer::findShape( const Functor& rFunctor ) const } // namespace oox #endif - diff --git a/oox/inc/oox/vml/vmlshapecontext.hxx b/oox/inc/oox/vml/vmlshapecontext.hxx index bda7d90f34e2..7236fe7fef2c 100644 --- a/oox/inc/oox/vml/vmlshapecontext.hxx +++ b/oox/inc/oox/vml/vmlshapecontext.hxx @@ -33,10 +33,12 @@ namespace oox { namespace vml { +class Drawing; + struct ShapeTypeModel; class ShapeType; -struct ShapeClientData; +struct ClientData; struct ShapeModel; class ShapeBase; class GroupShape; @@ -45,20 +47,38 @@ class ShapeContainer; // ============================================================================ -class ShapeClientDataContext : public ::oox::core::ContextHandler2 +class ShapeLayoutContext : public ::oox::core::ContextHandler2 +{ +public: + explicit ShapeLayoutContext( + ::oox::core::ContextHandler2Helper& rParent, + Drawing& rDrawing ); + + virtual ::oox::core::ContextHandlerRef + onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); + +private: + Drawing& mrDrawing; +}; + +// ============================================================================ + +class ClientDataContext : public ::oox::core::ContextHandler2 { public: - explicit ShapeClientDataContext( + explicit ClientDataContext( ::oox::core::ContextHandler2Helper& rParent, - const AttributeList& rAttribs, - ShapeClientData& rClientData ); + ClientData& rClientData, + const AttributeList& rAttribs ); virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); - virtual void onEndElement( const ::rtl::OUString& rChars ); + virtual void onCharacters( const ::rtl::OUString& rChars ); + virtual void onEndElement(); private: - ShapeClientData& mrClientData; + ClientData& mrClientData; + ::rtl::OUString maElementText; }; // ============================================================================ @@ -69,9 +89,9 @@ public: static ::oox::core::ContextHandlerRef createShapeContext( ::oox::core::ContextHandler2Helper& rParent, + ShapeContainer& rShapes, sal_Int32 nElement, - const AttributeList& rAttribs, - ShapeContainer& rShapes ); + const AttributeList& rAttribs ); protected: explicit ShapeContextBase( ::oox::core::ContextHandler2Helper& rParent ); @@ -84,8 +104,8 @@ class ShapeTypeContext : public ShapeContextBase public: explicit ShapeTypeContext( ::oox::core::ContextHandler2Helper& rParent, - const AttributeList& rAttribs, - ShapeType& rShapeType ); + ShapeType& rShapeType, + const AttributeList& rAttribs ); virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); @@ -108,8 +128,8 @@ class ShapeContext : public ShapeTypeContext public: explicit ShapeContext( ::oox::core::ContextHandler2Helper& rParent, - const AttributeList& rAttribs, - ShapeBase& rShape ); + ShapeBase& rShape, + const AttributeList& rAttribs ); virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); @@ -129,8 +149,8 @@ class GroupShapeContext : public ShapeContext public: explicit GroupShapeContext( ::oox::core::ContextHandler2Helper& rParent, - const AttributeList& rAttribs, - GroupShape& rShape ); + GroupShape& rShape, + const AttributeList& rAttribs ); virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); @@ -145,4 +165,3 @@ private: } // namespace oox #endif - diff --git a/oox/inc/oox/vml/vmltextbox.hxx b/oox/inc/oox/vml/vmltextbox.hxx new file mode 100755 index 000000000000..5aedaf86bc74 --- /dev/null +++ b/oox/inc/oox/vml/vmltextbox.hxx @@ -0,0 +1,95 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef OOX_VML_VMLTEXTBOX_HXX +#define OOX_VML_VMLTEXTBOX_HXX + +#include <vector> +#include <rtl/ustring.hxx> +#include "oox/helper/helper.hxx" + +namespace oox { +namespace vml { + +// ============================================================================ + +/** Font settings for a text portion in a textbox. */ +struct TextFontModel +{ + OptValue< ::rtl::OUString > moName; /// Font name. + OptValue< ::rtl::OUString > moColor; /// Font color, HTML encoded, sort of. + OptValue< sal_Int32 > monSize; /// Font size in twips. + OptValue< sal_Int32 > monUnderline; /// Single or double underline. + OptValue< sal_Int32 > monEscapement; /// Subscript or superscript. + OptValue< bool > mobBold; + OptValue< bool > mobItalic; + OptValue< bool > mobStrikeout; + + explicit TextFontModel(); +}; + +// ============================================================================ + +/** A text portion in a textbox with the same formatting for all characters. */ +struct TextPortionModel +{ + TextFontModel maFont; + ::rtl::OUString maText; + + explicit TextPortionModel( const TextFontModel& rFont, const ::rtl::OUString& rText ); +}; + +// ============================================================================ + +/** The textbox contains all text contents and properties. */ +class TextBox +{ +public: + explicit TextBox(); + + /** Appends a new text portion to the textbox. */ + void appendPortion( const TextFontModel& rFont, const ::rtl::OUString& rText ); + + /** Returns the current number of text portions. */ + inline size_t getPortionCount() const { return maPortions.size(); } + /** Returns the font settings of the first text portion. */ + const TextFontModel* getFirstFont() const; + /** Returns the entire text of all text portions. */ + ::rtl::OUString getText() const; + +private: + typedef ::std::vector< TextPortionModel > PortionVector; + + PortionVector maPortions; +}; + +// ============================================================================ + +} // namespace vml +} // namespace oox + +#endif diff --git a/oox/inc/oox/vml/vmltextboxcontext.hxx b/oox/inc/oox/vml/vmltextboxcontext.hxx new file mode 100755 index 000000000000..1dc8832f9cc4 --- /dev/null +++ b/oox/inc/oox/vml/vmltextboxcontext.hxx @@ -0,0 +1,82 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef OOX_VML_VMLTEXTBOXCONTEXT_HXX +#define OOX_VML_VMLTEXTBOXCONTEXT_HXX + +#include "oox/core/contexthandler2.hxx" +#include "oox/vml/vmltextbox.hxx" + +namespace oox { +namespace vml { + +// ============================================================================ + +class TextPortionContext : public ::oox::core::ContextHandler2 +{ +public: + explicit TextPortionContext( + ::oox::core::ContextHandler2Helper& rParent, + TextBox& rTextBox, + const TextFontModel& rParentFont, + sal_Int32 nElement, + const AttributeList& rAttribs ); + + virtual ::oox::core::ContextHandlerRef + onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); + virtual void onCharacters( const ::rtl::OUString& rChars ); + virtual void onEndElement(); + +private: + TextBox& mrTextBox; + TextFontModel maFont; + size_t mnInitialPortions; +}; + +// ============================================================================ + +class TextBoxContext : public ::oox::core::ContextHandler2 +{ +public: + explicit TextBoxContext( + ::oox::core::ContextHandler2Helper& rParent, + TextBox& rTextBox, + const AttributeList& rAttribs ); + + virtual ::oox::core::ContextHandlerRef + onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); + +private: + TextBox& mrTextBox; +}; + +// ============================================================================ + +} // namespace vml +} // namespace oox + +#endif |