Version 5.4.3.2, tag libreoffice-5.4.3.2
[LibreOffice.git] / include / editeng / acorrcfg.hxx
blob8a79f0cb7262909ee518a041e59cd332aa5f9440
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef INCLUDED_EDITENG_ACORRCFG_HXX
20 #define INCLUDED_EDITENG_ACORRCFG_HXX
22 #include <editeng/editengdllapi.h>
23 #include <unotools/configitem.hxx>
24 #include <memory>
26 class SvxAutoCorrect;
27 class SvxAutoCorrCfg;
28 class EDITENG_DLLPUBLIC SvxBaseAutoCorrCfg : public utl::ConfigItem
30 private:
31 SvxAutoCorrCfg& rParent;
32 static css::uno::Sequence<OUString> GetPropertyNames();
34 virtual void ImplCommit() override;
36 public:
37 SvxBaseAutoCorrCfg(SvxAutoCorrCfg& rParent);
38 virtual ~SvxBaseAutoCorrCfg() override;
40 void Load(bool bInit);
41 virtual void Notify( const css::uno::Sequence<OUString>& aPropertyNames) override;
42 using ConfigItem::SetModified;
45 class EDITENG_DLLPUBLIC SvxSwAutoCorrCfg : public utl::ConfigItem
47 private:
48 SvxAutoCorrCfg& rParent;
49 static css::uno::Sequence<OUString> GetPropertyNames();
51 virtual void ImplCommit() override;
53 public:
54 SvxSwAutoCorrCfg(SvxAutoCorrCfg& rParent);
55 virtual ~SvxSwAutoCorrCfg() override;
57 void Load(bool bInit);
58 virtual void Notify( const css::uno::Sequence<OUString>& aPropertyNames) override;
59 using ConfigItem::SetModified;
61 /*--------------------------------------------------------------------
62 Description: Configuration for Auto Correction
63 --------------------------------------------------------------------*/
64 class EDITENG_DLLPUBLIC SvxAutoCorrCfg final
66 friend class SvxBaseAutoCorrCfg;
67 friend class SvxSwAutoCorrCfg;
69 std::unique_ptr<SvxAutoCorrect> pAutoCorrect;
71 SvxBaseAutoCorrCfg aBaseConfig;
72 SvxSwAutoCorrCfg aSwConfig;
74 // Flags for Autotext:
75 bool bFileRel;
76 bool bNetRel;
77 // Help tip for Autotext as you type
78 bool bAutoTextTip;
79 bool bAutoTextPreview;
80 bool bAutoFmtByInput;
81 bool bSearchInAllCategories;
83 public:
84 void SetModified()
86 aBaseConfig.SetModified();
87 aSwConfig.SetModified();
89 void Commit()
91 aBaseConfig.Commit();
92 aSwConfig.Commit();
95 SvxAutoCorrect* GetAutoCorrect() { return pAutoCorrect.get(); }
96 const SvxAutoCorrect* GetAutoCorrect() const { return pAutoCorrect.get(); }
97 // the pointer is transferred to the possession of the ConfigItems!
98 void SetAutoCorrect( SvxAutoCorrect* );
100 bool IsAutoFormatByInput() const { return bAutoFmtByInput; }
101 void SetAutoFormatByInput( bool bSet ) { bAutoFmtByInput = bSet;aSwConfig.SetModified();}
103 bool IsSaveRelFile() const { return bFileRel; }
104 void SetSaveRelFile( bool bSet ) { bFileRel = bSet; aSwConfig.SetModified(); }
106 bool IsSaveRelNet() const { return bNetRel; }
107 void SetSaveRelNet( bool bSet ) { bNetRel = bSet; aSwConfig.SetModified();}
109 bool IsAutoTextTip() const { return bAutoTextTip; }
110 void SetAutoTextTip(bool bSet ) { bAutoTextTip = bSet;aSwConfig.SetModified();}
112 bool IsSearchInAllCategories() const { return bSearchInAllCategories;}
114 SvxAutoCorrCfg();
115 ~SvxAutoCorrCfg();
116 static SvxAutoCorrCfg& Get();
120 #endif
122 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */