LCOV - code coverage report
Current view: top level - sw/inc - fmtinfmt.hxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 29 31 93.5 %
Date: 2014-11-03 Functions: 12 13 92.3 %
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 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        1026 :     const SwTxtINetFmt* GetTxtINetFmt() const
      68             :     {
      69        1026 :         return mpTxtAttr;
      70             :     }
      71       26781 :     SwTxtINetFmt* GetTxtINetFmt()
      72             :     {
      73       26781 :         return mpTxtAttr;
      74             :     }
      75             : 
      76       47079 :     const OUString& GetValue() const
      77             :     {
      78       47079 :         return msURL;
      79             :     }
      80             : 
      81          12 :     const OUString& GetName() const
      82             :     {
      83          12 :         return msHyperlinkName;
      84             :     }
      85           8 :     void SetName( const OUString& rNm )
      86             :     {
      87           8 :         msHyperlinkName = rNm;
      88           8 :     }
      89             : 
      90         442 :     const OUString& GetTargetFrame() const
      91             :     {
      92         442 :         return msTargetFrame;
      93             :     }
      94             : 
      95          18 :     void SetINetFmtAndId(
      96             :             const OUString& rNm,
      97             :             const sal_uInt16 nId )
      98             :     {
      99          18 :         msINetFmtName = rNm;
     100          18 :         mnINetFmtId = nId;
     101          18 :     }
     102             : 
     103       27431 :     const OUString& GetINetFmt() const
     104             :     {
     105       27431 :         return msINetFmtName;
     106             :     }
     107             : 
     108       27435 :     sal_uInt16 GetINetFmtId() const
     109             :     {
     110       27435 :         return mnINetFmtId;
     111             :     }
     112             : 
     113          18 :     void SetVisitedFmtAndId(
     114             :             const OUString& rNm,
     115             :             const sal_uInt16 nId )
     116             :     {
     117          18 :         msVisitedFmtName = rNm;
     118          18 :         mnVisitedFmtId = nId;
     119          18 :     }
     120             : 
     121           6 :     const OUString& GetVisitedFmt() const
     122             :     {
     123           6 :         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       13200 :     const SvxMacroTableDtor* GetMacroTbl() const
     134             :     {
     135       13200 :         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