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