masterfix DEV300: #i10000# build fix
[LibreOffice.git] / forms / source / inc / formcontrolfont.hxx
blobd14203046b7dd7c90c0b4986762045d2478afd29
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 #ifndef FORMS_SOURCE_COMPONENT_FORMCONTROLFONT_HXX
29 #define FORMS_SOURCE_COMPONENT_FORMCONTROLFONT_HXX
31 #include <com/sun/star/io/XObjectOutputStream.hpp>
32 #include <com/sun/star/awt/FontDescriptor.hpp>
33 #include <com/sun/star/beans/Property.hpp>
34 #include <com/sun/star/lang/IllegalArgumentException.hpp>
36 //.........................................................................
37 namespace frm
39 //.........................................................................
41 //=====================================================================
42 //= FontControlModel
43 //=====================================================================
44 class FontControlModel
46 private:
47 // <properties>
48 ::com::sun::star::awt::FontDescriptor m_aFont;
49 sal_Int16 m_nFontRelief;
50 sal_Int16 m_nFontEmphasis;
51 ::com::sun::star::uno::Any m_aTextLineColor;
52 ::com::sun::star::uno::Any m_aTextColor;
53 // </properties>
55 bool m_bToolkitCompatibleDefaults;
57 protected:
58 const ::com::sun::star::awt::FontDescriptor& getFont() const { return m_aFont; }
59 void setFont( const ::com::sun::star::awt::FontDescriptor& _rFont ) { m_aFont = _rFont; }
61 void setTextColor( sal_Int32 _nColor ) { m_aTextColor <<= _nColor; }
62 void clearTextColor( ) { m_aTextColor.clear(); }
63 bool hasTextColor( ) const { return m_aTextColor.hasValue(); }
64 sal_Int32 getTextColor( ) const;
66 void setTextLineColor( sal_Int32 _nColor ) { m_aTextLineColor <<= _nColor; }
67 void clearTextLineColor( ) { m_aTextLineColor.clear(); }
68 bool hasTextLineColor( ) const { return m_aTextLineColor.hasValue(); }
69 sal_Int32 getTextLineColor( ) const;
71 protected:
72 FontControlModel( bool _bToolkitCompatibleDefaults );
73 FontControlModel( const FontControlModel* _pOriginal );
75 protected:
76 bool isFontRelatedProperty( sal_Int32 _nPropertyHandle ) const;
77 bool isFontAggregateProperty( sal_Int32 _nPropertyHandle ) const;
79 /// appends (!) the description of all font related properties to the given sequence
80 void describeFontRelatedProperties(
81 ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rProps ) const;
83 void getFastPropertyValue ( ::com::sun::star::uno::Any& _rValue, sal_Int32 _nHandle ) const;
84 sal_Bool convertFastPropertyValue ( ::com::sun::star::uno::Any& _rConvertedValue, ::com::sun::star::uno::Any& _rOldValue, sal_Int32 _nHandle, const ::com::sun::star::uno::Any& _rValue ) throw( ::com::sun::star::lang::IllegalArgumentException );
85 void setFastPropertyValue_NoBroadcast( sal_Int32 _nHandle, const ::com::sun::star::uno::Any& _rValue ) throw ( ::com::sun::star::uno::Exception );
86 ::com::sun::star::uno::Any
87 getPropertyDefaultByHandle ( sal_Int32 _nHandle ) const;
89 private:
91 private:
92 FontControlModel(); // never implemented
93 FontControlModel( const FontControlModel& ); // never implemented
94 FontControlModel& operator=( const FontControlModel& ); // never implemented
97 //.........................................................................
98 } // namespace frm
99 //.........................................................................
101 #endif // FORMS_SOURCE_COMPONENT_FORMCONTROLFONT_HXX