1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef INCLUDED_SW_SOURCE_UI_VBA_VBAPARAGRAPHFORMAT_HXX
20 #define INCLUDED_SW_SOURCE_UI_VBA_VBAPARAGRAPHFORMAT_HXX
22 #include <ooo/vba/word/XParagraphFormat.hpp>
23 #include <vbahelper/vbahelperinterface.hxx>
24 #include <com/sun/star/style/LineSpacing.hpp>
25 #include <com/sun/star/style/ParagraphAdjust.hpp>
27 typedef InheritedHelperInterfaceWeakImpl
< ooo::vba::word::XParagraphFormat
> SwVbaParagraphFormat_BASE
;
29 class SwVbaParagraphFormat
: public SwVbaParagraphFormat_BASE
32 css::uno::Reference
< css::beans::XPropertySet
> mxParaProps
;
35 static css::style::LineSpacing
getOOoLineSpacing( float _lineSpace
, sal_Int16 mode
);
36 css::style::LineSpacing
getOOoLineSpacingFromRule( sal_Int32 _linespacingrule
);
37 static float getMSWordLineSpacing( css::style::LineSpacing
const & rLineSpacing
);
38 static sal_Int32
getMSWordLineSpacingRule( css::style::LineSpacing
const & rLineSpacing
);
39 /// @throws css::uno::RuntimeException
40 sal_Int16
getCharHeight();
41 static css::style::ParagraphAdjust
getOOoAlignment( sal_Int32 _alignment
);
42 static sal_Int32
getMSWordAlignment( css::style::ParagraphAdjust _alignment
);
45 SwVbaParagraphFormat( const css::uno::Reference
< ooo::vba::XHelperInterface
>& rParent
, const css::uno::Reference
< css::uno::XComponentContext
>& rContext
, css::uno::Reference
< css::beans::XPropertySet
> xParaProps
);
46 virtual ~SwVbaParagraphFormat() override
;
49 virtual ::sal_Int32 SAL_CALL
getAlignment() override
;
50 virtual void SAL_CALL
setAlignment( ::sal_Int32 _alignment
) override
;
51 virtual float SAL_CALL
getFirstLineIndent() override
;
52 virtual void SAL_CALL
setFirstLineIndent( float _firstlineindent
) override
;
53 virtual css::uno::Any SAL_CALL
getKeepTogether() override
;
54 virtual void SAL_CALL
setKeepTogether( const css::uno::Any
& _keeptogether
) override
;
55 virtual css::uno::Any SAL_CALL
getKeepWithNext() override
;
56 virtual void SAL_CALL
setKeepWithNext( const css::uno::Any
& _keepwithnext
) override
;
57 virtual css::uno::Any SAL_CALL
getHyphenation() override
;
58 virtual void SAL_CALL
setHyphenation( const css::uno::Any
& _hyphenation
) override
;
59 virtual float SAL_CALL
getLineSpacing() override
;
60 virtual void SAL_CALL
setLineSpacing( float _linespacing
) override
;
61 virtual ::sal_Int32 SAL_CALL
getLineSpacingRule() override
;
62 virtual void SAL_CALL
setLineSpacingRule( ::sal_Int32 _linespacingrule
) override
;
63 virtual css::uno::Any SAL_CALL
getNoLineNumber() override
;
64 virtual void SAL_CALL
setNoLineNumber( const css::uno::Any
& _nolinenumber
) override
;
65 virtual ::sal_Int32 SAL_CALL
getOutlineLevel() override
;
66 virtual void SAL_CALL
setOutlineLevel( ::sal_Int32 _outlinelevel
) override
;
67 virtual css::uno::Any SAL_CALL
getPageBreakBefore() override
;
68 virtual void SAL_CALL
setPageBreakBefore( const css::uno::Any
& _pagebreakbefore
) override
;
69 virtual float SAL_CALL
getSpaceBefore() override
;
70 virtual void SAL_CALL
setSpaceBefore( float _spacebefore
) override
;
71 virtual float SAL_CALL
getSpaceAfter() override
;
72 virtual void SAL_CALL
setSpaceAfter( float _spaceafter
) override
;
73 virtual float SAL_CALL
getLeftIndent() override
;
74 virtual void SAL_CALL
setLeftIndent( float _leftindent
) override
;
75 virtual float SAL_CALL
getRightIndent() override
;
76 virtual void SAL_CALL
setRightIndent( float _rightindent
) override
;
77 virtual css::uno::Any SAL_CALL
getTabStops() override
;
78 virtual void SAL_CALL
setTabStops( const css::uno::Any
& _tabstops
) override
;
79 virtual css::uno::Any SAL_CALL
getWidowControl() override
;
80 virtual void SAL_CALL
setWidowControl( const css::uno::Any
& _widowcontrol
) override
;
83 virtual OUString
getServiceImplName() override
;
84 virtual css::uno::Sequence
<OUString
> getServiceNames() override
;
86 #endif // INCLUDED_SW_SOURCE_UI_VBA_VBAPARAGRAPHFORMAT_HXX
88 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */