LCOV - code coverage report
Current view: top level - sw/inc - fmtinfmt.hxx (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 25 31 80.6 %
Date: 2014-04-11 Functions: 10 13 76.9 %
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 SwTxtINetFmt;
      28             : class IntlWrapper;
      29             : 
      30             : // ATT_INETFMT
      31             : 
      32             : class SW_DLLPUBLIC SwFmtINetFmt: public SfxPoolItem
      33             : {
      34             :     friend class SwTxtINetFmt;
      35             : 
      36             :     OUString msURL;                  ///< URL.
      37             :     OUString msTargetFrame;          ///< Target frame for URL.
      38             :     OUString msINetFmtName;
      39             :     OUString msVisitedFmtName;
      40             :     OUString msHyperlinkName;        ///< Name of the link.
      41             :     SvxMacroTableDtor* mpMacroTbl;
      42             :     SwTxtINetFmt* mpTxtAttr;         ///< My TextAttribute.
      43             :     sal_uInt16 mnINetFmtId;
      44             :     sal_uInt16 mnVisitedFmtId;
      45             : public:
      46             :     SwFmtINetFmt( const OUString& rURL, const OUString& rTarget );
      47             :     SwFmtINetFmt( const SwFmtINetFmt& rAttr );
      48             :     SwFmtINetFmt();                     ///< For TypeInfo.
      49             :     virtual ~SwFmtINetFmt();
      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 SfxItemPresentation 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         690 :     const SwTxtINetFmt* GetTxtINetFmt() const
      68             :     {
      69         690 :         return mpTxtAttr;
      70             :     }
      71       16701 :     SwTxtINetFmt* GetTxtINetFmt()
      72             :     {
      73       16701 :         return mpTxtAttr;
      74             :     }
      75             : 
      76       28198 :     const OUString& GetValue() const
      77             :     {
      78       28198 :         return msURL;
      79             :     }
      80             : 
      81           0 :     const OUString& GetName() const
      82             :     {
      83           0 :         return msHyperlinkName;
      84             :     }
      85           1 :     void SetName( const OUString& rNm )
      86             :     {
      87           1 :         msHyperlinkName = rNm;
      88           1 :     }
      89             : 
      90         304 :     const OUString& GetTargetFrame() const
      91             :     {
      92         304 :         return msTargetFrame;
      93             :     }
      94             : 
      95           3 :     void SetINetFmtAndId(
      96             :             const OUString& rNm,
      97             :             const sal_uInt16 nId )
      98             :     {
      99           3 :         msINetFmtName = rNm;
     100           3 :         mnINetFmtId = nId;
     101           3 :     }
     102             : 
     103       17093 :     const OUString& GetINetFmt() const
     104             :     {
     105       17093 :         return msINetFmtName;
     106             :     }
     107             : 
     108       17093 :     sal_uInt16 GetINetFmtId() const
     109             :     {
     110       17093 :         return mnINetFmtId;
     111             :     }
     112             : 
     113           3 :     void SetVisitedFmtAndId(
     114             :             const OUString& rNm,
     115             :             const sal_uInt16 nId )
     116             :     {
     117           3 :         msVisitedFmtName = rNm;
     118           3 :         mnVisitedFmtId = nId;
     119           3 :     }
     120             : 
     121           0 :     const OUString& GetVisitedFmt() const
     122             :     {
     123           0 :         return msVisitedFmtName;
     124             :     }
     125             : 
     126           0 :     sal_uInt16 GetVisitedFmtId() const
     127             :     {
     128           0 :         return mnVisitedFmtId;
     129             :     }
     130             : 
     131             :     /// Set a new MacroTable or clear the current one.
     132             :     void SetMacroTbl( const SvxMacroTableDtor* pTbl = 0 );
     133        7089 :     const SvxMacroTableDtor* GetMacroTbl() const
     134             :     {
     135        7089 :         return mpMacroTbl;
     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.10