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 .
20 #ifndef INCLUDED_EDITENG_SWAFOPT_HXX
21 #define INCLUDED_EDITENG_SWAFOPT_HXX
23 #include <sal/config.h>
25 #include <editeng/editengdllapi.h>
26 #include <o3tl/sorted_vector.hxx>
27 #include <rtl/ustring.hxx>
28 #include <vcl/font.hxx>
29 #include <vcl/vclenum.hxx>
35 class EDITENG_DLLPUBLIC IAutoCompleteString
40 explicit IAutoCompleteString(OUString
const& rString
) : m_String(rString
) {}
41 virtual ~IAutoCompleteString() {}
42 OUString
const& GetAutoCompleteString() const { return m_String
; }
45 struct CompareAutoCompleteString
47 bool operator()(IAutoCompleteString
*const& lhs
,
48 IAutoCompleteString
*const& rhs
) const
50 return lhs
->GetAutoCompleteString().compareToIgnoreAsciiCase(
51 rhs
->GetAutoCompleteString()) < 0;
55 class SortedAutoCompleteStrings
56 : public o3tl::sorted_vector
<IAutoCompleteString
*, CompareAutoCompleteString
>
60 SortedAutoCompleteStrings
& operator =(SortedAutoCompleteStrings
const &) = delete;
62 // For createNonOwningCopy only:
63 SortedAutoCompleteStrings(SortedAutoCompleteStrings
const & other
):
64 sorted_vector(other
), owning_(false) {}
67 SortedAutoCompleteStrings(): owning_(true) {}
69 ~SortedAutoCompleteStrings() { if (owning_
) DeleteAndDestroyAll(); }
71 SortedAutoCompleteStrings
createNonOwningCopy() const { return *this; }
74 } // namespace editeng
76 // Class of options for AutoFormat
77 struct EDITENG_DLLPUBLIC SvxSwAutoFormatFlags
79 vcl::Font aBulletFont
;
80 vcl::Font aByInputBulletFont
;
81 /// only valid inside the Dialog!!!
82 const editeng::SortedAutoCompleteStrings
* m_pAutoCompleteList
;
83 SmartTagMgr
* pSmartTagMgr
;
86 sal_UCS4 cByInputBullet
;
88 sal_uInt16 nAutoCmpltWordLen
, nAutoCmpltListLen
;
89 sal_uInt16 nAutoCmpltExpandKey
;
91 sal_uInt8 nRightMargin
;
93 bool bAutoCorrect
: 1;
94 bool bCapitalStartSentence
: 1;
95 bool bCapitalStartWord
: 1;
97 bool bChgUserColl
: 1;
100 bool bAFormatByInput
: 1;
101 bool bDelEmptyNode
: 1;
102 bool bSetNumRule
: 1;
104 bool bChgOrdinalNumber
: 1;
105 bool bChgToEnEmDash
: 1;
106 bool bAddNonBrkSpace
: 1;
107 bool bTransliterateRTL
: 1;
108 bool bChgAngleQuotes
: 1;
109 bool bChgWeightUnderl
: 1;
110 bool bSetINetAttr
: 1;
113 bool bCreateTable
: 1;
114 bool bReplaceStyles
: 1;
116 bool bWithRedlining
: 1;
118 bool bRightMargin
: 1;
120 bool bAutoCompleteWords
: 1;
121 bool bAutoCmpltCollectWords
: 1;
122 bool bAutoCmpltEndless
: 1;
123 // -- under NT here starts a new long
124 bool bAutoCmpltAppendBlanc
: 1;
125 bool bAutoCmpltShowAsTip
: 1;
127 bool bAFormatDelSpacesAtSttEnd
: 1;
128 bool bAFormatDelSpacesBetweenLines
: 1;
129 bool bAFormatByInpDelSpacesAtSttEnd
: 1;
130 bool bAFormatByInpDelSpacesBetweenLines
: 1;
132 bool bAutoCmpltKeepList
: 1;
134 SvxSwAutoFormatFlags();
139 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */