20#include <helper/property.hxx>
23#include <com/sun/star/awt/FontDescriptor.hpp>
24#include <com/sun/star/awt/XDevice.hpp>
25#include <com/sun/star/awt/tree/XTreeDataModel.hpp>
26#include <com/sun/star/awt/grid/XGridDataModel.hpp>
27#include <com/sun/star/awt/grid/XGridColumnModel.hpp>
28#include <com/sun/star/view/SelectionType.hpp>
29#include <com/sun/star/style/VerticalAlignment.hpp>
30#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
31#include <com/sun/star/util/Date.hpp>
32#include <com/sun/star/util/Time.hpp>
33#include <com/sun/star/beans/PropertyAttribute.hpp>
34#include <com/sun/star/graphic/XGraphic.hpp>
35#include <com/sun/star/container/XNameContainer.hpp>
39#include <unordered_map>
41using ::com::sun::star::uno::Any;
42using ::com::sun::star::uno::Sequence;
43using ::com::sun::star::uno::Reference;
44using ::com::sun::star::awt::XDevice;
45using ::com::sun::star::awt::FontDescriptor;
46using ::com::sun::star::style::VerticalAlignment;
47using ::com::sun::star::graphic::XGraphic;
53struct ImplPropertyInfo
58 bool bDependsOnOthers;
60 ImplPropertyInfo( sal_uInt16 nId,
const css::uno::Type& rType,
61 sal_Int16 nAttrs,
bool bDepends =
false )
65 , bDependsOnOthers(bDepends)
73#define DECL_PROP_1( asciiname, id, type, attrib1 ) \
74 { asciiname, ImplPropertyInfo( BASEPROPERTY_##id, cppu::UnoType<type>::get(), css::beans::PropertyAttribute::attrib1 ) }
75#define DECL_PROP_2( asciiname, id, type, attrib1, attrib2 ) \
76 { asciiname, ImplPropertyInfo( BASEPROPERTY_##id, cppu::UnoType<type>::get(), css::beans::PropertyAttribute::attrib1 | css::beans::PropertyAttribute::attrib2 ) }
77#define DECL_PROP_3( asciiname, id, type, attrib1, attrib2, attrib3 ) \
78 { asciiname, ImplPropertyInfo( BASEPROPERTY_##id, cppu::UnoType<type>::get(), css::beans::PropertyAttribute::attrib1 | css::beans::PropertyAttribute::attrib2 | css::beans::PropertyAttribute::attrib3 ) }
80#define DECL_DEP_PROP_2( asciiname, id, type, attrib1, attrib2 ) \
81 { asciiname, ImplPropertyInfo( BASEPROPERTY_##id, cppu::UnoType<type>::get(), css::beans::PropertyAttribute::attrib1 | css::beans::PropertyAttribute::attrib2, true ) }
82#define DECL_DEP_PROP_3( asciiname, id, type, attrib1, attrib2, attrib3 ) \
83 { asciiname, ImplPropertyInfo( BASEPROPERTY_##id, cppu::UnoType<type>::get(), css::beans::PropertyAttribute::attrib1 | css::beans::PropertyAttribute::attrib2 | css::beans::PropertyAttribute::attrib3, true ) }
258 DECL_PROP_1 (
"GridDataModel", GRID_DATAMODEL, Reference< css::awt::grid::XGridDataModel >,
BOUND ),
259 DECL_PROP_1 (
"ColumnModel", GRID_COLUMNMODEL, Reference< css::awt::grid::XGridColumnModel >,
BOUND ),
275 return aImplPropertyInfos;
281 auto it = rMap.find(rPropertyName);
282 return it != rMap.end() ? it->second.nPropId : 0;
289 for (
auto const & rPair : rMap)
291 return &rPair.second;
299 for (
auto const & rPair : rMap)
303 assert(
false &&
"Invalid PropertyId!");
304 static const OUString
EMPTY;
311 DBG_ASSERT( pImplPropertyInfo,
"Invalid PropertyId!" );
312 return pImplPropertyInfo ? &pImplPropertyInfo->aType :
nullptr;
318 DBG_ASSERT( pImplPropertyInfo,
"Invalid PropertyId!" );
319 return pImplPropertyInfo ? pImplPropertyInfo->nAttribs : 0;
325 DBG_ASSERT( pImplPropertyInfo,
"Invalid PropertyId!" );
326 return pImplPropertyInfo && pImplPropertyInfo->bDependsOnOthers;
#define DBG_ASSERT(sCon, aError)
constexpr OUStringLiteral TITLE
const sal_uInt16 BACKGROUNDCOLOR
const sal_uInt16 TEXTCOLOR
const sal_uInt16 FONTDESCRIPTOR
constexpr OUStringLiteral EMPTY
constexpr tools::Long BORDER
static const ImpPropertyInfoMap & ImplGetPropertyInfos()
sal_Int16 GetPropertyAttribs(sal_uInt16 nPropertyId)
bool CompareProperties(const css::uno::Any &r1, const css::uno::Any &r2)
#define DECL_PROP_1(asciiname, id, type, attrib1)
const OUString & GetPropertyName(sal_uInt16 nPropertyId)
std::unordered_map< OUString, ImplPropertyInfo > ImpPropertyInfoMap
#define DECL_DEP_PROP_3(asciiname, id, type, attrib1, attrib2, attrib3)
#define DECL_PROP_2(asciiname, id, type, attrib1, attrib2)
bool DoesDependOnOthers(sal_uInt16 nPropertyId)
static const ImplPropertyInfo * ImplGetImplPropertyInfo(sal_uInt16 nPropertyId)
const css::uno::Type * GetPropertyType(sal_uInt16 nPropertyId)
#define DECL_DEP_PROP_2(asciiname, id, type, attrib1, attrib2)
sal_uInt16 GetPropertyId(const OUString &rPropertyName)
#define DECL_PROP_3(asciiname, id, type, attrib1, attrib2, attrib3)