Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / include / editeng / swafopt.hxx
blob71919383da96e3a5c21933710f4ea21df68ac395
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 .
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 <utility>
29 #include <vcl/font.hxx>
30 #include <vcl/vclenum.hxx>
32 class SmartTagMgr;
34 namespace editeng {
36 class EDITENG_DLLPUBLIC IAutoCompleteString
38 private:
39 OUString m_String;
40 public:
41 explicit IAutoCompleteString(OUString aString) : m_String(std::move(aString)) {}
42 virtual ~IAutoCompleteString() {}
43 OUString const& GetAutoCompleteString() const { return m_String; }
46 struct CompareAutoCompleteString
48 bool operator()(IAutoCompleteString *const& lhs,
49 IAutoCompleteString *const& rhs) const
51 return lhs->GetAutoCompleteString().compareToIgnoreAsciiCase(
52 rhs->GetAutoCompleteString()) < 0;
56 class SortedAutoCompleteStrings
57 : public o3tl::sorted_vector<IAutoCompleteString*, CompareAutoCompleteString>
59 bool owning_;
61 SortedAutoCompleteStrings& operator =(SortedAutoCompleteStrings const &) = delete;
63 // For createNonOwningCopy only:
64 SortedAutoCompleteStrings(SortedAutoCompleteStrings const & other):
65 sorted_vector(other), owning_(false) {}
67 public:
68 SortedAutoCompleteStrings(): owning_(true) {}
70 ~SortedAutoCompleteStrings() { if (owning_) DeleteAndDestroyAll(); }
72 SortedAutoCompleteStrings createNonOwningCopy() const { return *this; }
75 } // namespace editeng
77 // Class of options for AutoFormat
78 struct EDITENG_DLLPUBLIC SvxSwAutoFormatFlags
80 vcl::Font aBulletFont;
81 vcl::Font aByInputBulletFont;
82 /// only valid inside the Dialog!!!
83 const editeng::SortedAutoCompleteStrings * m_pAutoCompleteList;
84 SmartTagMgr* pSmartTagMgr;
86 sal_UCS4 cBullet;
87 sal_UCS4 cByInputBullet;
89 sal_uInt16 nAutoCmpltWordLen, nAutoCmpltListLen;
90 sal_uInt16 nAutoCmpltExpandKey;
92 sal_uInt8 nRightMargin;
94 bool bAutoCorrect : 1;
95 bool bCapitalStartSentence : 1;
96 bool bCapitalStartWord : 1;
98 bool bChgUserColl : 1;
99 bool bChgEnumNum : 1;
101 bool bAFormatByInput : 1;
102 bool bDelEmptyNode : 1;
103 bool bSetNumRule : 1;
105 bool bChgOrdinalNumber : 1;
106 bool bChgToEnEmDash : 1;
107 bool bAddNonBrkSpace : 1;
108 bool bTransliterateRTL : 1;
109 bool bChgAngleQuotes : 1;
110 bool bChgWeightUnderl : 1;
111 bool bSetINetAttr : 1;
112 bool bSetDOIAttr : 1;
114 bool bSetBorder : 1;
115 bool bCreateTable : 1;
116 bool bReplaceStyles : 1;
118 bool bWithRedlining : 1;
120 bool bRightMargin : 1;
122 bool bAutoCompleteWords : 1;
123 bool bAutoCmpltCollectWords : 1;
124 bool bAutoCmpltEndless : 1;
125 // -- under NT here starts a new long
126 bool bAutoCmpltAppendBlank : 1;
127 bool bAutoCmpltShowAsTip : 1;
129 bool bAFormatDelSpacesAtSttEnd : 1;
130 bool bAFormatDelSpacesBetweenLines : 1;
131 bool bAFormatByInpDelSpacesAtSttEnd : 1;
132 bool bAFormatByInpDelSpacesBetweenLines : 1;
134 bool bAutoCmpltKeepList : 1;
136 SvxSwAutoFormatFlags();
139 #endif
141 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */