30class HeadersFootersIndexAccess :
public ::cppu::WeakImplHelper<container::XIndexAccess >
33 uno::Reference< XHelperInterface >
mxParent;
34 uno::Reference< uno::XComponentContext >
mxContext;
35 uno::Reference< frame::XModel >
mxModel;
36 uno::Reference< beans::XPropertySet > mxPageStyleProps;
40 HeadersFootersIndexAccess( uno::Reference< XHelperInterface > xParent, uno::Reference< uno::XComponentContext > xContext, uno::Reference< frame::XModel > xModel, uno::Reference< beans::XPropertySet > xPageStyleProps,
bool bHeader ) :
mxParent(
std::move( xParent )),
mxContext(
std::move( xContext )),
mxModel(
std::move(
xModel )), mxPageStyleProps(
std::move( xPageStyleProps )), mbHeader( bHeader ) {}
43 virtual sal_Int32 SAL_CALL getCount( )
override
48 virtual uno::Any SAL_CALL getByIndex( sal_Int32
Index )
override
51 throw lang::IndexOutOfBoundsException();
52 return uno::Any( uno::Reference< word::XHeaderFooter >(
new SwVbaHeaderFooter( mxParent, mxContext, mxModel, mxPageStyleProps, mbHeader,
Index ) ) );
54 virtual uno::Type SAL_CALL getElementType( )
override
58 virtual sal_Bool SAL_CALL hasElements( )
override
69 explicit HeadersFootersEnumWrapper(
SwVbaHeadersFooters* _pHeadersFooters ) : m_pHeadersFooters( _pHeadersFooters ), m_nIndex( 0 ) {}
70 virtual sal_Bool SAL_CALL hasMoreElements( )
override
72 return ( m_nIndex < m_pHeadersFooters->getCount() );
75 virtual uno::Any SAL_CALL nextElement( )
override
77 if ( m_nIndex < m_pHeadersFooters->getCount() )
79 throw container::NoSuchElementException();
85SwVbaHeadersFooters::SwVbaHeadersFooters(
const uno::Reference< XHelperInterface >& xParent,
const uno::Reference< uno::XComponentContext > & xContext,
const uno::Reference< frame::XModel >& xModel,
const uno::Reference< beans::XPropertySet >& xPageStyleProps,
bool isHeader ):
SwVbaHeadersFooters_BASE( xParent, xContext, new HeadersFootersIndexAccess( xParent, xContext,
xModel, xPageStyleProps, isHeader ) ),
mxModel(
xModel ), mxPageStyleProps( xPageStyleProps ), mbHeader( isHeader )
101 throw lang::IndexOutOfBoundsException();
112uno::Reference< container::XEnumeration >
116 return new HeadersFootersEnumWrapper(
this );
128 return "SwVbaHeadersFooters";
131uno::Sequence<OUString>
134 static uno::Sequence< OUString >
const sNames
136 "ooo.vba.word.HeadersFooters"
css::uno::Reference< css::frame::XModel2 > mxModel
unotools::WeakReference< AnimationNode > mxParent
css::uno::Reference< css::uno::XComponentContext > mxContext
css::uno::Type const & get()
Reference< XModel > xModel
::cppu::WeakImplHelper< css::container::XEnumeration > EnumerationHelper_BASE