nss: upgrade to release 3.73
[LibreOffice.git] / include / editeng / editstat.hxx
blobe230078992675e414ba8861c2088767d347adde9
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_EDITSTAT_HXX
21 #define INCLUDED_EDITENG_EDITSTAT_HXX
23 #include <rtl/ustring.hxx>
24 #include <o3tl/typed_flags_set.hxx>
26 enum class EEControlBits
28 NONE = 0x00000000,
29 USECHARATTRIBS = 0x00000001, // Use of hard character attributes
30 DOIDLEFORMAT = 0x00000008, // Formatting idle
31 PASTESPECIAL = 0x00000010, // Allow PasteSpecial
32 AUTOINDENTING = 0x00000020, // Automatic indenting
33 UNDOATTRIBS = 0x00000040, // Undo for Attributes...
34 ONECHARPERLINE = 0x00000080, // One character per line
35 NOCOLORS = 0x00000100, // Engine: No Color
36 OUTLINER = 0x00000200, // Special treatment Outliner/Outline mode
37 OUTLINER2 = 0x00000400, // Special treatment Outliner/Page
38 ALLOWBIGOBJS = 0x00000800, // Portion info in text object
39 ONLINESPELLING = 0x00001000, // During the edit Spelling
40 STRETCHING = 0x00002000, // Stretch mode
41 MARKNONURLFIELDS = 0x00004000, // Mark fields other than URL with color
42 MARKURLFIELDS = 0x00008000, // Mark URL fields with color
43 MARKFIELDS = (MARKNONURLFIELDS | MARKURLFIELDS),
44 RTFSTYLESHEETS = 0x00020000, // Use Stylesheets when imported
45 AUTOCORRECT = 0x00080000, // AutoCorrect
46 AUTOCOMPLETE = 0x00100000, // AutoComplete
47 AUTOPAGESIZEX = 0x00200000, // Adjust paper width to Text
48 AUTOPAGESIZEY = 0x00400000, // Adjust paper height to Text
49 AUTOPAGESIZE = (AUTOPAGESIZEX | AUTOPAGESIZEY),
50 FORMAT100 = 0x01000000, // Always format to 100%
51 ULSPACESUMMATION = 0x02000000, // MS Compat: sum SA and SB, not maximum value
53 namespace o3tl
55 template<> struct typed_flags<EEControlBits> : is_typed_flags<EEControlBits, 0x037afff9> {};
58 enum class EVControlBits
60 AUTOSCROLL = 0x0001, // Auto scrolling horizontally
61 ENABLEPASTE = 0x0004, // Enable Paste
62 SINGLELINEPASTE = 0x0008, // View: Paste in input line ...
63 OVERWRITE = 0x0010, // Overwrite mode
64 INVONEMORE = 0x0020, // Invalidate one pixel more
65 AUTOSIZEX = 0x0040, // Automatically adapt to text width
66 AUTOSIZEY = 0x0080, // Automatically adapt to Text width
67 AUTOSIZE = (AUTOSIZEX|AUTOSIZEY)
69 namespace o3tl
71 template<> struct typed_flags<EVControlBits> : is_typed_flags<EVControlBits, 0xfd> {};
74 enum class EditStatusFlags
76 NONE = 0x0000,
77 HSCROLL = 0x0001,
78 VSCROLL = 0x0002,
79 CURSOROUT = 0x0004,
80 TEXTWIDTHCHANGED = 0x0010,
81 TextHeightChanged = 0x0020,
82 WRONGWORDCHANGED = 0x0040
84 namespace o3tl
86 template<> struct typed_flags<EditStatusFlags> : is_typed_flags<EditStatusFlags, 0x77> {};
89 inline void SetFlags( EVControlBits& rBits, EVControlBits nMask, bool bOn )
91 if ( bOn )
92 rBits |= nMask;
93 else
94 rBits &= ~nMask;
97 class EditStatus
99 protected:
100 EditStatusFlags nStatusBits;
101 EEControlBits nControlBits;
103 public:
104 EditStatus() { nStatusBits = EditStatusFlags::NONE; nControlBits = EEControlBits::NONE; }
106 void Clear() { nStatusBits = EditStatusFlags::NONE; }
108 EditStatusFlags GetStatusWord() const { return nStatusBits; }
109 EditStatusFlags& GetStatusWord() { return nStatusBits; }
111 EEControlBits& GetControlWord() { return nControlBits; }
114 enum class SpellCallbackCommand
116 IGNOREWORD = 0x0001,
117 STARTSPELLDLG = 0x0002,
118 ADDTODICTIONARY = 0x0003,
119 WORDLANGUAGE = 0x0004,
120 PARALANGUAGE = 0x0005,
121 AUTOCORRECT_OPTIONS = 0x0006,
124 struct SpellCallbackInfo
126 SpellCallbackCommand nCommand;
127 OUString aWord;
129 SpellCallbackInfo( SpellCallbackCommand nCMD, const OUString& rWord )
130 : aWord( rWord )
132 nCommand = nCMD;
135 SpellCallbackInfo( SpellCallbackCommand nCMD )
137 nCommand = nCMD;
141 #endif // INCLUDED_EDITENG_EDITSTAT_HXX
143 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */