LCOV - code coverage report
Current view: top level - libreoffice/sw/source/core/inc - acorrect.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 7 0.0 %
Date: 2012-12-27 Functions: 0 4 0.0 %
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             : 
      20             : #ifndef _ACORRECT_HXX
      21             : #define _ACORRECT_HXX
      22             : 
      23             : #include <editeng/svxacorr.hxx>
      24             : #include <swundo.hxx>
      25             : 
      26             : class SwEditShell;
      27             : class SwPaM;
      28             : class SwNodeIndex;
      29             : struct SwPosition;
      30             : class SfxItemSet;
      31             : 
      32             : class SwDontExpandItem
      33             : {
      34             :     SfxItemSet* pDontExpItems;
      35             : 
      36             : public:
      37           0 :     SwDontExpandItem() :
      38           0 :         pDontExpItems(0){}
      39             :     ~SwDontExpandItem();
      40             : 
      41             :     void SaveDontExpandItems( const SwPosition& rPos );
      42             :     void RestoreDontExpandItems( const SwPosition& rPos );
      43             : 
      44             : };
      45             : 
      46             : class SwAutoCorrDoc : public SvxAutoCorrDoc
      47             : {
      48             :     SwEditShell& rEditSh;
      49             :     SwPaM& rCrsr;
      50             :     SwNodeIndex* pIdx;
      51             :     int m_nEndUndoCounter;
      52             :     bool    bUndoIdInitialized;
      53             : 
      54             :     void DeleteSel( SwPaM& rDelPam );
      55             : 
      56             : public:
      57             :     SwAutoCorrDoc( SwEditShell& rEditShell, SwPaM& rPam, sal_Unicode cIns = 0 );
      58             :     ~SwAutoCorrDoc();
      59             : 
      60             :     virtual sal_Bool Delete( xub_StrLen nStt, xub_StrLen nEnd );
      61             :     virtual sal_Bool Insert( xub_StrLen nPos, const String& rTxt );
      62             :     virtual sal_Bool Replace( xub_StrLen nPos, const String& rTxt );
      63             :     virtual sal_Bool ReplaceRange( xub_StrLen nPos, xub_StrLen nLen, const String& rTxt );
      64             : 
      65             :     virtual sal_Bool SetAttr( xub_StrLen nStt, xub_StrLen nEnd, sal_uInt16 nSlotId,
      66             :                             SfxPoolItem& );
      67             : 
      68             :     virtual sal_Bool SetINetAttr( xub_StrLen nStt, xub_StrLen nEnd, const String& rURL );
      69             : 
      70             :     // return text of a previous paragraph
      71             :     // This must not be empty/blank!
      72             :     // If it does not exist or if there is nothing before, return 0.
      73             :     //  - sal_True:  paragraph before "normal" insertion position
      74             :     //  - sal_False: paragraph in that the corrected word was inserted
      75             :     //               (does not need to be the same paragraph)
      76             :     virtual const String* GetPrevPara( sal_Bool bAtNormalPos );
      77             : 
      78             :     virtual sal_Bool ChgAutoCorrWord( xub_StrLen& rSttPos, xub_StrLen nEndPos,
      79             :                                   SvxAutoCorrect& rACorrect,
      80             :                                   const String** ppPara );
      81             : 
      82             :     // Will be called after swapping characters by the functions
      83             :     //  - FnCptlSttWrd and
      84             :     //  - FnCptlSttSntnc.
      85             :     // Afterwards the words can be added into exception list if needed.
      86             :     virtual void SaveCpltSttWord( sal_uLong nFlag, xub_StrLen nPos,
      87             :                                     const String& rExceptWord, sal_Unicode cChar );
      88             :     virtual LanguageType GetLanguage( xub_StrLen nPos, sal_Bool bPrevPara ) const;
      89             : };
      90             : 
      91           0 : class SwAutoCorrExceptWord
      92             : {
      93             :     String sWord;
      94             :     sal_uLong nFlags, nNode;
      95             :     xub_StrLen nCntnt;
      96             :     sal_Unicode cChar;
      97             :     LanguageType eLanguage;
      98             :     sal_Bool bDeleted;
      99             : 
     100             : public:
     101           0 :     SwAutoCorrExceptWord( sal_uLong nAFlags, sal_uLong nNd, xub_StrLen nContent,
     102             :                                         const String& rWord, sal_Unicode cChr,
     103             :                                         LanguageType eLang )
     104             :         : sWord(rWord), nFlags(nAFlags), nNode(nNd), nCntnt(nContent),
     105           0 :         cChar(cChr), eLanguage(eLang), bDeleted(sal_False)
     106           0 :     {}
     107             : 
     108           0 :     sal_Bool IsDeleted() const                          { return bDeleted; }
     109             :     void CheckChar( const SwPosition& rPos, sal_Unicode cChar );
     110             :     sal_Bool CheckDelChar( const SwPosition& rPos );
     111             : };
     112             : 
     113             : #endif
     114             : 
     115             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10