Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / forms / source / inc / formcontrolfont.hxx
blob6999c7ef5bc22fe1639f8919de9f39c9d14d2ebf
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
20 #ifndef INCLUDED_FORMS_SOURCE_INC_FORMCONTROLFONT_HXX
21 #define INCLUDED_FORMS_SOURCE_INC_FORMCONTROLFONT_HXX
23 #include <com/sun/star/io/XObjectOutputStream.hpp>
24 #include <com/sun/star/awt/FontDescriptor.hpp>
25 #include <com/sun/star/beans/Property.hpp>
26 #include <com/sun/star/lang/IllegalArgumentException.hpp>
28 namespace cppu {
29 class OPropertySetHelper;
33 namespace frm
36 class FontControlModel
38 private:
39 // <properties>
40 css::awt::FontDescriptor m_aFont;
41 sal_Int16 m_nFontRelief;
42 sal_Int16 m_nFontEmphasis;
43 css::uno::Any m_aTextLineColor;
44 css::uno::Any m_aTextColor;
45 // </properties>
47 bool m_bToolkitCompatibleDefaults;
49 protected:
50 const css::awt::FontDescriptor& getFont() const { return m_aFont; }
51 void setFont( const css::awt::FontDescriptor& _rFont ) { m_aFont = _rFont; }
53 void setTextColor( sal_Int32 _nColor ) { m_aTextColor <<= _nColor; }
54 void clearTextColor( ) { m_aTextColor.clear(); }
55 bool hasTextColor( ) const { return m_aTextColor.hasValue(); }
56 sal_Int32 getTextColor( ) const;
58 void setTextLineColor( sal_Int32 _nColor ) { m_aTextLineColor <<= _nColor; }
59 void clearTextLineColor( ) { m_aTextLineColor.clear(); }
60 bool hasTextLineColor( ) const { return m_aTextLineColor.hasValue(); }
61 sal_Int32 getTextLineColor( ) const;
63 protected:
64 FontControlModel( bool _bToolkitCompatibleDefaults );
65 FontControlModel( const FontControlModel* _pOriginal );
67 protected:
68 static bool isFontRelatedProperty( sal_Int32 _nPropertyHandle );
69 static bool isFontAggregateProperty( sal_Int32 _nPropertyHandle );
71 /// appends (!) the description of all font related properties to the given sequence
72 static void describeFontRelatedProperties(
73 css::uno::Sequence< css::beans::Property >& /* [out] */ _rProps );
75 void getFastPropertyValue ( css::uno::Any& _rValue, sal_Int32 _nHandle ) const;
76 bool convertFastPropertyValue ( css::uno::Any& _rConvertedValue, css::uno::Any& _rOldValue, sal_Int32 _nHandle, const css::uno::Any& _rValue ) throw( css::lang::IllegalArgumentException );
77 void setFastPropertyValue_NoBroadcast_impl(
78 ::cppu::OPropertySetHelper & rBase,
79 void (::cppu::OPropertySetHelper::*pSet)( sal_Int32, css::uno::Any const&),
80 sal_Int32 nHandle, const css::uno::Any& rValue)
81 throw ( css::uno::Exception );
82 css::uno::Any
83 getPropertyDefaultByHandle ( sal_Int32 _nHandle ) const;
85 private:
87 private:
88 FontControlModel( const FontControlModel& ) = delete;
89 FontControlModel& operator=( const FontControlModel& ) = delete;
93 } // namespace frm
96 #endif // INCLUDED_FORMS_SOURCE_INC_FORMCONTROLFONT_HXX
98 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */