xref: /trunk/main/vbahelper/inc/vbahelper/vbafontbase.hxx (revision e28b2547d91b4e57bd94049b1a6847acfd30723f)
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 #ifndef VBAHELPER_FONTBASE_HXX
23 #define VBAHELPER_FONTBASE_HXX
24 
25 #include <cppuhelper/implbase1.hxx>
26 
27 #include <ooo/vba/XFontBase.hpp>
28 #include <com/sun/star/beans/XPropertySet.hpp>
29 #include <vbahelper/vbahelperinterface.hxx>
30 
31 // use local constants there is no need to expose these constants
32 // externally. Looking at the Format->Character dialog it seem that
33 // these may in fact be even be calculated. Leave hardcoded for now
34 // #FIXEME #TBD investigate the code for dialog mentioned above
35 
36 // The font baseline is not specified.
37 const short NORMAL = 0;
38 
39 // specifies a superscripted.
40 const short SUPERSCRIPT = 33;
41 
42 // specifies a subscripted.
43 const short SUBSCRIPT = -33;
44 
45 // specifies a height of superscripted font
46  const sal_Int8 SUPERSCRIPTHEIGHT = 58;
47 
48 // specifies a height of subscripted font
49 const sal_Int8 SUBSCRIPTHEIGHT = 58;
50 
51 // specifies a height of normal font
52 const short NORMALHEIGHT = 100;
53 
54 typedef InheritedHelperInterfaceImpl1< ov::XFontBase > VbaFontBase_BASE;
55 
56 class VBAHELPER_DLLPUBLIC VbaFontBase : public VbaFontBase_BASE
57 {
58 protected:
59     css::uno::Reference< css::beans::XPropertySet > mxFont;
60     css::uno::Reference< css::container::XIndexAccess > mxPalette;
61     bool mbFormControl;
62 
63 public:
64     VbaFontBase(
65         const css::uno::Reference< ov::XHelperInterface >& xParent,
66         const css::uno::Reference< css::uno::XComponentContext >& xContext,
67         const css::uno::Reference< css::container::XIndexAccess >& xPalette,
68         const css::uno::Reference< css::beans::XPropertySet >& xPropertySet,
69         bool bFormControl = false ) throw ( css::uno::RuntimeException );
70     virtual ~VbaFontBase();// {}
71 
72     // Attributes
73     virtual css::uno::Any SAL_CALL getSize() throw (css::uno::RuntimeException);
74     virtual void SAL_CALL setSize( const css::uno::Any& _size ) throw (css::uno::RuntimeException);
75     virtual css::uno::Any SAL_CALL getColorIndex() throw (css::uno::RuntimeException);
76     virtual void SAL_CALL setColorIndex( const css::uno::Any& _colorindex ) throw (css::uno::RuntimeException);
77     virtual css::uno::Any SAL_CALL getBold() throw (css::uno::RuntimeException);
78     virtual void SAL_CALL setBold( const css::uno::Any& _bold ) throw (css::uno::RuntimeException);
79     virtual css::uno::Any SAL_CALL getUnderline() throw (css::uno::RuntimeException) = 0;
80     virtual void SAL_CALL setUnderline( const css::uno::Any& _underline ) throw (css::uno::RuntimeException) = 0;
81     virtual css::uno::Any SAL_CALL getStrikethrough() throw (css::uno::RuntimeException);
82     virtual void SAL_CALL setStrikethrough( const css::uno::Any& _strikethrough ) throw (css::uno::RuntimeException);
83     virtual css::uno::Any SAL_CALL getShadow() throw (css::uno::RuntimeException);
84     virtual void SAL_CALL setShadow( const css::uno::Any& _shadow ) throw (css::uno::RuntimeException);
85     virtual css::uno::Any SAL_CALL getItalic() throw (css::uno::RuntimeException);
86     virtual void SAL_CALL setItalic( const css::uno::Any& _italic ) throw (css::uno::RuntimeException);
87     virtual css::uno::Any SAL_CALL getSubscript() throw (css::uno::RuntimeException);
88     virtual void SAL_CALL setSubscript( const css::uno::Any& _subscript ) throw (css::uno::RuntimeException);
89     virtual css::uno::Any SAL_CALL getSuperscript() throw (css::uno::RuntimeException);
90     virtual void SAL_CALL setSuperscript( const css::uno::Any& _superscript ) throw (css::uno::RuntimeException);
91     virtual css::uno::Any SAL_CALL getName() throw (css::uno::RuntimeException);
92     virtual void SAL_CALL setName( const css::uno::Any& _name ) throw (css::uno::RuntimeException);
93     virtual css::uno::Any SAL_CALL getColor() throw (css::uno::RuntimeException) ;
94     virtual void SAL_CALL setColor( const css::uno::Any& _color ) throw (css::uno::RuntimeException) ;
95 };
96 
97 #endif
98 
99 /* vim: set noet sw=4 ts=4: */
100