1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 28 #ifndef OOX_DRAWINGNML_TEXTFONT_HXX 29 #define OOX_DRAWINGNML_TEXTFONT_HXX 30 31 #include <rtl/ustring.hxx> 32 33 namespace oox { class AttributeList; } 34 namespace oox { namespace core { class XmlFilterBase; } } 35 36 namespace oox { 37 namespace drawingml { 38 39 // ============================================================================ 40 41 /** carries a CT_TextFont*/ 42 class TextFont 43 { 44 public: 45 explicit TextFont(); 46 47 /** Sets attributes from the passed attribute list. */ 48 void setAttributes( const AttributeList& rAttribs ); 49 50 /** Overwrites this text font with the passed text font, if it is used. */ 51 void assignIfUsed( const TextFont& rTextFont ); 52 53 /** Returns the font name, pitch, and family; tries to resolve theme 54 placeholder names, e.g. '+mj-lt' for the major latin theme font. */ 55 bool getFontData( 56 ::rtl::OUString& rFontName, 57 sal_Int16 rnFontPitch, 58 sal_Int16& rnFontFamily, 59 const ::oox::core::XmlFilterBase& rFilter ) const; 60 61 private: 62 bool implGetFontData( 63 ::rtl::OUString& rFontName, 64 sal_Int16 rnFontPitch, 65 sal_Int16& rnFontFamily ) const; 66 67 private: 68 ::rtl::OUString maTypeface; 69 ::rtl::OUString maPanose; 70 sal_Int32 mnPitch; 71 sal_Int32 mnCharset; 72 }; 73 74 // ============================================================================ 75 76 } // namespace drawingml 77 } // namespace oox 78 79 #endif 80 81