LCOV - code coverage report
Current view: top level - forms/source/inc - formcontrolfont.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 7 9 77.8 %
Date: 2012-08-25 Functions: 7 9 77.8 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 0 -

           Branch data     Line data    Source code
       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                 :            : #ifndef FORMS_SOURCE_COMPONENT_FORMCONTROLFONT_HXX
      21                 :            : #define FORMS_SOURCE_COMPONENT_FORMCONTROLFONT_HXX
      22                 :            : 
      23                 :            : #include <com/sun/star/io/XObjectOutputStream.hpp>
      24                 :            : #include <com/sun/star/awt/FontDescriptor.hpp>
      25                 :            : #include <com/sun/star/beans/Property.hpp>
      26                 :            : #include <com/sun/star/lang/IllegalArgumentException.hpp>
      27                 :            : 
      28                 :            : //.........................................................................
      29                 :            : namespace frm
      30                 :            : {
      31                 :            : //.........................................................................
      32                 :            : 
      33                 :            :     //=====================================================================
      34                 :            :     //= FontControlModel
      35                 :            :     //=====================================================================
      36                 :        230 :     class FontControlModel
      37                 :            :     {
      38                 :            :     private:
      39                 :            :         // <properties>
      40                 :            :         ::com::sun::star::awt::FontDescriptor   m_aFont;
      41                 :            :         sal_Int16                               m_nFontRelief;
      42                 :            :         sal_Int16                               m_nFontEmphasis;
      43                 :            :         ::com::sun::star::uno::Any              m_aTextLineColor;
      44                 :            :         ::com::sun::star::uno::Any              m_aTextColor;
      45                 :            :         // </properties>
      46                 :            : 
      47                 :            :         bool                                    m_bToolkitCompatibleDefaults;
      48                 :            : 
      49                 :            :     protected:
      50                 :        499 :         const ::com::sun::star::awt::FontDescriptor& getFont() const { return m_aFont; }
      51                 :          6 :         void setFont( const ::com::sun::star::awt::FontDescriptor& _rFont ) { m_aFont = _rFont; }
      52                 :            : 
      53                 :          0 :         void        setTextColor( sal_Int32 _nColor ) { m_aTextColor <<= _nColor;       }
      54                 :          2 :         void        clearTextColor( )                 { m_aTextColor.clear();           }
      55                 :          4 :         bool        hasTextColor( ) const             { return m_aTextColor.hasValue(); }
      56                 :            :         sal_Int32   getTextColor( ) const;
      57                 :            : 
      58                 :          0 :         void        setTextLineColor( sal_Int32 _nColor ) { m_aTextLineColor <<= _nColor;       }
      59                 :          2 :         void        clearTextLineColor( )                 { m_aTextLineColor.clear();           }
      60                 :          2 :         bool        hasTextLineColor( ) const             { return m_aTextLineColor.hasValue(); }
      61                 :            :         sal_Int32   getTextLineColor( ) const;
      62                 :            : 
      63                 :            :     protected:
      64                 :            :         FontControlModel( bool _bToolkitCompatibleDefaults );
      65                 :            :         FontControlModel( const FontControlModel* _pOriginal );
      66                 :            : 
      67                 :            :     protected:
      68                 :            :         bool     isFontRelatedProperty( sal_Int32 _nPropertyHandle ) const;
      69                 :            :         bool     isFontAggregateProperty( sal_Int32 _nPropertyHandle ) const;
      70                 :            : 
      71                 :            :         /// appends (!) the description of all font related properties to the given sequence
      72                 :            :         void     describeFontRelatedProperties(
      73                 :            :             ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rProps ) const;
      74                 :            : 
      75                 :            :         void     getFastPropertyValue            ( ::com::sun::star::uno::Any& _rValue, sal_Int32 _nHandle ) const;
      76                 :            :         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 );
      77                 :            :         void     setFastPropertyValue_NoBroadcast( sal_Int32 _nHandle, const ::com::sun::star::uno::Any& _rValue ) throw ( ::com::sun::star::uno::Exception );
      78                 :            :         ::com::sun::star::uno::Any
      79                 :            :                  getPropertyDefaultByHandle      ( sal_Int32 _nHandle ) const;
      80                 :            : 
      81                 :            :     private:
      82                 :            : 
      83                 :            :     private:
      84                 :            :         FontControlModel();                                     // never implemented
      85                 :            :         FontControlModel( const FontControlModel& );            // never implemented
      86                 :            :         FontControlModel& operator=( const FontControlModel& ); // never implemented
      87                 :            :     };
      88                 :            : 
      89                 :            : //.........................................................................
      90                 :            : }   // namespace frm
      91                 :            : //.........................................................................
      92                 :            : 
      93                 :            : #endif // FORMS_SOURCE_COMPONENT_FORMCONTROLFONT_HXX
      94                 :            : 
      95                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10