1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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>
28 class EDITENG_DLLPUBLIC SvxBaseAutoCorrCfg
: public utl::ConfigItem
31 SvxAutoCorrCfg
& rParent
;
32 static css::uno::Sequence
<OUString
> GetPropertyNames();
34 virtual void ImplCommit() override
;
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
48 SvxAutoCorrCfg
& rParent
;
49 static css::uno::Sequence
<OUString
> GetPropertyNames();
51 virtual void ImplCommit() override
;
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:
77 // Help tip for Autotext as you type
79 bool bAutoTextPreview
;
81 bool bSearchInAllCategories
;
86 aBaseConfig
.SetModified();
87 aSwConfig
.SetModified();
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
;}
116 static SvxAutoCorrCfg
& Get();
122 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */