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 .
21 #include <com/sun/star/lang/Locale.hpp>
22 #include <vbahelper/vbahelperinterface.hxx>
24 namespace com::sun::star::beans
{ class XPropertySet
; }
25 namespace com::sun::star::beans
{ class XPropertyState
; }
26 namespace com::sun::star::frame
{ class XModel
; }
27 namespace com::sun::star::util
{ class XNumberFormats
; }
28 namespace com::sun::star::util
{ class XNumberFormatsSupplier
; }
29 namespace com::sun::star::util
{ class XNumberFormatTypes
; }
30 namespace ooo::vba::excel
{ class XFont
; }
31 namespace ooo::vba::excel
{ class XInterior
; }
33 class ScCellRangesBase
;
36 template< typename
... Ifc
>
37 class ScVbaFormat
: public InheritedHelperInterfaceWeakImpl
< Ifc
... >
39 typedef InheritedHelperInterfaceWeakImpl
< Ifc
... > ScVbaFormat_BASE
;
40 css::lang::Locale m_aDefaultLocale
;
42 css::uno::Reference
< css::beans::XPropertySet
> mxPropertySet
;
43 css::uno::Reference
< css::util::XNumberFormatsSupplier
> mxNumberFormatsSupplier
;
44 css::uno::Reference
< css::util::XNumberFormats
> xNumberFormats
;
45 css::uno::Reference
< css::util::XNumberFormatTypes
> xNumberFormatTypes
;
46 css::uno::Reference
< css::frame::XModel
> mxModel
;
47 css::uno::Reference
< css::beans::XPropertyState
> xPropertyState
;
48 bool mbCheckAmbiguoity
;
50 /// @throws css::script::BasicErrorException
51 bool isAmbiguous(const OUString
& _sPropertyName
);
52 /// @throws css::uno::RuntimeException
53 css::uno::Reference
< css::beans::XPropertyState
> const & getXPropertyState();
54 /// @throws css::script::BasicErrorException
55 /// @throws css::uno::RuntimeException
56 void initializeNumberFormats();
57 /// @throws css::uno::RuntimeException
58 SfxItemSet
* getCurrentDataSet( );
60 /// @throws css::uno::RuntimeException
61 virtual ScCellRangesBase
* getCellRangesBase();
63 /// @throws css::script::BasicErrorException
64 ScVbaFormat( const css::uno::Reference
< ov::XHelperInterface
>& xParent
, const css::uno::Reference
< css::uno::XComponentContext
> & xContext
, css::uno::Reference
< css::beans::XPropertySet
> _xPropertySet
, css::uno::Reference
< css::frame::XModel
> xModel
, bool bCheckAmbiguoity
);
65 virtual css::uno::Reference
< ov::XHelperInterface
> thisHelperIface() = 0;
66 /// @throws css::uno::RuntimeException
67 void SAL_CALL
setAddIndent( const css::uno::Any
& BAddIndent
) { BAddIndent
>>= mbAddIndent
; }
68 /// @throws css::uno::RuntimeException
69 css::uno::Any SAL_CALL
getAddIndent() { return css::uno::Any( mbAddIndent
); }
71 /// @throws css::script::BasicErrorException
72 /// @throws css::uno::RuntimeException
73 virtual css::uno::Any SAL_CALL
Borders( const css::uno::Any
& Index
);
74 /// @throws css::script::BasicErrorException
75 /// @throws css::uno::RuntimeException
76 virtual css::uno::Reference
< ::ooo::vba::excel::XFont
> SAL_CALL
Font( );
77 /// @throws css::script::BasicErrorException
78 /// @throws css::uno::RuntimeException
79 virtual css::uno::Reference
< ::ooo::vba::excel::XInterior
> SAL_CALL
Interior( );
80 /// @throws css::script::BasicErrorException
81 /// @throws css::uno::RuntimeException
82 virtual void SAL_CALL
setNumberFormat( const css::uno::Any
& NumberFormat
);
83 /// @throws css::script::BasicErrorException
84 /// @throws css::uno::RuntimeException
85 virtual css::uno::Any SAL_CALL
getNumberFormat( );
86 /// @throws css::script::BasicErrorException
87 /// @throws css::uno::RuntimeException
88 virtual void SAL_CALL
setNumberFormatLocal( const css::uno::Any
& NumberFormatLocal
);
89 /// @throws css::script::BasicErrorException
90 /// @throws css::uno::RuntimeException
91 virtual css::uno::Any SAL_CALL
getNumberFormatLocal( );
92 /// @throws css::script::BasicErrorException
93 /// @throws css::uno::RuntimeException
94 virtual void SAL_CALL
setIndentLevel( const css::uno::Any
& IndentLevel
);
95 /// @throws css::script::BasicErrorException
96 /// @throws css::uno::RuntimeException
97 virtual css::uno::Any SAL_CALL
getIndentLevel( );
98 /// @throws css::script::BasicErrorException
99 /// @throws css::uno::RuntimeException
100 virtual void SAL_CALL
setHorizontalAlignment( const css::uno::Any
& HorizontalAlignment
);
101 /// @throws css::script::BasicErrorException
102 /// @throws css::uno::RuntimeException
103 virtual css::uno::Any SAL_CALL
getHorizontalAlignment( );
104 /// @throws css::script::BasicErrorException
105 /// @throws css::uno::RuntimeException
106 virtual void SAL_CALL
setVerticalAlignment( const css::uno::Any
& VerticalAlignment
);
107 /// @throws css::script::BasicErrorException
108 /// @throws css::uno::RuntimeException
109 virtual css::uno::Any SAL_CALL
getVerticalAlignment( );
110 /// @throws css::script::BasicErrorException
111 /// @throws css::uno::RuntimeException
112 virtual void SAL_CALL
setOrientation( const css::uno::Any
& Orientation
);
113 /// @throws css::script::BasicErrorException
114 /// @throws css::uno::RuntimeException
115 virtual css::uno::Any SAL_CALL
getOrientation( );
116 /// @throws css::script::BasicErrorException
117 /// @throws css::uno::RuntimeException
118 virtual void SAL_CALL
setShrinkToFit( const css::uno::Any
& ShrinkToFit
);
119 /// @throws css::script::BasicErrorException
120 /// @throws css::uno::RuntimeException
121 virtual css::uno::Any SAL_CALL
getShrinkToFit( );
122 /// @throws css::script::BasicErrorException
123 /// @throws css::uno::RuntimeException
124 virtual void SAL_CALL
setWrapText( const css::uno::Any
& WrapText
);
125 /// @throws css::script::BasicErrorException
126 /// @throws css::uno::RuntimeException
127 virtual css::uno::Any SAL_CALL
getWrapText( );
128 /// @throws css::script::BasicErrorException
129 /// @throws css::uno::RuntimeException
130 virtual void SAL_CALL
setLocked( const css::uno::Any
& Locked
);
131 /// @throws css::script::BasicErrorException
132 /// @throws css::uno::RuntimeException
133 virtual css::uno::Any SAL_CALL
getLocked( );
134 /// @throws css::script::BasicErrorException
135 /// @throws css::uno::RuntimeException
136 virtual void SAL_CALL
setFormulaHidden( const css::uno::Any
& FormulaHidden
);
137 /// @throws css::script::BasicErrorException
138 /// @throws css::uno::RuntimeException
139 virtual css::uno::Any SAL_CALL
getFormulaHidden( );
140 /// @throws css::script::BasicErrorException
141 /// @throws css::uno::RuntimeException
142 virtual void SAL_CALL
setMergeCells( const css::uno::Any
& MergeCells
) = 0;
143 /// @throws css::script::BasicErrorException
144 /// @throws css::uno::RuntimeException
145 virtual css::uno::Any SAL_CALL
getMergeCells( ) = 0;
146 /// @throws css::script::BasicErrorException
147 /// @throws css::uno::RuntimeException
148 virtual void SAL_CALL
setReadingOrder( const css::uno::Any
& ReadingOrder
);
149 /// @throws css::script::BasicErrorException
150 /// @throws css::uno::RuntimeException
151 virtual css::uno::Any SAL_CALL
getReadingOrder( );
154 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */