20#ifndef INCLUDED_OOX_OLE_AXCONTROL_HXX
21#define INCLUDED_OOX_OLE_AXCONTROL_HXX
26#include <com/sun/star/uno/Reference.hxx>
27#include <com/sun/star/uno/Sequence.hxx>
34#include <rtl/ustring.hxx>
38 namespace awt {
class XControlModel; }
39 namespace container {
class XIndexContainer; }
40 namespace drawing {
class XDrawPage; }
41 namespace frame {
class XModel; }
42 namespace form {
class XFormsSupplier; }
43 namespace lang {
class XMultiServiceFactory; }
47 class BinaryInputStream;
48 class BinaryOutputStream;
56#define COMCTL_GUID_SCROLLBAR_60 "{FE38753A-44A3-11D1-B5B7-0000C09000C4}"
57#define COMCTL_GUID_PROGRESSBAR_50 "{0713E8D2-850A-101B-AFC0-4210102A8DA7}"
58#define COMCTL_GUID_PROGRESSBAR_60 "{35053A22-8589-11D1-B16A-00C0F0283628}"
64#define AX_GUID_COMMANDBUTTON "{D7053240-CE69-11CD-a777-00dd01143c57}"
65#define AX_GUID_LABEL "{978C9E23-D4B0-11CE-bf2d-00aa003f40d0}"
66#define AX_GUID_IMAGE "{4C599241-6926-101B-9992-00000b65c6f9}"
67#define AX_GUID_TOGGLEBUTTON "{8BD21D60-EC42-11CE-9e0d-00aa006002f3}"
68#define AX_GUID_CHECKBOX "{8BD21D40-EC42-11CE-9e0d-00aa006002f3}"
69#define AX_GUID_OPTIONBUTTON "{8BD21D50-EC42-11CE-9e0d-00aa006002f3}"
70#define AX_GUID_TEXTBOX "{8BD21D10-EC42-11CE-9e0d-00aa006002f3}"
71#define AX_GUID_LISTBOX "{8BD21D20-EC42-11CE-9e0d-00aa006002f3}"
72#define AX_GUID_COMBOBOX "{8BD21D30-EC42-11CE-9e0d-00aa006002f3}"
73#define AX_GUID_SPINBUTTON "{79176FB0-B7F2-11CE-97ef-00aa006d2776}"
74#define AX_GUID_SCROLLBAR "{DFD181E0-5E2F-11CE-a449-00aa004a803d}"
75#define AX_GUID_FRAME "{6E182020-F460-11CE-9bcd-00aa00608e01}"
79#define HTML_GUID_SELECT "{5512D122-5CC6-11CF-8d67-00aa00bdce1d}"
80#define HTML_GUID_TEXTBOX "{5512D124-5CC6-11CF-8d67-00aa00bdce1d}"
197 const css::uno::Reference< css::frame::XModel >& rxDocModel,
199 bool bDefaultColorBgr =
true );
205 void convertPosition(
218 sal_uInt32 nOleColor )
const;
220 static void convertToMSColor(
223 sal_uInt32& nOleColor,
224 sal_uInt32 nDefault = 0 );
233 static void convertOrientation(
237 static void convertToMSOrientation(
242 static void convertVerticalAlign(
244 sal_Int32 nVerticalAlign );
247 static void convertScrollBar(
249 sal_Int32 nMin, sal_Int32 nMax, sal_Int32 nPosition,
250 sal_Int32 nSmallChange, sal_Int32 nLargeChange,
bool bAwtModel );
253 void convertScrollabilitySettings(
256 sal_Int32 nScrollBars )
const;
261 const css::uno::Reference< css::awt::XControlModel >& rxCtrlModel,
262 const OUString& rCtrlSource,
263 const OUString& rRowSource,
264 sal_Int32 nRefSheet = 0 )
const;
269 void convertAxBackground(
271 sal_uInt32 nBackColor,
276 void convertAxBorder(
278 sal_uInt32 nBorderColor,
279 sal_Int32 nBorderStyle,
280 sal_Int32 nSpecialEffect )
const;
282 static void convertToAxBorder(
284 sal_uInt32& nBorderColor,
285 sal_Int32& nBorderStyle,
286 sal_Int32& nSpecialEffect );
289 static void convertAxVisualEffect(
291 sal_Int32 nSpecialEffect );
293 static void convertToAxVisualEffect(
295 sal_Int32& nSpecialEffect );
299 void convertAxPicture(
302 sal_uInt32 nPicPos )
const;
306 void convertAxPicture(
309 sal_Int32 nPicSizeMode )
const;
313 static void convertAxState(
315 std::u16string_view rValue,
316 sal_Int32 nMultiSelect,
320 static void convertToAxState(
323 sal_Int32& nMultiSelect,
327 static void convertAxOrientation(
330 sal_Int32 nOrientation );
332 static void convertToAxOrientation(
334 sal_Int32& nOrientation );
359 OUString getServiceName()
const;
362 virtual void importProperty( sal_Int32 nPropId,
const OUString& rValue );
396 sal_uInt32 nDataPartId5, sal_uInt32 nDataPartId6, sal_uInt16
nVersion );
409 sal_uInt32 nExpPartId,
410 sal_uInt16 nExpMajor = SAL_MAX_UINT16,
411 sal_uInt16 nExpMinor = SAL_MAX_UINT16 );
477 virtual void importProperty( sal_Int32 nPropId,
const OUString& rValue )
override;
487 virtual void importProperty( sal_Int32 nPropId,
const OUString& rValue )
override;
510 virtual void importProperty( sal_Int32 nPropId,
const OUString& rValue )
override;
511 virtual void importPictureData( sal_Int32 nPropId,
BinaryInputStream& rInStrm )
override;
538 virtual void importProperty( sal_Int32 nPropId,
const OUString& rValue )
override;
565 virtual void importProperty( sal_Int32 nPropId,
const OUString& rValue )
override;
566 virtual void importPictureData( sal_Int32 nPropId,
BinaryInputStream& rInStrm )
override;
611 virtual void importProperty( sal_Int32 nPropId,
const OUString& rValue )
override;
612 virtual void importPictureData( sal_Int32 nPropId,
BinaryInputStream& rInStrm )
override;
742 virtual void importProperty( sal_Int32 nPropId,
const OUString& rValue )
override;
770 virtual void importProperty( sal_Int32 nPropId,
const OUString& rValue )
override;
803 virtual void importProperty( sal_Int32 nPropId,
const OUString& rValue )
override;
859 void importPageAndMultiPageProperties(
BinaryInputStream& rInStrm, sal_Int32 nPages );
903 template<
typename ModelType >
904 inline ModelType& createModel();
907 template<
typename ModelType,
typename ParamType >
908 inline ModelType& createModel(
const ParamType& rParam );
922 OUString getServiceName()
const;
925 bool convertProperties(
926 const css::uno::Reference< css::awt::XControlModel >& rxCtrlModel,
929 void convertFromProperties(
930 const css::uno::Reference< css::awt::XControlModel >& rxCtrlModel,
939template<
typename ModelType >
942 auto xModel = std::make_shared<ModelType>();
944 xModel->setFormComponentMode();
948template<
typename ModelType,
typename ParamType >
951 auto xModel = std::make_shared<ModelType>( rParam );
953 xModel->setFormComponentMode();
963 const css::uno::Reference< css::frame::XModel >& rxDocModel,
964 const css::uno::Reference< css::drawing::XDrawPage >& rxDrawPage,
969 css::uno::Reference< css::awt::XControlModel >
973 const css::uno::Reference< css::container::XIndexContainer >&
978 css::uno::Reference< css::container::XIndexContainer >
const &
985 css::uno::Reference< css::container::XIndexContainer >
mxFormIC;
css::uno::Reference< css::frame::XModel2 > mxModel
Interface for binary output stream classes.
Provides helper functions for colors, device measurement conversion, graphics, and graphic objects ha...
A helper that maps property identifiers to property values.
A wrapper for a UNO property set.
Model for a Forms 2.0 check box.
Model for a Forms 2.0 combo box.
Base class for ActiveX container controls.
OUString maCaption
Visible caption of the form.
sal_Int32 mnBorderStyle
Flat border style.
sal_Int32 mnPicSizeMode
Clip, stretch, zoom.
sal_uInt32 mnBorderColor
Flat border color.
sal_uInt32 mnBackColor
Fill color.
sal_uInt32 mnFlags
Various flags.
StreamDataSequence maPictureData
Binary picture stream.
sal_Int32 mnScrollBars
Horizontal/vertical scroll bar.
bool mbFontSupport
True = control supports the font property.
sal_Int32 mnCycleType
Cycle in all forms or in this form.
sal_Int32 mnPicAlign
Anchor position of the picture.
sal_uInt32 mnTextColor
Text color.
bool mbPicTiling
True = picture is repeated.
AxPairData maScrollPos
Scroll position.
sal_Int32 mnSpecialEffect
3D border effect.
AxPairData maLogicalSize
Logical form size (scroll area).
Base class for all models of Form 2.0 form controls.
Base class for Forms 2.0 controls supporting text formatting.
AxFontData maFontData
The font settings.
sal_Int16 getFontHeight() const
Returns the font height in points.
bool mbSupportsAlign
True = UNO model supports Align property.
Model for a Forms 2.0 frame control.
Model for a Forms 2.0 image.
sal_Int32 mnPicAlign
Anchor position of the picture.
sal_Int32 mnBorderStyle
Flat border style.
sal_Int32 mnPicSizeMode
Clip, stretch, zoom.
sal_uInt32 mnFlags
Various flags.
bool mbPicTiling
True = picture is repeated.
sal_uInt32 mnBackColor
Fill color.
sal_Int32 mnSpecialEffect
3D border effect.
sal_uInt32 mnBorderColor
Flat border color.
StreamDataSequence maPictureData
Binary picture stream.
Model for a Forms 2.0 label.
sal_Int32 mnSpecialEffect
3D border effect.
sal_uInt32 mnTextColor
Text color.
sal_uInt32 mnBackColor
Fill color.
OUString maCaption
Visible caption of the button.
sal_Int32 mnBorderStyle
Flat border style.
sal_uInt32 mnFlags
Various flags.
sal_uInt32 mnBorderColor
Flat border color.
sal_Int32 mnVerticalAlign
Vertical alignment (legacy VML drawing controls only).
Model for a Forms 2.0 list box.
Base class for a Forms 2.0 morph data control.
sal_Int32 mnVerticalAlign
Vertical alignment (legacy VML drawing controls only).
sal_Int32 mnListRows
Number of rows in dropdown box.
sal_Int32 mnMultiSelect
Selection mode.
sal_uInt32 mnFlags
Various flags.
sal_Int32 mnShowDropButton
When to show the dropdown button.
OUString maCaption
Visible caption of the button.
OUString maValue
Current value of the control.
sal_Int32 mnMaxLength
Maximum character count.
sal_uInt32 mnBackColor
Fill color.
sal_Int32 mnBorderStyle
Flat border style.
sal_Int32 mnMatchEntry
Auto completion mode.
sal_Int32 mnPasswordChar
Password character in edit fields.
OUString maGroupName
Group name for option buttons.
sal_uInt32 mnBorderColor
Flat border color.
sal_Int32 mnSpecialEffect
3D border effect.
sal_uInt32 mnPicturePos
Position of the picture relative to text.
sal_Int32 mnScrollBars
Horizontal/vertical scroll bar.
StreamDataSequence maPictureData
Binary picture stream.
sal_uInt32 mnTextColor
Text color.
sal_Int32 mnDisplayStyle
Type of the morph control.
std::vector< sal_uInt32 > mnIDs
Model for a numeric field (legacy drawing controls only).
std::vector< OUString > maItems
std::vector< OUString > maTabNames
sal_uInt32 mnVariousPropertyBits
Model for a Forms 2.0 text box.
Base class for all models of ComCtl form controls.
StreamDataSequence maMouseIcon
Binary picture stream for mouse icon.
bool importSizePart(BinaryInputStream &rInStrm)
virtual bool importBinaryModel(BinaryInputStream &rInStrm) override
Derived classes import a form control model from the passed input stream.
sal_uInt32 mnFlags
Common flags for ComCtl controls.
sal_uInt32 mnDataPartId6
Identifier for version 6.0 control data.
const sal_uInt16 mnVersion
Current version of the ComCtl control model.
sal_uInt32 getDataPartId() const
Returns the data part identifier according to the model version.
virtual void convertProperties(PropertyMap &rPropMap, const ControlConverter &rConv) const override
Derived classes convert all control properties.
bool importComplexPart(BinaryInputStream &rInStrm)
bool mbCommonPart
True = the COMCTL_COMMONDATA part exists.
StdFontInfo maFontData
Font formatting.
sal_uInt32 mnDataPartId5
Identifier for version 5.0 control data.
bool importCommonPart(BinaryInputStream &rInStrm, sal_uInt32 nPartSize)
static bool readPartHeader(BinaryInputStream &rInStrm, sal_uInt32 nExpPartId, sal_uInt16 nExpMajor=SAL_MAX_UINT16, sal_uInt16 nExpMinor=SAL_MAX_UINT16)
bool mbComplexPart
True = the COMCTL_COMPLEXDATA part exists.
ComCtlModelBase(sal_uInt32 nDataPartId5, sal_uInt32 nDataPartId6, sal_uInt16 nVersion)
virtual void importControlData(BinaryInputStream &rInStrm)=0
Model for a ComCtl progress bar.
virtual void importControlData(BinaryInputStream &rInStrm) override
virtual ApiControlType getControlType() const override
Derived classes return the UNO control type enum value.
float mfMax
Maximum of the value range.
sal_uInt16 mnVertical
0 = horizontal, 1 = vertical.
ComCtlProgressBarModel(sal_uInt16 nVersion)
float mfMin
Minimum of the value range.
sal_uInt16 mnSmooth
0 = progress blocks, 1 = pixel resolution.
virtual void convertProperties(PropertyMap &rPropMap, const ControlConverter &rConv) const override
Derived classes convert all control properties.
A base class with useful helper functions for something that is able to convert ActiveX and ComCtl fo...
css::uno::Reference< css::frame::XModel > mxDocModel
PropertySet maAddressConverter
const GraphicHelper & mrGraphicHelper
PropertySet maRangeConverter
Base class for all models of form controls.
void setAwtModelMode()
Sets this control model to AWT model mode.
virtual void exportCompObj(BinaryOutputStream &)
Derived classes export CompObjStream contents.
bool mbAwtModel
True = AWT control model, false = form component.
void setFormComponentMode()
Sets this control model to form component mode.
AxPairData maSize
Size of the control in 1/100 mm.
virtual void exportBinaryModel(BinaryOutputStream &)
Derived classes export a form control model to the passed output stream.
virtual bool importBinaryModel(BinaryInputStream &rInStrm)=0
Derived classes import a form control model from the passed input stream.
virtual ApiControlType getControlType() const =0
Derived classes return the UNO control type enum value.
A form control embedded in a document draw page.
const ControlModelBase * getModel() const
Returns read-only access to the internal control model.
ControlModelRef mxModel
Control model containing the properties.
ModelType & createModel()
Creates and returns the internal control model of the specified type.
OUString maName
Name of the control.
bool hasModel() const
Returns true, if the internal control model exists.
ControlModelBase * getModel()
Returns read/write access to the internal control model.
css::uno::Sequence< sal_Int16 > msIndices
css::uno::Sequence< OUString > msListData
virtual bool importBinaryModel(BinaryInputStream &rInStrm) override
Derived classes import a form control model from the passed input stream.
virtual void convertProperties(PropertyMap &rPropMap, const ControlConverter &rConv) const override
Derived classes convert all control properties.
virtual bool importBinaryModel(BinaryInputStream &rInStrm) override
Derived classes import a form control model from the passed input stream.
const sal_uInt32 AX_FLAGS_AUTOSIZE
const sal_uInt32 AX_FLAGS_TABASCHARACTER
const sal_Int32 AX_BORDERSTYLE_SINGLE
const sal_uInt32 AX_SYSCOLOR_WINDOWFRAME
const sal_uInt32 AX_SYSCOLOR_WINDOWTEXT
const sal_uInt32 AX_FLAGS_SELECTLINE
const sal_uInt32 AX_FLAGS_CAPTIONLEFT
const sal_Int32 AX_DISPLAYSTYLE_TOGGLE
const sal_uInt32 AX_FLAGS_DRAGENABLED
const sal_Int32 AX_DISPLAYSTYLE_TEXT
const sal_Int32 AX_SELECTION_SINGLE
const sal_Int32 AX_DISPLAYSTYLE_LISTBOX
const sal_uInt32 AX_FLAGS_EDITABLE
const sal_Int32 AX_DISPLAYSTYLE_DROPDOWN
const sal_Int32 AX_SPECIALEFFECT_BUMPED
const sal_Int32 AX_SPECIALEFFECT_SUNKEN
const sal_uInt32 AX_FLAGS_ENABLED
const sal_uInt32 AX_FLAGS_OPAQUE
const sal_Int32 AX_PICSIZE_CLIP
const sal_uInt32 AX_FLAGS_IMEMODE_MASK
ApiDefaultStateMode
Specifies how a form control supports the DefaultState property.
@ API_DEFAULTSTATE_BOOLEAN
Control does not support tri-state, state is given as boolean.
@ API_DEFAULTSTATE_TRISTATE
Control supports tri-state, state is given as short.
@ API_DEFAULTSTATE_SHORT
Control does not support tri-state, state is given as short.
const sal_Int32 AX_BORDERSTYLE_NONE
const sal_Int32 AX_PICALIGN_BOTTOMRIGHT
const sal_uInt32 AX_SYSCOLOR_WINDOWBACK
const sal_uInt32 AX_FLAGS_SINGLECHARSELECT
const sal_uInt32 AX_FLAGS_KEEPSELECTION
const sal_uInt32 AX_SYSCOLOR_BUTTONFACE
const sal_Int32 AX_SHOWDROPBUTTON_NEVER
const sal_uInt32 AX_FLAGS_MULTILINE
const sal_Int32 AX_PICALIGN_BOTTOMLEFT
const sal_uInt32 AX_FLAGS_EXISTINGENTRIES
const sal_Int32 AX_SCROLLBAR_HORIZONTAL
::std::pair< sal_Int32, sal_Int32 > AxPairData
A pair of integer values as a property.
ApiControlType
Enumerates all UNO API control types supported by these filters.
@ API_CONTROL_RADIOBUTTON
@ API_CONTROL_PROGRESSBAR
const sal_Int32 AX_SCROLLBAR_VERTICAL
const sal_Int32 AX_SPECIALEFFECT_RAISED
const sal_Int32 AX_PICSIZE_STRETCH
const sal_Int32 AX_DISPLAYSTYLE_COMBOBOX
const sal_Int32 AX_SELECTION_MULTI
const sal_uInt16 COMCTL_VERSION_60
const sal_Int32 AX_SPECIALEFFECT_ETCHED
const sal_Int32 AX_SCROLLBAR_NONE
const sal_uInt32 AX_FLAGS_BORDERSSUPPRESSED
const sal_uInt16 COMCTL_VERSION_50
const sal_uInt32 AX_FLAGS_HIDESELECTION
const sal_Int32 AX_SHOWDROPBUTTON_ALWAYS
const sal_Int32 AX_SPECIALEFFECT_FLAT
std::shared_ptr< ControlModelBase > ControlModelRef
ApiTransparencyMode
Specifies how a form control supports transparent background.
const sal_Int32 AX_DISPLAYSTYLE_OPTBUTTON
const sal_Int32 AX_PICALIGN_TOPRIGHT
const sal_uInt32 AX_FLAGS_LOCKED
const sal_Int32 AX_SHOWDROPBUTTON_FOCUS
const sal_Int32 AX_SELECTION_EXTENDED
::std::vector< OUString > AxClassTable
const sal_uInt32 AX_FLAGS_WORDWRAP
const sal_Int32 AX_PICALIGN_TOPLEFT
const sal_uInt32 AX_FLAGS_ENTERASNEWLINE
const sal_Int32 AX_PICALIGN_CENTER
const sal_Int32 AX_PICSIZE_ZOOM
const sal_uInt32 AX_FLAGS_COLUMNHEADS
const sal_uInt32 AX_FLAGS_MAXLENAUTOTAB
const sal_uInt32 AX_SYSCOLOR_BUTTONTEXT
const sal_Int32 AX_DISPLAYSTYLE_CHECKBOX
const sal_uInt32 AX_FLAGS_ENTIREROWS
css::uno::Sequence< sal_Int8 > StreamDataSequence
std::map< sal_Int32, STLPropertyMapEntry > PropertyMap
All entries of a font property.
Stores data about a StdFont font structure.
Reference< XModel > xModel