LCOV - code coverage report
Current view: top level - sw/inc - fmtinfmt.hxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 27 29 93.1 %
Date: 2015-06-13 12:38:46 Functions: 11 12 91.7 %
Legend: Lines: hit not hit

          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             : #ifndef INCLUDED_SW_INC_FMTINFMT_HXX
      20             : #define INCLUDED_SW_INC_FMTINFMT_HXX
      21             : 
      22             : #include <svl/poolitem.hxx>
      23             : #include "swdllapi.h"
      24             : 
      25             : class SvxMacro;
      26             : class SvxMacroTableDtor;
      27             : class SwTextINetFormat;
      28             : class IntlWrapper;
      29             : 
      30             : // ATT_INETFMT
      31             : 
      32             : class SW_DLLPUBLIC SwFormatINetFormat: public SfxPoolItem
      33             : {
      34             :     friend class SwTextINetFormat;
      35             : 
      36             :     OUString msURL;                  ///< URL.
      37             :     OUString msTargetFrame;          ///< Target frame for URL.
      38             :     OUString msINetFormatName;
      39             :     OUString msVisitedFormatName;
      40             :     OUString msHyperlinkName;        ///< Name of the link.
      41             :     SvxMacroTableDtor* mpMacroTable;
      42             :     SwTextINetFormat* mpTextAttr;         ///< My TextAttribute.
      43             :     sal_uInt16 mnINetFormatId;
      44             :     sal_uInt16 mnVisitedFormatId;
      45             : public:
      46             :     SwFormatINetFormat( const OUString& rURL, const OUString& rTarget );
      47             :     SwFormatINetFormat( const SwFormatINetFormat& rAttr );
      48             :     SwFormatINetFormat();                     ///< For TypeInfo.
      49             :     virtual ~SwFormatINetFormat();
      50             : 
      51             :     TYPEINFO_OVERRIDE();
      52             : 
      53             :     /// "Pure virtual methods" of SfxPoolItem.
      54             :     virtual bool            operator==( const SfxPoolItem& ) const SAL_OVERRIDE;
      55             :     virtual SfxPoolItem*    Clone( SfxItemPool* pPool = 0 ) const SAL_OVERRIDE;
      56             :     virtual bool GetPresentation( SfxItemPresentation ePres,
      57             :                                     SfxMapUnit eCoreMetric,
      58             :                                     SfxMapUnit ePresMetric,
      59             :                                     OUString &rText,
      60             :                                     const IntlWrapper* pIntl = 0 ) const SAL_OVERRIDE;
      61             : 
      62             :     virtual bool QueryValue( com::sun::star::uno::Any& rVal,
      63             :                                         sal_uInt8 nMemberId = 0 ) const SAL_OVERRIDE;
      64             :     virtual bool PutValue( const com::sun::star::uno::Any& rVal,
      65             :                                         sal_uInt8 nMemberId = 0 ) SAL_OVERRIDE;
      66             : 
      67       16256 :     const SwTextINetFormat* GetTextINetFormat() const
      68             :     {
      69       16256 :         return mpTextAttr;
      70             :     }
      71             :     SwTextINetFormat* GetTextINetFormat()
      72             :     {
      73             :         return mpTextAttr;
      74             :     }
      75             : 
      76       28591 :     const OUString& GetValue() const
      77             :     {
      78       28591 :         return msURL;
      79             :     }
      80             : 
      81           8 :     const OUString& GetName() const
      82             :     {
      83           8 :         return msHyperlinkName;
      84             :     }
      85           4 :     void SetName( const OUString& rNm )
      86             :     {
      87           4 :         msHyperlinkName = rNm;
      88           4 :     }
      89             : 
      90         273 :     const OUString& GetTargetFrame() const
      91             :     {
      92         273 :         return msTargetFrame;
      93             :     }
      94             : 
      95          10 :     void SetINetFormatAndId(
      96             :             const OUString& rNm,
      97             :             const sal_uInt16 nId )
      98             :     {
      99          10 :         msINetFormatName = rNm;
     100          10 :         mnINetFormatId = nId;
     101          10 :     }
     102             : 
     103       16038 :     const OUString& GetINetFormat() const
     104             :     {
     105       16038 :         return msINetFormatName;
     106             :     }
     107             : 
     108       16040 :     sal_uInt16 GetINetFormatId() const
     109             :     {
     110       16040 :         return mnINetFormatId;
     111             :     }
     112             : 
     113          10 :     void SetVisitedFormatAndId(
     114             :             const OUString& rNm,
     115             :             const sal_uInt16 nId )
     116             :     {
     117          10 :         msVisitedFormatName = rNm;
     118          10 :         mnVisitedFormatId = nId;
     119          10 :     }
     120             : 
     121           3 :     const OUString& GetVisitedFormat() const
     122             :     {
     123           3 :         return msVisitedFormatName;
     124             :     }
     125             : 
     126           0 :     sal_uInt16 GetVisitedFormatId() const
     127             :     {
     128           0 :         return mnVisitedFormatId;
     129             :     }
     130             : 
     131             :     /// Set a new MacroTable or clear the current one.
     132             :     void SetMacroTable( const SvxMacroTableDtor* pTable = 0 );
     133        8605 :     const SvxMacroTableDtor* GetMacroTable() const
     134             :     {
     135        8605 :         return mpMacroTable;
     136             :     }
     137             : 
     138             :     /// Macro getter and setter.
     139             :     void SetMacro(
     140             :             sal_uInt16 nEvent,
     141             :             const SvxMacro& rMacro );
     142             :     const SvxMacro* GetMacro( sal_uInt16 nEvent ) const;
     143             : };
     144             : 
     145             : #endif
     146             : 
     147             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11