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_EDITSTAT_HXX
21 #define INCLUDED_EDITENG_EDITSTAT_HXX
23 #include <rtl/ustring.hxx>
24 #include <o3tl/typed_flags_set.hxx>
27 enum class EEControlBits
30 USECHARATTRIBS
= 0x00000001, // Use of hard character attributes
31 DOIDLEFORMAT
= 0x00000008, // Formatting idle
32 PASTESPECIAL
= 0x00000010, // Allow PasteSpecial
33 AUTOINDENTING
= 0x00000020, // Automatic indenting
34 UNDOATTRIBS
= 0x00000040, // Undo for Attributes...
35 ONECHARPERLINE
= 0x00000080, // One character per line (used in calc)
36 NOCOLORS
= 0x00000100, // Engine: No Color
37 OUTLINER
= 0x00000200, // Special treatment Outliner/Outline mode
38 OUTLINER2
= 0x00000400, // Special treatment Outliner/Page
39 ALLOWBIGOBJS
= 0x00000800, // Portion info in text object
40 ONLINESPELLING
= 0x00001000, // During the edit Spelling
41 STRETCHING
= 0x00002000, // Stretch mode
42 MARKNONURLFIELDS
= 0x00004000, // Mark fields other than URL with color
43 MARKURLFIELDS
= 0x00008000, // Mark URL fields with color
44 MARKFIELDS
= (MARKNONURLFIELDS
| MARKURLFIELDS
),
45 RTFSTYLESHEETS
= 0x00020000, // Use Stylesheets when imported
46 AUTOCORRECT
= 0x00080000, // AutoCorrect
47 AUTOCOMPLETE
= 0x00100000, // AutoComplete
48 AUTOPAGESIZEX
= 0x00200000, // Adjust paper width to Text
49 AUTOPAGESIZEY
= 0x00400000, // Adjust paper height to Text
50 AUTOPAGESIZE
= (AUTOPAGESIZEX
| AUTOPAGESIZEY
),
51 ULSPACESUMMATION
= 0x01000000, // MS Compat: sum SA and SB, not maximum value
52 SINGLELINE
= 0x02000000, // One line for all text
53 STACKED
= 0x04000000, // Same as ONECHARPERLINE (used in impress)
57 template<> struct typed_flags
<EEControlBits
> : is_typed_flags
<EEControlBits
, 0x07ffffff> {};
60 enum class EVControlBits
62 AUTOSCROLL
= 0x0001, // Auto scrolling horizontally
63 ENABLEPASTE
= 0x0004, // Enable Paste
64 SINGLELINEPASTE
= 0x0008, // View: Paste in input line ...
65 OVERWRITE
= 0x0010, // Overwrite mode
66 INVONEMORE
= 0x0020, // Invalidate one pixel more
67 AUTOSIZEX
= 0x0040, // Automatically adapt to text width
68 AUTOSIZEY
= 0x0080, // Automatically adapt to Text width
69 AUTOSIZE
= (AUTOSIZEX
|AUTOSIZEY
)
73 template<> struct typed_flags
<EVControlBits
> : is_typed_flags
<EVControlBits
, 0xfd> {};
76 enum class EditStatusFlags
82 TEXTWIDTHCHANGED
= 0x0010,
83 TextHeightChanged
= 0x0020,
84 WRONGWORDCHANGED
= 0x0040
88 template<> struct typed_flags
<EditStatusFlags
> : is_typed_flags
<EditStatusFlags
, 0x77> {};
91 inline void SetFlags( EVControlBits
& rBits
, EVControlBits nMask
, bool bOn
)
102 EditStatusFlags nStatusBits
;
103 EEControlBits nControlBits
;
106 EditStatus() { nStatusBits
= EditStatusFlags::NONE
; nControlBits
= EEControlBits::NONE
; }
108 void Clear() { nStatusBits
= EditStatusFlags::NONE
; }
110 EditStatusFlags
GetStatusWord() const { return nStatusBits
; }
111 EditStatusFlags
& GetStatusWord() { return nStatusBits
; }
113 EEControlBits
& GetControlWord() { return nControlBits
; }
116 enum class SpellCallbackCommand
119 STARTSPELLDLG
= 0x0002,
120 ADDTODICTIONARY
= 0x0003,
121 WORDLANGUAGE
= 0x0004,
122 PARALANGUAGE
= 0x0005,
123 AUTOCORRECT_OPTIONS
= 0x0006,
126 struct SpellCallbackInfo
128 SpellCallbackCommand nCommand
;
131 SpellCallbackInfo( SpellCallbackCommand nCMD
, OUString _aWord
)
132 : aWord(std::move( _aWord
))
137 SpellCallbackInfo( SpellCallbackCommand nCMD
)
143 #endif // INCLUDED_EDITENG_EDITSTAT_HXX
145 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */