1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef VBAHELPER_FONTBASE_HXX
24 #define VBAHELPER_FONTBASE_HXX
25 
26 #include <cppuhelper/implbase1.hxx>
27 
28 #include <ooo/vba/XFontBase.hpp>
29 #include <com/sun/star/beans/XPropertySet.hpp>
30 #include <vbahelper/vbahelperinterface.hxx>
31 
32 // use local constants there is no need to expose these constants
33 // externally. Looking at the Format->Character dialog it seem that
34 // these may infact be even be calculated. Leave hardcoded for now
35 // #FIXEME #TBD investigate the code for dialog mentioned above
36 
37 // The font baseline is not specified.
38 const short NORMAL = 0;
39 
40 // specifies a superscripted.
41 const short SUPERSCRIPT = 33;
42 
43 // specifies a subscripted.
44 const short SUBSCRIPT = -33;
45 
46 // specifies a hight of superscripted font
47  const sal_Int8 SUPERSCRIPTHEIGHT = 58;
48 
49 // specifies a hight of subscripted font
50 const sal_Int8 SUBSCRIPTHEIGHT = 58;
51 
52 // specifies a hight of normal font
53 const short NORMALHEIGHT = 100;
54 
55 typedef  InheritedHelperInterfaceImpl1< ov::XFontBase > VbaFontBase_BASE;
56 
57 class VBAHELPER_DLLPUBLIC VbaFontBase : public VbaFontBase_BASE
58 {
59 protected:
60     css::uno::Reference< css::beans::XPropertySet > mxFont;
61     css::uno::Reference< css::container::XIndexAccess > mxPalette;
62     bool mbFormControl;
63 
64 public:
65 	VbaFontBase(
66         const css::uno::Reference< ov::XHelperInterface >& xParent,
67         const css::uno::Reference< css::uno::XComponentContext >& xContext,
68         const css::uno::Reference< css::container::XIndexAccess >& xPalette,
69         const css::uno::Reference< css::beans::XPropertySet >& xPropertySet,
70         bool bFormControl = false ) throw ( css::uno::RuntimeException );
71 	virtual ~VbaFontBase();// {}
72 
73 	// Attributes
74     virtual css::uno::Any SAL_CALL getSize() throw (css::uno::RuntimeException);
75     virtual void SAL_CALL setSize( const css::uno::Any& _size ) throw (css::uno::RuntimeException);
76     virtual css::uno::Any SAL_CALL getColorIndex() throw (css::uno::RuntimeException);
77     virtual void SAL_CALL setColorIndex( const css::uno::Any& _colorindex ) throw (css::uno::RuntimeException);
78     virtual css::uno::Any SAL_CALL getBold() throw (css::uno::RuntimeException);
79     virtual void SAL_CALL setBold( const css::uno::Any& _bold ) throw (css::uno::RuntimeException);
80     virtual css::uno::Any SAL_CALL getUnderline() throw (css::uno::RuntimeException) = 0;
81     virtual void SAL_CALL setUnderline( const css::uno::Any& _underline ) throw (css::uno::RuntimeException) = 0;
82     virtual css::uno::Any SAL_CALL getStrikethrough() throw (css::uno::RuntimeException);
83     virtual void SAL_CALL setStrikethrough( const css::uno::Any& _strikethrough ) throw (css::uno::RuntimeException);
84     virtual css::uno::Any SAL_CALL getShadow() throw (css::uno::RuntimeException);
85     virtual void SAL_CALL setShadow( const css::uno::Any& _shadow ) throw (css::uno::RuntimeException);
86     virtual css::uno::Any SAL_CALL getItalic() throw (css::uno::RuntimeException);
87     virtual void SAL_CALL setItalic( const css::uno::Any& _italic ) throw (css::uno::RuntimeException);
88     virtual css::uno::Any SAL_CALL getSubscript() throw (css::uno::RuntimeException);
89     virtual void SAL_CALL setSubscript( const css::uno::Any& _subscript ) throw (css::uno::RuntimeException);
90     virtual css::uno::Any SAL_CALL getSuperscript() throw (css::uno::RuntimeException);
91     virtual void SAL_CALL setSuperscript( const css::uno::Any& _superscript ) throw (css::uno::RuntimeException);
92     virtual css::uno::Any SAL_CALL getName() throw (css::uno::RuntimeException);
93     virtual void SAL_CALL setName( const css::uno::Any& _name ) throw (css::uno::RuntimeException);
94     virtual css::uno::Any SAL_CALL getColor() throw (css::uno::RuntimeException) ;
95     virtual void SAL_CALL setColor( const css::uno::Any& _color ) throw (css::uno::RuntimeException) ;
96 };
97 
98 #endif
99 
100