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 .
22 #include <com/sun/star/awt/FontDescriptor.hpp>
23 #include <com/sun/star/beans/Property.hpp>
24 #include <tools/color.hxx>
27 class OPropertySetHelper
;
34 class FontControlModel
38 css::awt::FontDescriptor m_aFont
;
39 sal_Int16 m_nFontRelief
;
40 sal_Int16 m_nFontEmphasis
;
41 css::uno::Any m_aTextLineColor
;
42 css::uno::Any m_aTextColor
;
45 bool m_bToolkitCompatibleDefaults
;
48 const css::awt::FontDescriptor
& getFont() const { return m_aFont
; }
49 void setFont( const css::awt::FontDescriptor
& _rFont
) { m_aFont
= _rFont
; }
51 void setTextColor( Color _nColor
) { m_aTextColor
<<= _nColor
; }
52 void clearTextColor( ) { m_aTextColor
.clear(); }
53 bool hasTextColor( ) const { return m_aTextColor
.hasValue(); }
54 Color
getTextColor( ) const;
56 void setTextLineColor( Color _nColor
) { m_aTextLineColor
<<= _nColor
; }
57 void clearTextLineColor( ) { m_aTextLineColor
.clear(); }
58 bool hasTextLineColor( ) const { return m_aTextLineColor
.hasValue(); }
59 Color
getTextLineColor( ) const;
62 FontControlModel( bool _bToolkitCompatibleDefaults
);
63 FontControlModel( const FontControlModel
* _pOriginal
);
66 static bool isFontRelatedProperty( sal_Int32 _nPropertyHandle
);
67 static bool isFontAggregateProperty( sal_Int32 _nPropertyHandle
);
69 /// appends (!) the description of all font related properties to the given sequence
70 static void describeFontRelatedProperties(
71 css::uno::Sequence
< css::beans::Property
>& /* [out] */ _rProps
);
73 void getFastPropertyValue ( css::uno::Any
& _rValue
, sal_Int32 _nHandle
) const;
74 /// @throws css::lang::IllegalArgumentException
75 /// @throws css::uno::RuntimeException
76 bool convertFastPropertyValue ( css::uno::Any
& _rConvertedValue
, css::uno::Any
& _rOldValue
, sal_Int32 _nHandle
, const css::uno::Any
& _rValue
);
77 /// @throws css::uno::Exception
78 void setFastPropertyValue_NoBroadcast_impl(
79 ::cppu::OPropertySetHelper
& rBase
,
80 void (::cppu::OPropertySetHelper::*pSet
)( sal_Int32
, css::uno::Any
const&),
81 sal_Int32 nHandle
, const css::uno::Any
& rValue
);
83 getPropertyDefaultByHandle ( sal_Int32 _nHandle
) const;
88 FontControlModel( const FontControlModel
& ) = delete;
89 FontControlModel
& operator=( const FontControlModel
& ) = delete;
96 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */