/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ #ifndef INCLUDED_EDITENG_SPLWRAP_HXX #define INCLUDED_EDITENG_SPLWRAP_HXX #include #include #include #include #include // forward --------------------------------------------------------------- namespace com { namespace sun { namespace star { namespace linguistic2 { class XDictionary; class XSpellChecker1; class XHyphenator; }}}} namespace vcl { class Window; } class SdrObject; // misc functions --------------------------------------------------------------- void EDITENG_DLLPUBLIC SvxPrepareAutoCorrect( OUString &rOldText, const OUString &rNewText ); /*-------------------------------------------------------------------- Description: The SpellWrapper --------------------------------------------------------------------*/ class EDITENG_DLLPUBLIC SvxSpellWrapper { private: friend class SvxSpellCheckDialog; friend class SvxHyphenWordDialog; friend struct SvxHyphenWordDialog_Impl; VclPtr pWin; ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xLast; // result of last spelling/hyphenation attempt ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XSpellChecker1 > xSpell; ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XHyphenator > xHyph; SdrObject* mpTextObj; bool bOtherCntnt : 1; // set => Check special sections initially bool bDialog : 1; // Is pWin the Svx...Dialog? bool bHyphen : 1; // Split instead of spell checking bool bAuto : 1; // AutoCorrect available? bool bReverse : 1; // Reverse spell check bool bStartDone : 1; // Beginning already corrected bool bEndDone : 1; // End part already corrected bool bStartChk : 1; // Examine the beginning bool bRevAllowed : 1; // Reverse spell check prohibited bool bAllRight : 1; // Record wrong words in the dedicated // dictionary and do not start the dialog. EDITENG_DLLPRIVATE bool SpellNext(); // select next area bool FindSpellError(); // Check for errors (over areas) public: SvxSpellWrapper( vcl::Window* pWn, ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XSpellChecker1 > &xSpellChecker, const bool bStart = false, const bool bIsAllRight = false, const bool bOther = false, const bool bRevAllow = true ); SvxSpellWrapper( vcl::Window* pWn, ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XHyphenator > &xHyphenator, const bool bStart = false, const bool bOther = false ); virtual ~SvxSpellWrapper(); static sal_Int16 CheckSpellLang( ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XSpellChecker1 > xSpell, sal_Int16 nLang ); static sal_Int16 CheckHyphLang( ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XHyphenator > xHyph, sal_Int16 nLang ); static void ShowLanguageErrors(); void SpellDocument(); // Perform Spell Checking inline bool IsStartDone(){ return bStartDone; } inline bool IsEndDone(){ return bEndDone; } inline bool IsReverse(){ return bReverse; } inline bool IsDialog(){ return bDialog; } // SvxSpellCheckDialog OnScreen inline bool IsHyphen(){ return bHyphen; } // Split instead of Spell check inline void SetHyphen( const bool bNew = true ){ bHyphen = bNew; } inline ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XSpellChecker1 > GetXSpellChecker() { return xSpell; } inline ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XHyphenator > GetXHyphenator() { return xHyph; } inline bool IsAllRight() { return bAllRight; } inline vcl::Window* GetWin() { return pWin; } inline void EnableAutoCorrect() { bAuto = true; } protected: ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > GetLast() { return xLast; } void SetLast(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > &xNewLast) { xLast = xNewLast; } virtual bool SpellMore(); // examine further documents? virtual bool HasOtherCnt(); // Are there any special areas? virtual void SpellStart( SvxSpellArea eSpell ); // Preparing the area virtual bool SpellContinue(); // Check Areas // Result available through GetLast virtual void ReplaceAll( const OUString &rNewText, sal_Int16 nLanguage ); //Replace word from the replace list ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XDictionary > GetAllRightDic() const; virtual void SpellEnd(); // Finish area virtual void ScrollArea(); // Set ScrollArea // Replace word virtual void ChangeWord( const OUString& rNewWord, const sal_uInt16 nLang ); // Wort via Thesaurus ersetzen virtual void ChangeThesWord( const OUString& rNewWord ); virtual void AutoCorrect( const OUString& rAktStr, const OUString& rNewStr ); virtual void InsertHyphen( const sal_uInt16 nPos ); // Insert hyphen void SetCurTextObj( SdrObject* pObj ) { mpTextObj = pObj; } SdrObject* GetCurTextObj() { return mpTextObj; } }; #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ stro/lhm/libreoffice-7-0+backports'>distro/lhm/libreoffice-7-0+backports LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2016-04-30Fix typosAndrea Gelmini
Change-Id: Id81b16ff26283611f0b84929d831c827f847ab73 Reviewed-on: https://gerrit.libreoffice.org/24317 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2015-11-17Don't assume sal_Unicode is unsigned shortStephan Bergmann
Change-Id: Id3bdce8776ebbdf700eabceed1e123a444a7bc4d
2015-11-10loplugin:nullptr (automatic rewrite; Mac-specific code)Stephan Bergmann
Change-Id: I65de14686d730743abc5becb139a296c6a4a537d
2015-11-10loplugin:stringconstantStephan Bergmann
Change-Id: Ibb9114d34f2695aa85858e456518e36dbcbe0af1
2015-11-10loplugin:oncevarStephan Bergmann
Change-Id: Iee9987aeafed126e4324d8d487289469577fafa2
2015-11-02dock icon's menu doesn't begin with separator anymoreDouglas Mencken
... even when there's no open windows Change-Id: I8c1d8f254e621d1867a100ad984f8b77ed8cfc5a Reviewed-on: https://gerrit.libreoffice.org/19677 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
2015-10-29remove the USE_APP_SHORTCUTS #define and simplify the code in the processNoel Grandin
it was effectively always being set to true Change-Id: I9e29819d10985708e37e87daa37be72b3e160c7e Reviewed-on: https://gerrit.libreoffice.org/19639 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2015-10-25clean-up for sfx2/source/appl/shutdowniconaqua.mmDouglas Mencken
Change-Id: I459e00ca0b6578be6f7543eb220720b1a48c1ac7 Reviewed-on: https://gerrit.libreoffice.org/19584 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-10-12Replace "SAL_OVERRIDE" with "override" in LIBO_INTERNAL_ONLY codeStephan Bergmann
Change-Id: I2ea407acd763ef2d7dae2d3b8f32525523ac8274
2015-09-03sfx2: tdf#88206 replace cppu::WeakImplHelper* etc.Takeshi Abe
with the variadic variants. Change-Id: Id9b4ad4d1fa700c5ea3dd7417292cf2ddb7ade50 Reviewed-on: https://gerrit.libreoffice.org/18229 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-06-02loplugin:loopvartoosmallStephan Bergmann
Change-Id: I721a9da1f277ce641375411f302557372331e6a2
2015-04-23loplugin:staticcallStephan Bergmann
Change-Id: I27c1e94ab94aa242cf73732f3402b169d6d48238
2015-04-07fix osx buildNoel Grandin
Change-Id: I6672fa579b0e7fe0c02d5b1a3c54e99ac96f5322
2015-04-02Change INetProtocol enumerators to CamelCaseStephan Bergmann
...to avoid clashes with macros and poor warnings about hiding global FILE Change-Id: I444e8b958f029201b228937e088efabc4b6d3050
2015-04-02Change INetProtocol to scoped enumerationStephan Bergmann
...and fix o3tl::enumarray::operator [] const overload Change-Id: I749b1b9d68686b03a97074253478d9d2d9d32b0b
2014-10-29ref-counting vcl::Window subclassesNoel Grandin
Points of discussion -------------------- (*) where in the Window destructor should dispose() be called? It's a seriously large method. (*) we're going to need similar typedefs and declarations for every single sub-class of vcl::Window, I assume that I will need to create a macro to make it less verbose. TODO ---- Update clang plugin to verify that: (a) dispose() methods always call their superclass dispose() (b) dispose() methods don't forget to clear any references owned by that class. Change-Id: I873d5d5166f811e2f65e49327cc98862559fcf30
2014-07-01salplug:literaltoboolconversionStephan Bergmann
Change-Id: I94b3bea97b6b4710bd4bf4c0fe88a1518a151de5
2014-06-26loplugin:staticcallStephan Bergmann
Change-Id: Idea97df52106af64f6c5605460756d48296551e2
2014-03-27SAL_OVERRIDE, Mac OS X sfx2 reduxStephan Bergmann
Change-Id: Ic99184543e2c019e96622e445b56c21760bf025a
2014-03-19loplugin:passstringbyrefStephan Bergmann
Change-Id: I53e8d7d976f37a0dcf09200713ea418ed024305d
2013-11-19fix compile error - remove bracketNoel Grandin
I messed this up this when doing commit 2c35fff7eca3a143d28dc75e6a73fe1101d2af77 "remove most use of RTL_CONSTASCII_USTRINGPARAM macro" Change-Id: I2edd094cfdf9ae83d5d2a7a2ab13932277f589c1
2013-11-19remove most use of RTL_CONSTASCII_USTRINGPARAM macroNoel Grandin
This is largely unnecessary when working with OUString Change-Id: I3cf4d68357a43665d01162ef4a2d5346a45da9be
2013-11-11sfx2: include <> for external includesNorbert Thiebaud
Change-Id: I63de4bc034020d19abd20f301194482da9a604f4