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

Generated by: LCOV version 1.11