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 const OUString& 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,
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,
939 template<
typename ModelType >
942 auto xModel = std::make_shared<ModelType>();
944 xModel->setFormComponentMode();
948 template<
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;
bool mbSupportsAlign
True = UNO model supports Align property.
OUString maCaption
Visible caption of the button.
sal_uInt32 mnFlags
Various flags.
Provides helper functions for colors, device measurement conversion, graphics, and graphic objects ha...
Model for a Forms 2.0 list box.
ComCtlProgressBarModel(sal_uInt16 nVersion)
void setAwtModelMode()
Sets this control model to AWT model mode.
sal_Int32 mnVerticalAlign
Vertical alignment (legacy VML drawing controls only).
sal_Int32 mnShowDropButton
When to show the dropdown button.
StreamDataSequence maPictureData
Binary picture stream.
A helper that maps property identifiers to property values.
ModelType & createModel()
Creates and returns the internal control model of the specified type.
Base class for a Forms 2.0 morph data control.
sal_Int32 mnDisplayStyle
Type of the morph control.
const sal_Int32 AX_DISPLAYSTYLE_OPTBUTTON
const sal_Int32 AX_BORDERSTYLE_SINGLE
sal_Int16 getFontHeight() const
Returns the font height in points.
sal_uInt32 mnFlags
Various flags.
const sal_uInt32 AX_FLAGS_OPAQUE
const sal_uInt32 AX_FLAGS_TABASCHARACTER
const sal_Int32 AX_SPECIALEFFECT_SUNKEN
bool mbCommonPart
True = the COMCTL_COMMONDATA part exists.
sal_Int32 mnPasswordChar
Password character in edit fields.
const sal_Int32 AX_PICSIZE_STRETCH
ApiDefaultStateMode
Specifies how a form control supports the DefaultState property.
const sal_uInt32 AX_FLAGS_CAPTIONLEFT
StreamDataSequence maPictureData
Binary picture stream.
std::vector< sal_uInt32 > mnIDs
Model for a ComCtl progress bar.
void setFormComponentMode()
Sets this control model to form component mode.
AxFontData maFontData
The font settings.
Transparency is enabled by missing fill color.
Model for a Forms 2.0 combo box.
bool mbComplexPart
True = the COMCTL_COMPLEXDATA part exists.
sal_uInt32 mnFlags
Various flags.
const sal_Int32 AX_SCROLLBAR_HORIZONTAL
exports com.sun.star. awt
Model for a Forms 2.0 frame control.
const sal_uInt32 AX_FLAGS_ENABLED
const sal_Int32 AX_SHOWDROPBUTTON_ALWAYS
::std::pair< sal_Int32, sal_Int32 > AxPairData
A pair of integer values as a property.
css::uno::Reference< css::frame::XModel2 > mxModel
sal_uInt32 mnDataPartId5
Identifier for version 5.0 control data.
const sal_uInt32 AX_FLAGS_KEEPSELECTION
sal_Int32 mnVerticalAlign
Vertical alignment (legacy VML drawing controls only).
bool importSizePart(BinaryInputStream &rInStrm)
bool mbAwtModel
True = AWT control model, false = form component.
const sal_Int32 AX_PICSIZE_CLIP
const sal_Int32 AX_SPECIALEFFECT_ETCHED
const sal_uInt32 AX_FLAGS_SELECTLINE
virtual void exportBinaryModel(BinaryOutputStream &)
Derived classes export a form control model to the passed output stream.
const sal_uInt32 AX_FLAGS_SINGLECHARSELECT
sal_Int32 mnPicSizeMode
Clip, stretch, zoom.
sal_uInt32 mnFlags
Common flags for ComCtl controls.
sal_Int32 mnCycleType
Cycle in all forms or in this form.
Interface for binary output stream classes.
const sal_Int32 AX_SCROLLBAR_NONE
const sal_uInt32 AX_SYSCOLOR_BUTTONTEXT
sal_Int32 mnPicAlign
Anchor position of the picture.
static bool readPartHeader(BinaryInputStream &rInStrm, sal_uInt32 nExpPartId, sal_uInt16 nExpMajor=SAL_MAX_UINT16, sal_uInt16 nExpMinor=SAL_MAX_UINT16)
bool mbFontSupport
True = control supports the font property.
const sal_uInt32 AX_SYSCOLOR_WINDOWBACK
All entries of a font property.
exports com.sun.star. container
A form control embedded in a document draw page.
sal_uInt32 getDataPartId() const
Returns the data part identifier according to the model version.
const sal_Int32 AX_PICALIGN_CENTER
const sal_Int32 AX_PICSIZE_ZOOM
bool mbPicTiling
True = picture is repeated.
ApiControlType
Enumerates all UNO API control types supported by these filters.
sal_uInt16 mnSmooth
0 = progress blocks, 1 = pixel resolution.
Model for a Forms 2.0 label.
::std::vector< OUString > AxClassTable
sal_Int32 mnPicSizeMode
Clip, stretch, zoom.
exports com.sun.star. frame
ControlModelRef mxModel
Control model containing the properties.
const sal_Int32 AX_PICALIGN_BOTTOMLEFT
sal_Int32 mnSpecialEffect
3D border effect.
sal_Int32 mnSpecialEffect
3D border effect.
float mfMax
Maximum of the value range.
Base class for all models of ComCtl form controls.
exports com.sun.star. drawing
const sal_Int32 AX_DISPLAYSTYLE_TEXT
Control does not support tri-state, state is given as boolean.
Model for a numeric field (legacy drawing controls only).
sal_Int32 mnListRows
Number of rows in dropdown box.
StreamDataSequence maMouseIcon
Binary picture stream for mouse icon.
PropertySet maAddressConverter
const sal_Int32 AX_SHOWDROPBUTTON_FOCUS
std::map< sal_Int32, STLPropertyMapEntry > PropertyMap
virtual void convertProperties(PropertyMap &rPropMap, const ControlConverter &rConv) const override
Derived classes convert all control properties.
const sal_uInt32 AX_FLAGS_MAXLENAUTOTAB
sal_uInt32 mnDataPartId6
Identifier for version 6.0 control data.
StreamDataSequence maPictureData
Binary picture stream.
virtual bool importBinaryModel(BinaryInputStream &rInStrm) override
Derived classes import a form control model from the passed input stream.
sal_Int32 mnScrollBars
Horizontal/vertical scroll bar.
const GraphicHelper & mrGraphicHelper
css::uno::Sequence< sal_Int8 > StreamDataSequence
sal_uInt32 mnBackColor
Fill color.
StdFontInfo maFontData
Font formatting.
A base class with useful helper functions for something that is able to convert ActiveX and ComCtl fo...
const sal_Int32 AX_SHOWDROPBUTTON_NEVER
sal_uInt32 mnTextColor
Text color.
const sal_Int32 AX_PICALIGN_TOPRIGHT
Model for a Forms 2.0 text box.
virtual ApiControlType getControlType() const override
Derived classes return the UNO control type enum value.
virtual bool importBinaryModel(BinaryInputStream &rInStrm) override
Derived classes import a form control model from the passed input stream.
const sal_Int32 AX_SCROLLBAR_VERTICAL
const sal_Int32 AX_BORDERSTYLE_NONE
sal_uInt32 mnVariousPropertyBits
OUString maCaption
Visible caption of the button.
const sal_uInt32 AX_SYSCOLOR_BUTTONFACE
OUString maName
Name of the control.
Base class for Forms 2.0 controls supporting text formatting.
bool hasModel() const
Returns true, if the internal control model exists.
sal_uInt32 mnPicturePos
Position of the picture relative to text.
const sal_uInt32 AX_FLAGS_HIDESELECTION
const sal_Int32 AX_SPECIALEFFECT_FLAT
Model for a Forms 2.0 check box.
const sal_uInt32 AX_FLAGS_MULTILINE
sal_Int32 mnScrollBars
Horizontal/vertical scroll bar.
const sal_uInt32 AX_SYSCOLOR_WINDOWFRAME
A wrapper for a UNO property set.
AxPairData maSize
Size of the control in 1/100 mm.
const sal_Int32 AX_SELECTION_MULTI
const sal_uInt32 AX_FLAGS_LOCKED
const sal_Int32 AX_DISPLAYSTYLE_COMBOBOX
const sal_Int32 AX_SELECTION_SINGLE
AxPairData maLogicalSize
Logical form size (scroll area).
sal_Int32 mnMultiSelect
Selection mode.
const sal_uInt16 COMCTL_VERSION_50
sal_Int32 mnMatchEntry
Auto completion mode.
const sal_uInt16 COMCTL_VERSION_60
const sal_Int32 AX_DISPLAYSTYLE_CHECKBOX
sal_Int32 mnBorderStyle
Flat border style.
exports com.sun.star. form
Base class for all models of form controls.
sal_Int32 mnBorderStyle
Flat border style.
sal_Int32 mnSpecialEffect
3D border effect.
const sal_Int32 AX_SPECIALEFFECT_RAISED
sal_uInt32 mnTextColor
Text color.
Base class for ActiveX container controls.
OUString maGroupName
Group name for option buttons.
sal_uInt32 mnBorderColor
Flat border color.
Stores data about a StdFont font structure.
const sal_uInt16 mnVersion
Current version of the ComCtl control model.
OUString maValue
Current value of the control.
const sal_uInt32 AX_FLAGS_EDITABLE
AxPairData maScrollPos
Scroll position.
virtual void convertProperties(PropertyMap &rPropMap, const ControlConverter &rConv) const override
Derived classes convert all control properties.
const sal_uInt32 AX_FLAGS_IMEMODE_MASK
const sal_Int32 AX_SELECTION_EXTENDED
const sal_uInt32 AX_FLAGS_ENTERASNEWLINE
ApiTransparencyMode
Specifies how a form control supports transparent background.
css::uno::Reference< css::frame::XModel > mxDocModel
OUString maCaption
Visible caption of the form.
virtual void exportCompObj(BinaryOutputStream &)
Derived classes export CompObjStream contents.
exports com.sun.star. lang
Model for a Forms 2.0 image.
sal_Int32 mnPicAlign
Anchor position of the picture.
sal_Int32 mnBorderStyle
Flat border style.
const sal_uInt32 AX_SYSCOLOR_WINDOWTEXT
const sal_uInt32 AX_FLAGS_COLUMNHEADS
const sal_Int32 AX_DISPLAYSTYLE_LISTBOX
sal_Int32 mnSpecialEffect
3D border effect.
const sal_uInt32 AX_FLAGS_WORDWRAP
const sal_Int32 AX_SPECIALEFFECT_BUMPED
sal_uInt32 mnBackColor
Fill color.
ControlModelBase * getModel()
Returns read/write access to the internal control model.
Base class for all models of Form 2.0 form controls.
sal_uInt32 mnBorderColor
Flat border color.
const sal_uInt32 AX_FLAGS_BORDERSSUPPRESSED
Control does not support transparency.
const sal_uInt32 AX_FLAGS_ENTIREROWS
virtual void importControlData(BinaryInputStream &rInStrm) override
std::shared_ptr< ControlModelBase > ControlModelRef
std::vector< OUString > maTabNames
const sal_Int32 AX_DISPLAYSTYLE_TOGGLE
bool importComplexPart(BinaryInputStream &rInStrm)
Reference< XModel > xModel
sal_Int32 mnBorderStyle
Flat border style.
bool importCommonPart(BinaryInputStream &rInStrm, sal_uInt32 nPartSize)
virtual bool importBinaryModel(BinaryInputStream &rInStrm) override
Derived classes import a form control model from the passed input stream.
sal_uInt32 mnFlags
Various flags.
ComCtlModelBase(sal_uInt32 nDataPartId5, sal_uInt32 nDataPartId6, sal_uInt16 nVersion)
sal_uInt32 mnBackColor
Fill color.
PropertySet maRangeConverter
sal_uInt32 mnTextColor
Text color.
const sal_Int32 AX_DISPLAYSTYLE_DROPDOWN
const sal_Int32 AX_PICALIGN_BOTTOMRIGHT
sal_Int32 mnMaxLength
Maximum character count.
sal_uInt16 mnVertical
0 = horizontal, 1 = vertical.
sal_uInt32 mnBackColor
Fill color.
const ControlModelBase * getModel() const
Returns read-only access to the internal control model.
bool mbPicTiling
True = picture is repeated.
float mfMin
Minimum of the value range.
sal_uInt32 mnBorderColor
Flat border color.
Control does not support tri-state, state is given as short.
const sal_uInt32 AX_FLAGS_DRAGENABLED
css::uno::Sequence< OUString > msListData
const sal_uInt32 AX_FLAGS_EXISTINGENTRIES
virtual void convertProperties(PropertyMap &rPropMap, const ControlConverter &rConv) const override
Derived classes convert all control properties.
Control supports tri-state, state is given as short.
const sal_Int32 AX_PICALIGN_TOPLEFT
const sal_uInt32 AX_FLAGS_AUTOSIZE
css::uno::Sequence< sal_Int16 > msIndices
sal_uInt32 mnBorderColor
Flat border color.
std::vector< OUString > maItems
virtual void importControlData(BinaryInputStream &rInStrm)=0