bump product version to 4.1.6.2
[LibreOffice.git] / include / svx / fntctrl.hxx
blob93edc0d04b13dbcb6974ffa4622abe617e1c5595
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 .
19 #ifndef _SVX_FNTCTRL_HXX
20 #define _SVX_FNTCTRL_HXX
22 #include <vcl/window.hxx>
23 #include <editeng/svxfont.hxx>
24 #include "svx/svxdllapi.h"
25 #include <svl/itempool.hxx>
26 #include <svl/itemset.hxx>
28 #include <rtl/ustring.hxx>
30 // forward ---------------------------------------------------------------
32 class SfxItemSet;
33 class FontPrevWin_Impl;
35 // class SvxFontPrevWindow -----------------------------------------------
37 class SVX_DLLPUBLIC SvxFontPrevWindow : public Window
39 using OutputDevice::SetFont;
40 private:
41 FontPrevWin_Impl* pImpl;
43 SVX_DLLPRIVATE void InitSettings( sal_Bool bForeground, sal_Bool bBackground );
44 SVX_DLLPRIVATE void Init ();
45 SVX_DLLPRIVATE void SetFontSize(const SfxItemSet& rSet, sal_uInt16 nSlot, SvxFont& rFont);
46 SVX_DLLPRIVATE void SetFontLang(const SfxItemSet& rSet, sal_uInt16 nSlot, SvxFont& rFont);
48 Size m_aInitialSize;
50 public:
51 SvxFontPrevWindow( Window* pParent, const ResId& rId );
52 SvxFontPrevWindow(Window* pParent, WinBits nStyle);
53 virtual ~SvxFontPrevWindow();
55 virtual void StateChanged( StateChangedType nStateChange );
56 virtual void DataChanged( const DataChangedEvent& rDCEvt );
58 void Init( const SfxItemSet& rSet );
60 // for reasons of efficiency not const
61 SvxFont& GetFont();
62 const SvxFont& GetFont() const;
63 void SetFont( const SvxFont& rNormalFont, const SvxFont& rCJKFont, const SvxFont& rCTLFont );
64 SvxFont& GetCJKFont();
65 SvxFont& GetCTLFont();
66 void SetColor( const Color& rColor );
67 void ResetColor();
68 void SetBackColor( const Color& rColor );
69 void UseResourceText( bool bUse = true );
70 void Paint( const Rectangle& );
72 bool IsTwoLines() const;
73 void SetTwoLines(bool bSet);
75 void SetBrackets(sal_Unicode cStart, sal_Unicode cEnd);
77 void SetFontWidthScale( sal_uInt16 nScaleInPercent );
79 void AutoCorrectFontColor( void );
81 void SetPreviewText( const OUString& rString );
82 void SetFontNameAsPreviewText();
84 void SetFont( const SfxItemSet& rSet, sal_uInt16 nSlot, SvxFont& rFont );
85 void SetFontStyle( const SfxItemSet& rSet, sal_uInt16 nSlotPosture, sal_uInt16 nSlotWeight, SvxFont& rFont ); // posture/weight
86 void SetFontWidthScale( const SfxItemSet& rSet );
87 void SetFontEscapement( sal_uInt8 nProp, sal_uInt8 nEscProp, short nEsc );
89 void SetFromItemSet( const SfxItemSet &rSet,
90 bool bPreviewBackgroundToCharacter = false );
92 virtual Size GetOptimalSize() const;
95 #endif // #ifndef _SVX_FNTCTRL_HXX
97 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */