LibreOffice Module forms (master) 1
formcontrolfont.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#pragma once
21
22#include <com/sun/star/awt/FontDescriptor.hpp>
23#include <com/sun/star/beans/Property.hpp>
24#include <tools/color.hxx>
25
26namespace cppu {
27 class OPropertySetHelper;
28}
29
30
31namespace frm
32{
33
35 {
36 private:
37 // <properties>
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;
43 // </properties>
44
46
47 protected:
48 const css::awt::FontDescriptor& getFont() const { return m_aFont; }
49 void setFont( const css::awt::FontDescriptor& _rFont ) { m_aFont = _rFont; }
50
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;
55
56 void setTextLineColor( Color _nColor ) { m_aTextLineColor <<= _nColor; }
58 bool hasTextLineColor( ) const { return m_aTextLineColor.hasValue(); }
59 Color getTextLineColor( ) const;
60
61 protected:
62 FontControlModel( bool _bToolkitCompatibleDefaults );
63 FontControlModel( const FontControlModel* _pOriginal );
64
65 protected:
66 static bool isFontRelatedProperty( sal_Int32 _nPropertyHandle );
67 static bool isFontAggregateProperty( sal_Int32 _nPropertyHandle );
68
71 css::uno::Sequence< css::beans::Property >& /* [out] */ _rProps );
72
73 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 );
80 void (::cppu::OPropertySetHelper::*pSet)( sal_Int32, css::uno::Any const&),
81 sal_Int32 nHandle, const css::uno::Any& rValue);
82 css::uno::Any
83 getPropertyDefaultByHandle ( sal_Int32 _nHandle ) const;
84
85 private:
86
87 private:
90 };
91
92
93} // namespace frm
94
95
96/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
static bool isFontAggregateProperty(sal_Int32 _nPropertyHandle)
const css::awt::FontDescriptor & getFont() const
FontControlModel(bool _bToolkitCompatibleDefaults)
FontControlModel(const FontControlModel &)=delete
void setTextColor(Color _nColor)
static void describeFontRelatedProperties(css::uno::Sequence< css::beans::Property > &_rProps)
appends (!) the description of all font related properties to the given sequence
bool convertFastPropertyValue(css::uno::Any &_rConvertedValue, css::uno::Any &_rOldValue, sal_Int32 _nHandle, const css::uno::Any &_rValue)
static bool isFontRelatedProperty(sal_Int32 _nPropertyHandle)
bool hasTextLineColor() const
Color getTextLineColor() const
FontControlModel & operator=(const FontControlModel &)=delete
void setFastPropertyValue_NoBroadcast_impl(::cppu::OPropertySetHelper &rBase, void(::cppu::OPropertySetHelper::*pSet)(sal_Int32, css::uno::Any const &), sal_Int32 nHandle, const css::uno::Any &rValue)
void getFastPropertyValue(css::uno::Any &_rValue, sal_Int32 _nHandle) const
css::uno::Any getPropertyDefaultByHandle(sal_Int32 _nHandle) const
css::uno::Any m_aTextColor
css::uno::Any m_aTextLineColor
css::awt::FontDescriptor m_aFont
void setTextLineColor(Color _nColor)
void setFont(const css::awt::FontDescriptor &_rFont)
ListBox is a bit confusing / different from other form components, so here are a few notes:
Definition: BaseListBox.hxx:25