xref: /aoo4110/main/editeng/inc/editeng/editstat.hxx (revision b1cdbd2c)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _EDITSTAT_HXX
25 #define _EDITSTAT_HXX
26 
27 #include <tools/string.hxx>
28 #include <i18npool/lang.h>
29 
30 #define EE_CNTRL_USECHARATTRIBS		0x00000001	// Verwendung harter ZeichenAttr.
31 #define EE_CNTRL_USEPARAATTRIBS		0x00000002	// Verwendung von AbsatzAttr.
32 #define EE_CNTRL_CRSRLEFTPARA		0x00000004	// Cursor ist in einen anderen Absatz gewandert
33 #define EE_CNTRL_DOIDLEFORMAT		0x00000008	// Idle-Formatierung
34 #define EE_CNTRL_PASTESPECIAL		0x00000010	// Allow PasteSpecial
35 #define EE_CNTRL_AUTOINDENTING		0x00000020	// Automatisches einruecken
36 #define EE_CNTRL_UNDOATTRIBS		0x00000040	// Undo fuer Attribute....
37 #define EE_CNTRL_ONECHARPERLINE		0x00000080	// Ein Zeichen pro Zeile
38 #define EE_CNTRL_NOCOLORS			0x00000100	// Engine: Keine Farben
39 #define EE_CNTRL_OUTLINER			0x00000200	// Sonderbehandlung Outliner/Gliederungsmodus
40 #define EE_CNTRL_OUTLINER2			0x00000400	// Sonderbehandlung Outliner/Seite
41 #define EE_CNTRL_ALLOWBIGOBJS		0x00000800	// PortionInfo in Textobjekten
42 #define EE_CNTRL_ONLINESPELLING		0x00001000	// Waehrend des editieren Spelling
43 #define EE_CNTRL_STRETCHING			0x00002000	// Stretch-Modus
44 #define EE_CNTRL_MARKFIELDS			0x00004000	// Felder farblich hinterlegen
45 #define EE_CNTRL_URLSFXEXECUTE		0x00008000	// !!!OLD!!!: SFX-URL-Execute.
46 #define EE_CNTRL_RESTOREFONT		0x00010000	// Font im OutDev restaurieren
47 #define EE_CNTRL_RTFSTYLESHEETS		0x00020000	// Stylesheets bei Import verwenden
48 //#define EE_CNTRL_NOREDLINES            0x00040000  // Keine RedLines bei OnlineSpellError     /* removed #i91949 */
49 #define EE_CNTRL_AUTOCORRECT		0x00080000	// AutoKorrektur
50 #define EE_CNTRL_AUTOCOMPLETE		0x00100000	// AutoComplete
51 #define EE_CNTRL_AUTOPAGESIZEX		0x00200000	// Papierbreite an Text anpassen
52 #define EE_CNTRL_AUTOPAGESIZEY		0x00400000	// Papierhoehe an Text anpassen
53 #define EE_CNTRL_AUTOPAGESIZE		(EE_CNTRL_AUTOPAGESIZEX|EE_CNTRL_AUTOPAGESIZEY)
54 #define EE_CNTRL_TABINDENTING		0x00800000	// Einruecken mit Tab
55 #define EE_CNTRL_FORMAT100			0x01000000	// Immer nach 100% formatieren
56 #define EE_CNTRL_ULSPACESUMMATION	0x02000000	// MS Compat: SA und SB aufsummieren, nicht maximalwert
57 #define EE_CNTRL_ULSPACEFIRSTPARA	0x04000000	// MS Compat: SB auch beim ersten Absatz auswerten
58 
59 #define EV_CNTRL_AUTOSCROLL			0x00000001	// Autom. Scrollen horiz.
60 #define EV_CNTRL_BIGSCROLL			0x00000002	// Weiter Scrollen, als nur zum Cursor
61 #define EV_CNTRL_ENABLEPASTE		0x00000004	// Paste erlauben
62 #define EV_CNTRL_SINGLELINEPASTE	0x00000008	// View: Paste in Eingabezeile...
63 #define EV_CNTRL_OVERWRITE			0x00000010	// Ueberschreibmodus
64 #define EV_CNTRL_INVONEMORE			0x00000020	// Ein Pixel mehr invalidieren
65 #define EV_CNTRL_AUTOSIZEX			0x00000040	// Automatisch an Textbreite anpassen
66 #define EV_CNTRL_AUTOSIZEY			0x00000080	// Automatisch an Texthoehe anpassen
67 #define EV_CNTRL_AUTOSIZE			(EV_CNTRL_AUTOSIZEX|EV_CNTRL_AUTOSIZEY)
68 
69 #define EE_STAT_HSCROLL				0x00000001
70 #define EE_STAT_VSCROLL				0x00000002
71 #define EE_STAT_CURSOROUT			0x00000004
72 #define EE_STAT_CRSRMOVEFAIL		0x00000008
73 #define EE_STAT_CRSRLEFTPARA		0x00000010
74 #define EE_STAT_TEXTWIDTHCHANGED	0x00000020
75 #define EE_STAT_TEXTHEIGHTCHANGED	0x00000040
76 #define EE_STAT_WRONGWORDCHANGED	0x00000080
77 // #define EE_STAT_MODIFIED			0x00000100
78 
79 // Nur fuer Update:
80 #define EE_CNTRL_AUTOCENTER		EE_CNTRL_AUTOPAGESIZE
81 #define EE_STAT_GROWY			EE_STAT_TEXTHEIGHTCHANGED
82 
83 /*
84 	EE_STAT_CRSRLEFTPARA zur Zeit bei Cursorbewegungen und Return.
85 */
86 
SetFlags(sal_uLong & rBits,const sal_uInt32 nMask,sal_Bool bOn)87 inline void SetFlags( sal_uLong& rBits, const sal_uInt32 nMask, sal_Bool bOn )
88 {
89 	if ( bOn )
90 		rBits |= nMask;
91 	else
92 		rBits &= ~nMask;
93 }
94 
95 class EditStatus
96 {
97 protected:
98 	sal_uLong	nStatusBits;
99 	sal_uLong	nControlBits;
100 	sal_uInt16	nPrevPara;					// fuer EE_STAT_CRSRLEFTPARA
101 
102 public:
EditStatus()103 			EditStatus()				{ nStatusBits = 0; nControlBits = 0; nPrevPara = 0xFFFF; }
104 
Clear()105 	void	Clear() 					{ nStatusBits = 0; }
SetControlBits(sal_uLong nMask,sal_Bool bOn)106 	void	SetControlBits( sal_uLong nMask, sal_Bool bOn )
107 				{ SetFlags( nControlBits, nMask, bOn ); }
108 
GetStatusWord() const109 	sal_uLong	GetStatusWord() const		{ return nStatusBits; }
GetStatusWord()110 	sal_uLong&	GetStatusWord() 			{ return nStatusBits; }
111 
GetControlWord() const112 	sal_uLong	GetControlWord() const		{ return nControlBits; }
GetControlWord()113 	sal_uLong&	GetControlWord() 			{ return nControlBits; }
114 
GetPrevParagraph() const115 	sal_uInt16	GetPrevParagraph() const	{ return nPrevPara; }
GetPrevParagraph()116 	sal_uInt16&	GetPrevParagraph() 			{ return nPrevPara; }
117 };
118 
119 #define SPELLCMD_IGNOREWORD			0x0001
120 #define SPELLCMD_STARTSPELLDLG		0x0002
121 #define SPELLCMD_ADDTODICTIONARY	0x0003
122 #define SPELLCMD_WORDLANGUAGE   	0x0004
123 #define SPELLCMD_PARALANGUAGE	    0x0005
124 
125 struct SpellCallbackInfo
126 {
127 	sal_uInt16		    nCommand;
128 	String		    aWord;
129     LanguageType    eLanguage;
130 
SpellCallbackInfoSpellCallbackInfo131 	SpellCallbackInfo( sal_uInt16 nCMD, const String& rWord )
132 	: aWord( rWord )
133 	{
134 		nCommand = nCMD;
135         eLanguage = LANGUAGE_DONTKNOW;
136 	}
137 
SpellCallbackInfoSpellCallbackInfo138     SpellCallbackInfo( sal_uInt16 nCMD, LanguageType eLang )
139 	{
140 		nCommand = nCMD;
141         eLanguage = eLang;
142 	}
143 };
144 
145 #endif // _EDITSTAT_HXX
146 
147