1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: acorrect.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
33 #include <svx/svxacorr.hxx>
44 class SwDontExpandItem
46 SfxItemSet
* pDontExpItems
;
52 void SaveDontExpandItems( const SwPosition
& rPos
);
53 void RestoreDontExpandItems( const SwPosition
& rPos
);
57 class SwAutoCorrDoc
: public SvxAutoCorrDoc
63 bool bUndoIdInitialized
;
65 void DeleteSel( SwPaM
& rDelPam
);
68 SwAutoCorrDoc( SwEditShell
& rEditShell
, SwPaM
& rPam
, sal_Unicode cIns
= 0 );
71 virtual BOOL
Delete( xub_StrLen nStt
, xub_StrLen nEnd
);
72 virtual BOOL
Insert( xub_StrLen nPos
, const String
& rTxt
);
73 virtual BOOL
Replace( xub_StrLen nPos
, const String
& rTxt
);
75 virtual BOOL
SetAttr( xub_StrLen nStt
, xub_StrLen nEnd
, USHORT nSlotId
,
78 virtual BOOL
SetINetAttr( xub_StrLen nStt
, xub_StrLen nEnd
, const String
& rURL
);
80 // returne den Text eines vorherigen Absatzes.
81 // Dieser darf nicht leer sein!
82 // Gibt es diesen nicht oder gibt es davor nur Leere, dann returne 0
84 // TRUE: den, vor der normalen Einfuegeposition (TRUE)
85 // FALSE: den, in den das korrigierte Wort eingfuegt wurde.
86 // (Muss nicht der gleiche Absatz sein!!!!)
87 virtual const String
* GetPrevPara( BOOL bAtNormalPos
);
89 virtual BOOL
ChgAutoCorrWord( xub_StrLen
& rSttPos
, xub_StrLen nEndPos
,
90 SvxAutoCorrect
& rACorrect
,
91 const String
** ppPara
);
93 // wird nach dem austauschen der Zeichen von den Funktionen
96 // gerufen. Dann koennen die Worte ggfs. in die Ausnahmelisten
97 // aufgenommen werden.
98 virtual void SaveCpltSttWord( ULONG nFlag
, xub_StrLen nPos
,
99 const String
& rExceptWord
, sal_Unicode cChar
);
100 virtual LanguageType
GetLanguage( xub_StrLen nPos
, BOOL bPrevPara
) const;
103 class SwAutoCorrExceptWord
109 LanguageType eLanguage
;
112 SwAutoCorrExceptWord( ULONG nAFlags
, ULONG nNd
, xub_StrLen nContent
,
113 const String
& rWord
, sal_Unicode cChr
,
115 : sWord(rWord
), nFlags(nAFlags
), nNode(nNd
), nCntnt(nContent
),
116 cChar(cChr
), eLanguage(eLang
), bDeleted(FALSE
)
119 BOOL
IsDeleted() const { return bDeleted
; }
120 void CheckChar( const SwPosition
& rPos
, sal_Unicode cChar
);
121 BOOL
CheckDelChar( const SwPosition
& rPos
);