LCOV - code coverage report
Current view: top level - libreoffice/sw/inc - unocrsr.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 7 12 58.3 %
Date: 2012-12-27 Functions: 6 9 66.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 _UNOCRSR_HXX
      20             : #define _UNOCRSR_HXX
      21             : #include <swcrsr.hxx>
      22             : #include <calbck.hxx>
      23             : 
      24             : 
      25             : class SwUnoCrsr : public virtual SwCursor, public SwModify
      26             : {
      27             :     sal_Bool bRemainInSection : 1;
      28             :     sal_Bool bSkipOverHiddenSections : 1;
      29             :     sal_Bool bSkipOverProtectSections : 1;
      30             : 
      31             : public:
      32             :     SwUnoCrsr( const SwPosition &rPos, SwPaM* pRing = 0 );
      33             :     virtual ~SwUnoCrsr();
      34             : 
      35             : protected:
      36             : 
      37             :     virtual const SwCntntFrm* DoSetBidiLevelLeftRight(
      38             :         sal_Bool & io_rbLeft, sal_Bool bVisualAllowed, sal_Bool bInsertCrsr);
      39             :     virtual void DoSetBidiLevelUpDown();
      40             : 
      41             : public:
      42             : 
      43             :     // Does a selection of content exist in table?
      44             :     // Return value indicates if the cursor remains at its old position.
      45             :     virtual sal_Bool IsSelOvr( int eFlags =
      46             :                                 ( nsSwCursorSelOverFlags::SELOVER_CHECKNODESSECTION |
      47             :                                   nsSwCursorSelOverFlags::SELOVER_TOGGLE |
      48             :                                   nsSwCursorSelOverFlags::SELOVER_CHANGEPOS ));
      49             : 
      50             :     virtual bool IsReadOnlyAvailable() const;
      51             : 
      52        1367 :     sal_Bool IsRemainInSection() const          { return bRemainInSection; }
      53         788 :     void SetRemainInSection( sal_Bool bFlag )   { bRemainInSection = bFlag; }
      54             : 
      55        1682 :     virtual sal_Bool IsSkipOverProtectSections() const
      56        1682 :                                     { return bSkipOverProtectSections; }
      57           0 :     void SetSkipOverProtectSections( sal_Bool bFlag )
      58           0 :                                     { bSkipOverProtectSections = bFlag; }
      59             : 
      60        1682 :     virtual sal_Bool IsSkipOverHiddenSections() const
      61        1682 :                                     { return bSkipOverHiddenSections; }
      62           0 :     void SetSkipOverHiddenSections( sal_Bool bFlag )
      63           0 :                                     { bSkipOverHiddenSections = bFlag; }
      64             : 
      65             :     // make copy of cursor
      66             :     virtual SwUnoCrsr * Clone() const;
      67             : 
      68       10096 :     DECL_FIXEDMEMPOOL_NEWDEL( SwUnoCrsr )
      69             : };
      70             : 
      71             : 
      72             : 
      73             : class SwUnoTableCrsr : public virtual SwUnoCrsr, public virtual SwTableCursor
      74             : {
      75             :     // The selection has the same order as the table boxes, i.e.
      76             :     // if something is deleted from the one array at a certain position
      77             :     // it has also to be deleted from the other!
      78             :     SwCursor aTblSel;
      79             : 
      80             :     using SwTableCursor::MakeBoxSels;
      81             : 
      82             : public:
      83             :     SwUnoTableCrsr( const SwPosition& rPos );
      84             :     virtual ~SwUnoTableCrsr();
      85             : 
      86             :     // Does a selection of content exist in table?
      87             :     // Return value indicates if the cursor remains at its old position.
      88             :     virtual sal_Bool IsSelOvr( int eFlags =
      89             :                                 ( nsSwCursorSelOverFlags::SELOVER_CHECKNODESSECTION |
      90             :                                   nsSwCursorSelOverFlags::SELOVER_TOGGLE |
      91             :                                   nsSwCursorSelOverFlags::SELOVER_CHANGEPOS ));
      92             : 
      93             :     virtual SwUnoTableCrsr * Clone() const;
      94             : 
      95             :     void MakeBoxSels();
      96             : 
      97           0 :           SwCursor& GetSelRing()            { return aTblSel; }
      98             :     const SwCursor& GetSelRing() const      { return aTblSel; }
      99             : };
     100             : 
     101             : 
     102             : 
     103             : #endif
     104             : 
     105             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10