LCOV - code coverage report
Current view: top level - sw/inc - IMark.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 11 13 84.6 %
Date: 2012-08-25 Functions: 13 25 52.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 12 80 15.0 %

           Branch data     Line data    Source code
       1                 :            : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2                 :            : /*************************************************************************
       3                 :            :  *
       4                 :            :  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       5                 :            :  *
       6                 :            :  * Copyright 2000, 2010 Oracle and/or its affiliates.
       7                 :            :  *
       8                 :            :  * OpenOffice.org - a multi-platform office productivity suite
       9                 :            :  *
      10                 :            :  * This file is part of OpenOffice.org.
      11                 :            :  *
      12                 :            :  * OpenOffice.org is free software: you can redistribute it and/or modify
      13                 :            :  * it under the terms of the GNU Lesser General Public License version 3
      14                 :            :  * only, as published by the Free Software Foundation.
      15                 :            :  *
      16                 :            :  * OpenOffice.org is distributed in the hope that it will be useful,
      17                 :            :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      18                 :            :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      19                 :            :  * GNU Lesser General Public License version 3 for more details
      20                 :            :  * (a copy is included in the LICENSE file that accompanied this code).
      21                 :            :  *
      22                 :            :  * You should have received a copy of the GNU Lesser General Public License
      23                 :            :  * version 3 along with OpenOffice.org.  If not, see
      24                 :            :  * <http://www.openoffice.org/license.html>
      25                 :            :  * for a copy of the LGPLv3 License.
      26                 :            :  *
      27                 :            :  ************************************************************************/
      28                 :            : #ifndef _IMARK_HXX
      29                 :            : #define _IMARK_HXX
      30                 :            : 
      31                 :            : #include <vcl/keycod.hxx>
      32                 :            : #include <calbck.hxx>
      33                 :            : #include <pam.hxx>
      34                 :            : #include <boost/operators.hpp>
      35                 :            : #include <map>
      36                 :            : #include "swdll.hxx"
      37                 :            : 
      38                 :            : #ifndef SW_DECL_SWSERVEROBJECT_DEFINED
      39                 :            : #define SW_DECL_SWSERVEROBJECT_DEFINED
      40                 :       4851 : SV_DECL_REF( SwServerObject )
      41                 :            : #endif
      42                 :            : 
      43                 :            : 
      44                 :            : struct SwPosition;
      45                 :            : 
      46                 :            : namespace sw { namespace mark
      47                 :            : {
      48 [ #  # ][ #  # ]:      48705 :     class SAL_DLLPUBLIC_EXPORT IMark
         [ -  + ][ -  + ]
      49                 :            :         : virtual public SwModify // inherited as interface
      50                 :            :         , public ::boost::totally_ordered<IMark>
      51                 :            :     {
      52                 :            :         public:
      53                 :            :             //getters
      54                 :            :             virtual const SwPosition& GetMarkPos() const =0;
      55                 :            :             // GetOtherMarkPos() is only guaranteed to return a valid
      56                 :            :             // reference if IsExpanded() returned true
      57                 :            :             virtual const SwPosition& GetOtherMarkPos() const =0;
      58                 :            :             virtual const SwPosition& GetMarkStart() const =0;
      59                 :            :             virtual const SwPosition& GetMarkEnd() const =0;
      60                 :            :             virtual const ::rtl::OUString& GetName() const =0;
      61                 :            :             virtual bool IsExpanded() const =0;
      62                 :            :             virtual bool IsCoveringPosition(const SwPosition& rPos) const =0;
      63                 :            : 
      64                 :            :             //setters
      65                 :            :             // not available in IMark
      66                 :            :             // inside core, you can cast to MarkBase and use its setters,
      67                 :            :             // make sure to update the sortings in Markmanager in this case
      68                 :            : 
      69                 :            :             //operators and comparisons (non-virtual)
      70                 :            :             bool operator<(const IMark& rOther) const
      71                 :            :                 { return GetMarkStart() < rOther.GetMarkStart(); }
      72                 :        121 :             bool operator==(const IMark& rOther) const
      73                 :        121 :                 { return GetMarkStart() == rOther.GetMarkStart(); }
      74                 :     144067 :             bool StartsBefore(const SwPosition& rPos) const
      75                 :     144067 :                 { return GetMarkStart() < rPos; }
      76                 :        963 :             bool StartsAfter(const SwPosition& rPos) const
      77                 :        963 :                 { return GetMarkStart() > rPos; }
      78                 :          0 :             bool EndsBefore(const SwPosition& rPos) const
      79                 :          0 :                 { return GetMarkEnd() < rPos; }
      80                 :            :             bool EndsAfter(const SwPosition& rPos) const
      81                 :            :                 { return GetMarkEnd() > rPos; }
      82                 :            : 
      83                 :            :             virtual rtl::OUString ToString( ) const =0;
      84                 :            :     };
      85                 :            : 
      86 [ #  # ][ #  # ]:       8030 :     class SAL_DLLPUBLIC_EXPORT IBookmark
         [ #  # ][ #  # ]
         [ #  # ][ -  + ]
         [ #  # ][ -  + ]
         [ -  + ][ #  # ]
      87                 :            :         : virtual public IMark
      88                 :            :     {
      89                 :            :         public:
      90                 :            :             virtual const ::rtl::OUString& GetShortName() const =0;
      91                 :            :             virtual const KeyCode& GetKeyCode() const =0;
      92                 :            :             virtual void SetShortName(const ::rtl::OUString&) =0;
      93                 :            :             virtual void SetKeyCode(const KeyCode&) =0;
      94                 :            :     };
      95                 :            : 
      96 [ #  # ][ #  # ]:         39 :     class SAL_DLLPUBLIC_EXPORT IFieldmark
         [ #  # ][ #  # ]
         [ #  # ][ -  + ]
         [ #  # ][ -  + ]
         [ -  + ][ #  # ]
      97                 :            :         : virtual public IMark
      98                 :            :     {
      99                 :            :         public:
     100                 :            :             typedef ::std::map< ::rtl::OUString, ::com::sun::star::uno::Any> parameter_map_t;
     101                 :            :             //getters
     102                 :            :             virtual ::rtl::OUString GetFieldname() const =0;
     103                 :            :             virtual ::rtl::OUString GetFieldHelptext() const =0;
     104                 :            :             virtual parameter_map_t* GetParameters() =0;
     105                 :            :             virtual const parameter_map_t* GetParameters() const =0;
     106                 :            : 
     107                 :            :             //setters
     108                 :            :             virtual void SetFieldname(const ::rtl::OUString& rFieldname) =0;
     109                 :            :             virtual void SetFieldHelptext(const ::rtl::OUString& rFieldHelptext) =0;
     110                 :            :             virtual void Invalidate() = 0;
     111                 :            :     };
     112                 :            : 
     113 [ #  # ][ #  # ]:          6 :     class SAL_DLLPUBLIC_EXPORT ICheckboxFieldmark
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
           [ #  #  #  # ]
         [ -  + ][ #  # ]
         [ -  + ][ #  # ]
         [ -  + ][ -  + ]
           [ #  #  #  # ]
     114                 :            :         : virtual public IFieldmark
     115                 :            :     {
     116                 :            :         public:
     117                 :            :             virtual bool IsChecked() const =0;
     118                 :            :             virtual void SetChecked(bool checked) =0;
     119                 :            :     };
     120                 :            : }}
     121                 :            : #endif
     122                 :            : 
     123                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10