1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 #ifndef _SVX_FNTCTRL_HXX 24 #define _SVX_FNTCTRL_HXX 25 26 // include --------------------------------------------------------------- 27 28 #include <vcl/window.hxx> 29 #include <editeng/svxfont.hxx> 30 #include "svx/svxdllapi.h" 31 32 #ifndef _RTL_USTRING_HXX_ 33 #include <rtl/ustring.hxx> 34 #endif 35 36 // forward --------------------------------------------------------------- 37 38 class FontPrevWin_Impl; 39 40 // class SvxFontPrevWindow ----------------------------------------------- 41 42 class SVX_DLLPUBLIC SvxFontPrevWindow : public Window 43 { 44 using OutputDevice::SetFont; 45 private: 46 FontPrevWin_Impl* pImpl; 47 48 SVX_DLLPRIVATE void InitSettings( sal_Bool bForeground, sal_Bool bBackground ); 49 50 public: 51 SvxFontPrevWindow( Window* pParent, const ResId& rId ); 52 virtual ~SvxFontPrevWindow(); 53 54 virtual void StateChanged( StateChangedType nStateChange ); 55 virtual void DataChanged( const DataChangedEvent& rDCEvt ); 56 57 // Aus Effizienz-gr"unden nicht const 58 SvxFont& GetFont(); 59 const SvxFont& GetFont() const; 60 void SetFont( const SvxFont& rFont ); 61 void SetFont( const SvxFont& rNormalFont, const SvxFont& rCJKFont, const SvxFont& rCTLFont ); 62 void SetCJKFont( const SvxFont& rFont ); 63 void SetCTLFont( const SvxFont& rFont ); 64 SvxFont& GetCJKFont(); 65 SvxFont& GetCTLFont(); 66 void SetColor( const Color& rColor ); 67 void ResetColor(); 68 void SetBackColor( const Color& rColor ); 69 void UseResourceText( sal_Bool bUse = sal_True ); 70 void Paint( const Rectangle& ); 71 72 sal_Bool IsTwoLines() const; 73 void SetTwoLines(sal_Bool bSet); 74 75 void SetBrackets(sal_Unicode cStart, sal_Unicode cEnd); 76 77 void SetFontWidthScale( sal_uInt16 nScaleInPercent ); 78 79 void AutoCorrectFontColor( void ); 80 81 void SetPreviewText( const ::rtl::OUString& rString ); 82 void SetFontNameAsPreviewText(); 83 }; 84 85 #endif // #ifndef _SVX_FNTCTRL_HXX 86 87