Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 :
20 : #ifndef INCLUDED_EDITENG_EDITSTAT_HXX
21 : #define INCLUDED_EDITENG_EDITSTAT_HXX
22 :
23 : #include <rtl/ustring.hxx>
24 : #include <tools/solar.h>
25 : #include <i18nlangtag/lang.h>
26 :
27 : #define EE_CNTRL_USECHARATTRIBS 0x00000001 // Use of hard character attributes
28 : #define EE_CNTRL_USEPARAATTRIBS 0x00000002 // Using paragraph attributes.
29 : #define EE_CNTRL_CRSRLEFTPARA 0x00000004 // Cursor is moved to another paragraph
30 : #define EE_CNTRL_DOIDLEFORMAT 0x00000008 // Formatting idle
31 : #define EE_CNTRL_PASTESPECIAL 0x00000010 // Allow PasteSpecial
32 : #define EE_CNTRL_AUTOINDENTING 0x00000020 // Automatic indenting
33 : #define EE_CNTRL_UNDOATTRIBS 0x00000040 // Undo for Attributes....
34 : #define EE_CNTRL_ONECHARPERLINE 0x00000080 // One character per line
35 : #define EE_CNTRL_NOCOLORS 0x00000100 // Engine: No Color
36 : #define EE_CNTRL_OUTLINER 0x00000200 // Special treatment Outliner/Outline mode
37 : #define EE_CNTRL_OUTLINER2 0x00000400 // Special treatment Outliner/Page
38 : #define EE_CNTRL_ALLOWBIGOBJS 0x00000800 // Portion info in text object
39 : #define EE_CNTRL_ONLINESPELLING 0x00001000 // During the edit Spelling
40 : #define EE_CNTRL_STRETCHING 0x00002000 // Stretch mode
41 : #define EE_CNTRL_MARKFIELDS 0x00004000 // Mark Fields with color
42 : #define EE_CNTRL_RESTOREFONT 0x00010000 // Restore Font in OutDev
43 : #define EE_CNTRL_RTFSTYLESHEETS 0x00020000 // Use Stylesheets when imported
44 : #define EE_CNTRL_AUTOCORRECT 0x00080000 // AutoCorrect
45 : #define EE_CNTRL_AUTOCOMPLETE 0x00100000 // AutoComplete
46 : #define EE_CNTRL_AUTOPAGESIZEX 0x00200000 // Adjust paper width to Text
47 : #define EE_CNTRL_AUTOPAGESIZEY 0x00400000 // Adjust paper height to Text
48 : #define EE_CNTRL_AUTOPAGESIZE (EE_CNTRL_AUTOPAGESIZEX|EE_CNTRL_AUTOPAGESIZEY)
49 : #define EE_CNTRL_TABINDENTING 0x00800000 // Indent with tab
50 : #define EE_CNTRL_FORMAT100 0x01000000 // Always format to 100%
51 : #define EE_CNTRL_ULSPACESUMMATION 0x02000000 // MS Compat: sum SA and SB, not maximum value
52 : #define EE_CNTRL_ULSPACEFIRSTPARA 0x04000000 // MS Compat: evaluate also at the first paragraph
53 :
54 : #define EV_CNTRL_AUTOSCROLL 0x00000001 // Auto scrolling horizontally
55 : #define EV_CNTRL_BIGSCROLL 0x00000002 // Scroll further to the cursor
56 : #define EV_CNTRL_ENABLEPASTE 0x00000004 // Enable Paste
57 : #define EV_CNTRL_SINGLELINEPASTE 0x00000008 // View: Paste in input line ...
58 : #define EV_CNTRL_OVERWRITE 0x00000010 // Overwrite mode
59 : #define EV_CNTRL_INVONEMORE 0x00000020 // Invalidate one pixel more
60 : #define EV_CNTRL_AUTOSIZEX 0x00000040 // Automatically adapt to text width
61 : #define EV_CNTRL_AUTOSIZEY 0x00000080 // Automatically adapt to Text width
62 : #define EV_CNTRL_AUTOSIZE (EV_CNTRL_AUTOSIZEX|EV_CNTRL_AUTOSIZEY)
63 :
64 : #define EE_STAT_HSCROLL 0x00000001
65 : #define EE_STAT_VSCROLL 0x00000002
66 : #define EE_STAT_CURSOROUT 0x00000004
67 : #define EE_STAT_CRSRMOVEFAIL 0x00000008
68 : #define EE_STAT_CRSRLEFTPARA 0x00000010
69 : #define EE_STAT_TEXTWIDTHCHANGED 0x00000020
70 : #define EE_STAT_TEXTHEIGHTCHANGED 0x00000040
71 : #define EE_STAT_WRONGWORDCHANGED 0x00000080
72 :
73 : /*
74 : EE_STAT_CRSRLEFTPARA at the time cursor movement and the enter.
75 : */
76 :
77 0 : inline void SetFlags( sal_uLong& rBits, const sal_uInt32 nMask, bool bOn )
78 : {
79 0 : if ( bOn )
80 0 : rBits |= nMask;
81 : else
82 0 : rBits &= ~nMask;
83 0 : }
84 :
85 : class EditStatus
86 : {
87 : protected:
88 : sal_uLong nStatusBits;
89 : sal_uLong nControlBits;
90 : sal_Int32 nPrevPara; // for EE_STAT_CRSRLEFTPARA
91 :
92 : public:
93 51673 : EditStatus() { nStatusBits = 0; nControlBits = 0; nPrevPara = -1; }
94 :
95 1136 : void Clear() { nStatusBits = 0; }
96 : void SetControlBits( sal_uLong nMask, bool bOn )
97 : { SetFlags( nControlBits, nMask, bOn ); }
98 :
99 0 : sal_uLong GetStatusWord() const { return nStatusBits; }
100 296470 : sal_uLong& GetStatusWord() { return nStatusBits; }
101 :
102 : sal_uLong GetControlWord() const { return nControlBits; }
103 2016213 : sal_uLong& GetControlWord() { return nControlBits; }
104 :
105 : sal_Int32 GetPrevParagraph() const { return nPrevPara; }
106 0 : sal_Int32& GetPrevParagraph() { return nPrevPara; }
107 : };
108 :
109 : #define SPELLCMD_IGNOREWORD 0x0001
110 : #define SPELLCMD_STARTSPELLDLG 0x0002
111 : #define SPELLCMD_ADDTODICTIONARY 0x0003
112 : #define SPELLCMD_WORDLANGUAGE 0x0004
113 : #define SPELLCMD_PARALANGUAGE 0x0005
114 :
115 0 : struct SpellCallbackInfo
116 : {
117 : sal_uInt16 nCommand;
118 : OUString aWord;
119 : LanguageType eLanguage;
120 :
121 0 : SpellCallbackInfo( sal_uInt16 nCMD, const OUString& rWord )
122 0 : : aWord( rWord )
123 : {
124 0 : nCommand = nCMD;
125 0 : eLanguage = LANGUAGE_DONTKNOW;
126 0 : }
127 :
128 0 : SpellCallbackInfo( sal_uInt16 nCMD, LanguageType eLang )
129 0 : {
130 0 : nCommand = nCMD;
131 0 : eLanguage = eLang;
132 0 : }
133 : };
134 :
135 : #endif // INCLUDED_EDITENG_EDITSTAT_HXX
136 :
137 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|