LibreOffice Module sw (master)  1
vbasection.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 #include "vbasection.hxx"
20 #include <vbahelper/vbahelper.hxx>
21 #include "vbapagesetup.hxx"
22 #include "vbaheadersfooters.hxx"
23 
24 using namespace ::ooo::vba;
25 using namespace ::com::sun::star;
26 
27 SwVbaSection::SwVbaSection( const uno::Reference< ooo::vba::XHelperInterface >& rParent, const uno::Reference< uno::XComponentContext >& rContext, const uno::Reference< frame::XModel >& xModel, const uno::Reference< beans::XPropertySet >& xProps ) :
28  SwVbaSection_BASE( rParent, rContext ), mxModel( xModel ), mxPageProps( xProps )
29 {
30 }
31 
33 {
34 }
35 
37 {
38  return false;
39 }
40 
41 void SAL_CALL SwVbaSection::setProtectedForForms( sal_Bool /*_protectedforforms*/ )
42 {
43 }
44 
45 uno::Any SAL_CALL SwVbaSection::Headers( const uno::Any& index )
46 {
47  uno::Reference< XCollection > xCol( new SwVbaHeadersFooters( this, mxContext, mxModel, mxPageProps, true ) );
48  if ( index.hasValue() )
49  return xCol->Item( index, uno::Any() );
50  return uno::makeAny( xCol );
51 }
52 
53 uno::Any SAL_CALL SwVbaSection::Footers( const uno::Any& index )
54 {
55  uno::Reference< XCollection > xCol( new SwVbaHeadersFooters( this, mxContext, mxModel, mxPageProps, false ) );
56  if ( index.hasValue() )
57  return xCol->Item( index, uno::Any() );
58  return uno::makeAny( xCol );
59 }
60 
61 uno::Any SAL_CALL
63 {
64  return uno::makeAny( uno::Reference< word::XPageSetup >( new SwVbaPageSetup( this, mxContext, mxModel, mxPageProps ) ) );
65 }
66 
67 OUString
69 {
70  return "SwVbaSection";
71 }
72 
73 uno::Sequence< OUString >
75 {
76  static uno::Sequence< OUString > const aServiceNames
77  {
78  "ooo.vba.word.Section"
79  };
80  return aServiceNames;
81 }
82 
83 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void SAL_CALL setProtectedForForms(sal_Bool _protectedforforms) override
Definition: vbasection.cxx:41
bool hasValue()
virtual OUString getServiceImplName() override
Definition: vbasection.cxx:68
css::uno::Reference< css::frame::XModel2 > mxModel
Sequence< OUString > aServiceNames
virtual css::uno::Sequence< OUString > getServiceNames() override
Definition: vbasection.cxx:74
virtual ~SwVbaSection() override
Definition: vbasection.cxx:32
virtual css::uno::Any SAL_CALL Footers(const css::uno::Any &index) override
Definition: vbasection.cxx:53
css::uno::Reference< css::beans::XPropertySet > mxPageProps
Definition: vbasection.hxx:31
virtual css::uno::Any SAL_CALL Headers(const css::uno::Any &index) override
Definition: vbasection.cxx:45
virtual sal_Bool SAL_CALL getProtectedForForms() override
Definition: vbasection.cxx:36
unsigned char sal_Bool
css::uno::Reference< css::frame::XModel > mxModel
Definition: vbasection.hxx:30
css::uno::Reference< css::uno::XComponentContext > mxContext
SwVbaSection(const css::uno::Reference< ooo::vba::XHelperInterface > &rParent, const css::uno::Reference< css::uno::XComponentContext > &rContext, const css::uno::Reference< css::frame::XModel > &xModel, const css::uno::Reference< css::beans::XPropertySet > &xProps)
Definition: vbasection.cxx:27
virtual css::uno::Any SAL_CALL PageSetup() override
Definition: vbasection.cxx:62