20#ifndef INCLUDED_OOX_DRAWINGML_CHART_MODELBASE_HXX
21#define INCLUDED_OOX_DRAWINGML_CHART_MODELBASE_HXX
27#include <rtl/ustring.hxx>
30namespace oox {
class AttributeList; }
34template<
typename ModelType >
35class ModelRef :
public std::shared_ptr< ModelType >
39 ModelRef(
const std::shared_ptr< ModelType >& rxModel ) :
std::shared_ptr< ModelType >( rxModel ) {}
41 bool is()
const {
return this->
get() !=
nullptr; }
43 ModelType&
create() { (*this) = std::make_shared<ModelType>();
return **
this; }
44 template<
typename Param1Type >
45 ModelType&
create(
const Param1Type& rParam1 ) { (*this) = std::make_shared<ModelType>( rParam1 );
return **
this; }
46 template<
typename Param1Type,
typename Param2Type >
47 ModelType&
create(
const Param1Type& rParam1,
const Param2Type& rParam2 ) { (*this) = std::make_shared<ModelType>( rParam1, rParam2 );
return **
this; }
49 ModelType&
getOrCreate() {
if( !*
this ) (*this) = std::make_shared<ModelType>();
return **
this; }
50 template<
typename Param1Type >
51 ModelType&
getOrCreate(
const Param1Type& rParam1 ) {
if( !*
this ) (*this) = std::make_shared<ModelType>( rParam1 );
return **
this; }
54template<
typename ModelType >
61 ModelType&
create() {
return append( std::make_shared<ModelType>() ); }
62 template<
typename Param1Type >
63 ModelType&
create(
const Param1Type& rParam1 ) {
return append( std::make_shared<ModelType>( rParam1 ) ); }
64 template<
typename Param1Type,
typename Param2Type >
65 ModelType&
create(
const Param1Type& rParam1,
const Param2Type& rParam2 ) {
return append( std::make_shared<ModelType>( rParam1, rParam2 ) ); }
68 ModelType&
append( std::shared_ptr<ModelType> pModel )
71 auto pTmp = pModel.get();
72 this->push_back( std::move(pModel) );
77template<
typename KeyType,
typename ModelType >
85 ModelType&
create( KeyType eKey ) {
return insert( eKey,
new ModelType ); }
88 ModelType&
insert( KeyType eKey, ModelType* pModel ) { (*this)[ eKey ].reset( pModel );
return *pModel; }
Provides access to attribute values of an element.
Template for a map of ref-counted objects with additional accessor functions.
Template for a vector of ref-counted objects with additional accessor functions.
ModelType & insert(KeyType eKey, ModelType *pModel)
RefMap< KeyType, ModelType >::mapped_type mapped_type
ModelType & create(KeyType eKey)
RefMap< KeyType, ModelType >::value_type value_type
RefMap< KeyType, ModelType >::key_type key_type
ModelType & create(const Param1Type &rParam1)
ModelType & getOrCreate(const Param1Type &rParam1)
ModelType & create(const Param1Type &rParam1, const Param2Type &rParam2)
ModelType & getOrCreate()
ModelRef(const std::shared_ptr< ModelType > &rxModel)
RefVector< ModelType >::size_type size_type
RefVector< ModelType >::value_type value_type
ModelType & append(std::shared_ptr< ModelType > pModel)
ModelType & create(const Param1Type &rParam1, const Param2Type &rParam2)
ModelType & create(const Param1Type &rParam1)
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
sal_Int32 mnXMode
Height of this object.
double mfW
Top position of this object.
LayoutModel()
True = automatic positioning.
sal_Int32 mnTarget
Mode for height.
sal_Int32 mnYMode
Mode for left position.
double mfY
Left position of this object.
sal_Int32 mnHMode
Mode for width.
sal_Int32 mnWMode
Mode for top position.
bool mbAutoLayout
Layout target for plot area.
double mfH
Width of this object.