LCOV - code coverage report
Current view: top level - include/editeng - acorrcfg.hxx (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 2 20 10.0 %
Date: 2014-04-11 Functions: 2 14 14.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_EDITENG_ACORRCFG_HXX
      20             : #define INCLUDED_EDITENG_ACORRCFG_HXX
      21             : 
      22             : #include <editeng/editengdllapi.h>
      23             : #include <unotools/configitem.hxx>
      24             : 
      25             : class SvxAutoCorrect;
      26             : class SvxAutoCorrCfg;
      27             : class EDITENG_DLLPUBLIC SvxBaseAutoCorrCfg : public utl::ConfigItem
      28             : {
      29             :     SvxAutoCorrCfg& rParent;
      30             :     com::sun::star::uno::Sequence<OUString>    GetPropertyNames();
      31             : 
      32             : public:
      33             :     SvxBaseAutoCorrCfg(SvxAutoCorrCfg& rParent);
      34             :     virtual ~SvxBaseAutoCorrCfg();
      35             : 
      36             :     void                    Load(bool bInit);
      37             :     virtual void            Commit() SAL_OVERRIDE;
      38             :     virtual void            Notify( const com::sun::star::uno::Sequence<OUString>& aPropertyNames) SAL_OVERRIDE;
      39           0 :     void                    SetModified() {ConfigItem::SetModified();}
      40             : };
      41             : 
      42             : class EDITENG_DLLPUBLIC SvxSwAutoCorrCfg : public utl::ConfigItem
      43             : {
      44             :     SvxAutoCorrCfg& rParent;
      45             :     com::sun::star::uno::Sequence<OUString>    GetPropertyNames();
      46             : 
      47             : public:
      48             :     SvxSwAutoCorrCfg(SvxAutoCorrCfg& rParent);
      49             :     virtual ~SvxSwAutoCorrCfg();
      50             : 
      51             :     void                    Load(bool bInit);
      52             :     virtual void            Commit() SAL_OVERRIDE;
      53             :     virtual void            Notify( const com::sun::star::uno::Sequence<OUString>& aPropertyNames) SAL_OVERRIDE;
      54           0 :     void                    SetModified() {ConfigItem::SetModified();}
      55             : };
      56             : /*--------------------------------------------------------------------
      57             :     Description:   Configuration for Auto Correction
      58             :  --------------------------------------------------------------------*/
      59             : class EDITENG_DLLPUBLIC SvxAutoCorrCfg
      60             : {
      61             :     friend class SvxBaseAutoCorrCfg;
      62             :     friend class SvxSwAutoCorrCfg;
      63             : 
      64             :     SvxAutoCorrect* pAutoCorrect;
      65             : 
      66             :     SvxBaseAutoCorrCfg      aBaseConfig;
      67             :     SvxSwAutoCorrCfg        aSwConfig;
      68             : 
      69             :     // Flags for Autotext:
      70             :     bool    bFileRel;
      71             :     bool    bNetRel;
      72             :     // Help tip for Autotext as you type
      73             :     bool    bAutoTextTip;
      74             :     bool    bAutoTextPreview;
      75             :     bool    bAutoFmtByInput;
      76             :     bool    bSearchInAllCategories;
      77             : 
      78             : public:
      79           0 :     void        SetModified()
      80             :                 {
      81           0 :                     aBaseConfig.SetModified();
      82           0 :                     aSwConfig.SetModified();
      83           0 :                 }
      84           0 :     void        Commit()
      85             :                 {
      86           0 :                     aBaseConfig.Commit();
      87           0 :                     aSwConfig.Commit();
      88           0 :                 }
      89             : 
      90        3997 :           SvxAutoCorrect* GetAutoCorrect()          { return pAutoCorrect; }
      91             :     const SvxAutoCorrect* GetAutoCorrect() const    { return pAutoCorrect; }
      92             :     // the pointer is transferred to the possession of the ConfigItems!
      93             :     void SetAutoCorrect( SvxAutoCorrect* );
      94             : 
      95           0 :     bool IsAutoFmtByInput() const       { return bAutoFmtByInput; }
      96           0 :     void SetAutoFmtByInput( bool bSet ) { bAutoFmtByInput = bSet;aSwConfig.SetModified();}
      97             : 
      98           7 :     bool IsSaveRelFile() const          { return bFileRel; }
      99           0 :     void SetSaveRelFile( bool bSet )    { bFileRel = bSet; aSwConfig.SetModified(); }
     100             : 
     101           0 :     bool IsSaveRelNet() const           { return bNetRel; }
     102           0 :     void SetSaveRelNet( bool bSet )     { bNetRel = bSet; aSwConfig.SetModified();}
     103             : 
     104             :     bool IsAutoTextPreview() const {return bAutoTextPreview;}
     105             :     void SetAutoTextPreview(bool bSet) {bAutoTextPreview = bSet; aSwConfig.SetModified();}
     106             : 
     107           0 :     bool IsAutoTextTip() const          { return bAutoTextTip; }
     108           0 :     void SetAutoTextTip(bool bSet )     { bAutoTextTip = bSet;aSwConfig.SetModified();}
     109             : 
     110           0 :     bool IsSearchInAllCategories() const        { return bSearchInAllCategories;}
     111             :     void SetSearchInAllCategories(bool bSet )   { bSearchInAllCategories = bSet; aSwConfig.SetModified(); }
     112             : 
     113             :     SvxAutoCorrCfg();
     114             :     virtual ~SvxAutoCorrCfg();
     115             :     static SvxAutoCorrCfg& Get();
     116             : };
     117             : 
     118             : 
     119             : #endif
     120             : 
     121             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10