1*2d785d7eSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*2d785d7eSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*2d785d7eSAndrew Rist * or more contributor license agreements. See the NOTICE file 5*2d785d7eSAndrew Rist * distributed with this work for additional information 6*2d785d7eSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*2d785d7eSAndrew Rist * to you under the Apache License, Version 2.0 (the 8*2d785d7eSAndrew Rist * "License"); you may not use this file except in compliance 9*2d785d7eSAndrew Rist * with the License. You may obtain a copy of the License at 10*2d785d7eSAndrew Rist * 11*2d785d7eSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*2d785d7eSAndrew Rist * 13*2d785d7eSAndrew Rist * Unless required by applicable law or agreed to in writing, 14*2d785d7eSAndrew Rist * software distributed under the License is distributed on an 15*2d785d7eSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*2d785d7eSAndrew Rist * KIND, either express or implied. See the License for the 17*2d785d7eSAndrew Rist * specific language governing permissions and limitations 18*2d785d7eSAndrew Rist * under the License. 19*2d785d7eSAndrew Rist * 20*2d785d7eSAndrew Rist *************************************************************/ 21*2d785d7eSAndrew Rist 22*2d785d7eSAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef FORMS_SOURCE_COMPONENT_FORMCONTROLFONT_HXX 25cdf0e10cSrcweir #define FORMS_SOURCE_COMPONENT_FORMCONTROLFONT_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include <com/sun/star/io/XObjectOutputStream.hpp> 28cdf0e10cSrcweir #include <com/sun/star/awt/FontDescriptor.hpp> 29cdf0e10cSrcweir #include <com/sun/star/beans/Property.hpp> 30cdf0e10cSrcweir #include <com/sun/star/lang/IllegalArgumentException.hpp> 31cdf0e10cSrcweir 32cdf0e10cSrcweir //......................................................................... 33cdf0e10cSrcweir namespace frm 34cdf0e10cSrcweir { 35cdf0e10cSrcweir //......................................................................... 36cdf0e10cSrcweir 37cdf0e10cSrcweir //===================================================================== 38cdf0e10cSrcweir //= FontControlModel 39cdf0e10cSrcweir //===================================================================== 40cdf0e10cSrcweir class FontControlModel 41cdf0e10cSrcweir { 42cdf0e10cSrcweir private: 43cdf0e10cSrcweir // <properties> 44cdf0e10cSrcweir ::com::sun::star::awt::FontDescriptor m_aFont; 45cdf0e10cSrcweir sal_Int16 m_nFontRelief; 46cdf0e10cSrcweir sal_Int16 m_nFontEmphasis; 47cdf0e10cSrcweir ::com::sun::star::uno::Any m_aTextLineColor; 48cdf0e10cSrcweir ::com::sun::star::uno::Any m_aTextColor; 49cdf0e10cSrcweir // </properties> 50cdf0e10cSrcweir 51cdf0e10cSrcweir bool m_bToolkitCompatibleDefaults; 52cdf0e10cSrcweir 53cdf0e10cSrcweir protected: getFont() const54cdf0e10cSrcweir const ::com::sun::star::awt::FontDescriptor& getFont() const { return m_aFont; } setFont(const::com::sun::star::awt::FontDescriptor & _rFont)55cdf0e10cSrcweir void setFont( const ::com::sun::star::awt::FontDescriptor& _rFont ) { m_aFont = _rFont; } 56cdf0e10cSrcweir setTextColor(sal_Int32 _nColor)57cdf0e10cSrcweir void setTextColor( sal_Int32 _nColor ) { m_aTextColor <<= _nColor; } clearTextColor()58cdf0e10cSrcweir void clearTextColor( ) { m_aTextColor.clear(); } hasTextColor() const59cdf0e10cSrcweir bool hasTextColor( ) const { return m_aTextColor.hasValue(); } 60cdf0e10cSrcweir sal_Int32 getTextColor( ) const; 61cdf0e10cSrcweir setTextLineColor(sal_Int32 _nColor)62cdf0e10cSrcweir void setTextLineColor( sal_Int32 _nColor ) { m_aTextLineColor <<= _nColor; } clearTextLineColor()63cdf0e10cSrcweir void clearTextLineColor( ) { m_aTextLineColor.clear(); } hasTextLineColor() const64cdf0e10cSrcweir bool hasTextLineColor( ) const { return m_aTextLineColor.hasValue(); } 65cdf0e10cSrcweir sal_Int32 getTextLineColor( ) const; 66cdf0e10cSrcweir 67cdf0e10cSrcweir protected: 68cdf0e10cSrcweir FontControlModel( bool _bToolkitCompatibleDefaults ); 69cdf0e10cSrcweir FontControlModel( const FontControlModel* _pOriginal ); 70cdf0e10cSrcweir 71cdf0e10cSrcweir protected: 72cdf0e10cSrcweir bool isFontRelatedProperty( sal_Int32 _nPropertyHandle ) const; 73cdf0e10cSrcweir bool isFontAggregateProperty( sal_Int32 _nPropertyHandle ) const; 74cdf0e10cSrcweir 75cdf0e10cSrcweir /// appends (!) the description of all font related properties to the given sequence 76cdf0e10cSrcweir void describeFontRelatedProperties( 77cdf0e10cSrcweir ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rProps ) const; 78cdf0e10cSrcweir 79cdf0e10cSrcweir void getFastPropertyValue ( ::com::sun::star::uno::Any& _rValue, sal_Int32 _nHandle ) const; 80cdf0e10cSrcweir sal_Bool convertFastPropertyValue ( ::com::sun::star::uno::Any& _rConvertedValue, ::com::sun::star::uno::Any& _rOldValue, sal_Int32 _nHandle, const ::com::sun::star::uno::Any& _rValue ) throw( ::com::sun::star::lang::IllegalArgumentException ); 81cdf0e10cSrcweir void setFastPropertyValue_NoBroadcast( sal_Int32 _nHandle, const ::com::sun::star::uno::Any& _rValue ) throw ( ::com::sun::star::uno::Exception ); 82cdf0e10cSrcweir ::com::sun::star::uno::Any 83cdf0e10cSrcweir getPropertyDefaultByHandle ( sal_Int32 _nHandle ) const; 84cdf0e10cSrcweir 85cdf0e10cSrcweir private: 86cdf0e10cSrcweir 87cdf0e10cSrcweir private: 88cdf0e10cSrcweir FontControlModel(); // never implemented 89cdf0e10cSrcweir FontControlModel( const FontControlModel& ); // never implemented 90cdf0e10cSrcweir FontControlModel& operator=( const FontControlModel& ); // never implemented 91cdf0e10cSrcweir }; 92cdf0e10cSrcweir 93cdf0e10cSrcweir //......................................................................... 94cdf0e10cSrcweir } // namespace frm 95cdf0e10cSrcweir //......................................................................... 96cdf0e10cSrcweir 97cdf0e10cSrcweir #endif // FORMS_SOURCE_COMPONENT_FORMCONTROLFONT_HXX 98