Add wxOleConvertVariant_ReturnSafeArrays flag for better SAFEARRAY handling.

While we can't change the type of wxVariant to which SAFEARRAYs are converted
by default, it's much more convenient to work with the variant objects of the
correct type, i.e. using wxVariantDataSafeArray, when dealing with SAFEARRAYs,
so add a flag which can be set to tell a wxAutomationObject to behave in this
way.

Closes #14700.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75004 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2013-10-14 15:08:35 +00:00
parent b881ffc9a9
commit 910f1a96d2
17 changed files with 379 additions and 47 deletions

View File

@@ -41,6 +41,34 @@ enum wxAutomationInstanceFlags
wxAutomationInstance_SilentIfNone = 2
};
/**
Flags used for conversions between wxVariant and OLE VARIANT.
These flags are used by wxAutomationObject for its wxConvertOleToVariant()
calls. They can be obtained by wxAutomationObject::GetConvertVariantFlags()
and set by wxAutomationObject::SetConvertVariantFlags().
@since 3.0
@header{wx/msw/ole/oleutils.h}
*/
enum wxOleConvertVariantFlags
{
/**
Default value.
*/
wxOleConvertVariant_Default = 0,
/**
If this flag is used, SAFEARRAYs contained in OLE VARIANTs will be
returned as wxVariants with wxVariantDataSafeArray type instead of
wxVariants with the list type containing the (flattened) SAFEARRAY's
elements.
*/
wxOleConvertVariant_ReturnSafeArrays = 1
};
/**
@class wxVariantDataCurrency
@@ -580,5 +608,28 @@ public:
*/
void SetLCID(LCID lcid);
/**
Returns the flags used for conversions between wxVariant and OLE
VARIANT, see wxConvertVariantToOleFlags.
The default value is wxOleConvertVariant_Default for compatibility but
it can be changed using SetConvertVariantFlags().
Notice that objects obtained by GetObject() inherit the flags from the
one that created them.
@since 3.0
*/
long GetConvertVariantFlags() const;
/**
Sets the flags used for conversions between wxVariant and OLE VARIANT,
see wxConvertVariantToOleFlags.
The default value is wxOleConvertVariant_Default.
@since 3.0
*/
void SetConvertVariantFlags(long flags);
};