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 .
20 #ifndef INCLUDED_FORMS_SOURCE_INC_FORMCONTROLFONT_HXX
21 #define INCLUDED_FORMS_SOURCE_INC_FORMCONTROLFONT_HXX
23 #include <com/sun/star/awt/FontDescriptor.hpp>
24 #include <com/sun/star/beans/Property.hpp>
25 #include <tools/color.hxx>
28 class OPropertySetHelper
;
35 class FontControlModel
39 css::awt::FontDescriptor m_aFont
;
40 sal_Int16 m_nFontRelief
;
41 sal_Int16 m_nFontEmphasis
;
42 css::uno::Any m_aTextLineColor
;
43 css::uno::Any m_aTextColor
;
46 bool m_bToolkitCompatibleDefaults
;
49 const css::awt::FontDescriptor
& getFont() const { return m_aFont
; }
50 void setFont( const css::awt::FontDescriptor
& _rFont
) { m_aFont
= _rFont
; }
52 void setTextColor( Color _nColor
) { m_aTextColor
<<= _nColor
; }
53 void clearTextColor( ) { m_aTextColor
.clear(); }
54 bool hasTextColor( ) const { return m_aTextColor
.hasValue(); }
55 Color
getTextColor( ) const;
57 void setTextLineColor( Color _nColor
) { m_aTextLineColor
<<= _nColor
; }
58 void clearTextLineColor( ) { m_aTextLineColor
.clear(); }
59 bool hasTextLineColor( ) const { return m_aTextLineColor
.hasValue(); }
60 Color
getTextLineColor( ) const;
63 FontControlModel( bool _bToolkitCompatibleDefaults
);
64 FontControlModel( const FontControlModel
* _pOriginal
);
67 static bool isFontRelatedProperty( sal_Int32 _nPropertyHandle
);
68 static bool isFontAggregateProperty( sal_Int32 _nPropertyHandle
);
70 /// appends (!) the description of all font related properties to the given sequence
71 static void describeFontRelatedProperties(
72 css::uno::Sequence
< css::beans::Property
>& /* [out] */ _rProps
);
74 void getFastPropertyValue ( css::uno::Any
& _rValue
, sal_Int32 _nHandle
) const;
75 /// @throws css::lang::IllegalArgumentException
76 /// @throws css::uno::RuntimeException
77 bool convertFastPropertyValue ( css::uno::Any
& _rConvertedValue
, css::uno::Any
& _rOldValue
, sal_Int32 _nHandle
, const css::uno::Any
& _rValue
);
78 /// @throws css::uno::Exception
79 void setFastPropertyValue_NoBroadcast_impl(
80 ::cppu::OPropertySetHelper
& rBase
,
81 void (::cppu::OPropertySetHelper::*pSet
)( sal_Int32
, css::uno::Any
const&),
82 sal_Int32 nHandle
, const css::uno::Any
& rValue
);
84 getPropertyDefaultByHandle ( sal_Int32 _nHandle
) const;
89 FontControlModel( const FontControlModel
& ) = delete;
90 FontControlModel
& operator=( const FontControlModel
& ) = delete;
97 #endif // INCLUDED_FORMS_SOURCE_INC_FORMCONTROLFONT_HXX
99 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */