LCOV - code coverage report
Current view: top level - cui/source/inc - SpellDialog.hxx (source / functions) Hit Total Coverage
Test: commit e02a6cb2c3e2b23b203b422e4e0680877f232636 Lines: 0 8 0.0 %
Date: 2014-04-14 Functions: 0 8 0.0 %
Legend: Lines: hit not hit

          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             : #ifndef INCLUDED_CUI_SOURCE_INC_SPELLDIALOG_HXX
      20             : #define INCLUDED_CUI_SOURCE_INC_SPELLDIALOG_HXX
      21             : 
      22             : #include <sfx2/basedlgs.hxx>
      23             : #include <vcl/fixed.hxx>
      24             : #include <vcl/edit.hxx>
      25             : #include <vcl/lstbox.hxx>
      26             : #include <svtools/stdctrl.hxx>
      27             : #include <vcl/button.hxx>
      28             : #include <vcl/menubtn.hxx>
      29             : #include <vcl/group.hxx>
      30             : #include <vcl/decoview.hxx>
      31             : #include <vcl/image.hxx>
      32             : #include <com/sun/star/uno/Reference.hxx>
      33             : 
      34             : 
      35             : #include <svx/langbox.hxx>
      36             : #include <memory>
      37             : #include <svtools/svmedit.hxx>
      38             : #include <svl/lstner.hxx>
      39             : #include <vcl/fixedhyper.hxx>
      40             : #include <vcl/xtextedt.hxx>
      41             : #include <editeng/SpellPortions.hxx>
      42             : 
      43             : #include <set>
      44             : 
      45             : namespace svx{ class SpellUndoAction_Impl;}
      46             : 
      47             : // forward ---------------------------------------------------------------
      48             : 
      49             : struct SpellDialog_Impl;
      50             : 
      51             : namespace com{namespace sun{namespace star{
      52             : namespace linguistic2{
      53             :     class XSpellChecker1;
      54             : }}}}
      55             : namespace svx{
      56             : class SpellDialog;
      57             : struct SpellErrorDescription;
      58             : 
      59             : class SentenceEditWindow_Impl : public VclMultiLineEdit
      60             : {
      61             :     using VclMultiLineEdit::SetText;
      62             : 
      63             : private:
      64             :     std::set< sal_uInt16 >      m_aIgnoreErrorsAt;
      65             :     sal_uInt16          m_nErrorStart;
      66             :     sal_uInt16          m_nErrorEnd;
      67             :     bool            m_bIsUndoEditMode;
      68             : 
      69             :     Link            m_aModifyLink;
      70             : 
      71           0 :     void            CallModifyLink() {m_aModifyLink.Call(this);}
      72             : 
      73           0 :     SpellDialog*    GetSpellDialog() const {return (SpellDialog*)GetParentDialog();}
      74             : protected:
      75             :     virtual bool    PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
      76             : 
      77             : public:
      78             :     SentenceEditWindow_Impl(Window* pParent, WinBits nBits);
      79             :     virtual ~SentenceEditWindow_Impl();
      80             : 
      81           0 :     void            SetModifyHdl(const Link& rLink) SAL_OVERRIDE { m_aModifyLink = rLink;}
      82             : 
      83             :     void            SetAttrib( const TextAttrib& rAttr, sal_uLong nPara, sal_uInt16 nStart, sal_uInt16 nEnd );
      84             :     void            SetText( const OUString& rStr ) SAL_OVERRIDE;
      85             : 
      86             :     bool            MarkNextError( bool bIgnoreCurrentError, com::sun::star::uno::Reference<com::sun::star::linguistic2::XSpellChecker1> );
      87             :     void            ChangeMarkedWord(const OUString& rNewWord, LanguageType eLanguage);
      88             :     void            MoveErrorMarkTo(sal_uInt16 nErrorStart, sal_uInt16 nErrorEnd, bool bGrammar);
      89             :     OUString        GetErrorText() const;
      90             :     void            RestoreCurrentError();
      91             : 
      92             :     void            SetAlternatives(
      93             :                         com::sun::star::uno::Reference<com::sun::star::linguistic2::XSpellAlternatives> );
      94             : 
      95             :     const SpellErrorDescription* GetAlternatives();
      96             : 
      97             : 
      98           0 :     void            ResetModified()   { GetTextEngine()->SetModified(false); m_bIsUndoEditMode = false;}
      99           0 :     virtual bool    IsModified() const SAL_OVERRIDE { return GetTextEngine()->IsModified(); }
     100             : 
     101           0 :     bool            IsUndoEditMode() const { return m_bIsUndoEditMode;}
     102             :     void            SetUndoEditMode(bool bSet);
     103             : 
     104             :     svx::SpellPortions  CreateSpellPortions( bool bSetIgnoreFlag ) const;
     105             : 
     106             :     void            ResetUndo();
     107             :     void            Undo();
     108             :     void            AddUndoAction( SfxUndoAction *pAction, sal_Bool bTryMerg=sal_False );
     109             :     sal_uInt16      GetUndoActionCount();
     110             :     void            UndoActionStart( sal_uInt16 nId );
     111             :     void            UndoActionEnd();
     112             : 
     113             :     void            MoveErrorEnd(long nOffset);
     114             : 
     115           0 :     void            ResetIgnoreErrorsAt()   { m_aIgnoreErrorsAt.clear(); }
     116             : };
     117             : 
     118             : // class SvxSpellDialog ---------------------------------------------
     119             : class SpellDialogChildWindow;
     120             : 
     121             : class SpellDialog : public SfxModelessDialog
     122             : {
     123             :     using Window::Invalidate;
     124             : 
     125             :     friend class SentenceEditWindow_Impl;
     126             : private:
     127             : 
     128             :     FixedText*      m_pLanguageFT;
     129             :     SvxLanguageBox* m_pLanguageLB;
     130             : 
     131             :     FixedText*      m_pExplainFT;
     132             :     FixedHyperlink* m_pExplainLink;
     133             : 
     134             :     FixedText*      m_pNotInDictFT;
     135             :     SentenceEditWindow_Impl* m_pSentenceED;
     136             : 
     137             :     FixedText*      m_pSuggestionFT;
     138             :     ListBox*        m_pSuggestionLB;
     139             : 
     140             :     PushButton*     m_pIgnorePB;
     141             :     PushButton*     m_pIgnoreAllPB;
     142             :     PushButton*     m_pIgnoreRulePB;
     143             :     PushButton*     m_pAddToDictPB;
     144             :     MenuButton*     m_pAddToDictMB;
     145             : 
     146             :     PushButton*     m_pChangePB;
     147             :     PushButton*     m_pChangeAllPB;
     148             :     PushButton*     m_pAutoCorrPB;
     149             : 
     150             :     CheckBox*       m_pCheckGrammarCB;
     151             : 
     152             :     PushButton*     m_pOptionsPB;
     153             :     PushButton*     m_pUndoPB;
     154             :     CloseButton*    m_pClosePB;
     155             : 
     156             :     OUString        m_sResumeST;
     157             :     OUString        m_sIgnoreOnceST;
     158             :     OUString        m_sNoSuggestionsST;
     159             : 
     160             :     OUString        m_sTitleSpelling;
     161             :     OUString        m_sTitleSpellingGrammar;
     162             : 
     163             :     Link            aDialogUndoLink;
     164             : 
     165             :     bool            bModified;
     166             :     bool            bFocusLocked;
     167             : 
     168             :     svx::SpellDialogChildWindow& rParent;
     169             :     svx::SpellPortions           m_aSavedSentence;
     170             : 
     171             :     SpellDialog_Impl* pImpl;
     172             :     ::com::sun::star::uno::Reference<
     173             :         ::com::sun::star::linguistic2::XSpellChecker1 >     xSpell;
     174             : 
     175             :     DECL_LINK(ChangeHdl, void *);
     176             :     DECL_LINK(ChangeAllHdl, void *);
     177             :     DECL_LINK( IgnoreAllHdl, Button * );
     178             :     DECL_LINK(IgnoreHdl, void *);
     179             :     DECL_LINK( CheckGrammarHdl, CheckBox* );
     180             :     DECL_LINK( ExtClickHdl, Button * );
     181             :     DECL_LINK(CancelHdl, void *);
     182             :     DECL_LINK( ModifyHdl, SentenceEditWindow_Impl *);
     183             :     DECL_LINK(UndoHdl, void *);
     184             :     DECL_LINK( AddToDictSelectHdl, MenuButton* );
     185             :     DECL_LINK( AddToDictClickHdl, PushButton* );
     186             :     DECL_LINK( LanguageSelectHdl, SvxLanguageBox* );
     187             :     DECL_LINK( DialogUndoHdl, SpellUndoAction_Impl* );
     188             :     DECL_LINK( HandleHyperlink, FixedHyperlink * );
     189             : 
     190             :     DECL_STATIC_LINK( SpellDialog, InitHdl, SpellDialog * );
     191             : 
     192             :     int             AddToDictionaryExecute( sal_uInt16 ItemId, PopupMenu *pMenu );
     193             :     void            StartSpellOptDlg_Impl();
     194             :     int             InitUserDicts();
     195             :     void            UpdateBoxes_Impl();
     196             :     void            Init_Impl();
     197             :     void            SpellContinue_Impl(bool UseSavedSentence = false, bool bIgnoreCurrentError = false );
     198           0 :     void            LockFocusChanges( bool bLock ) {bFocusLocked = bLock;}
     199             :     void            Impl_Restore();
     200             : 
     201             :     void            SetSelectedLang_Impl( LanguageType nLang );
     202             :     LanguageType    GetSelectedLang_Impl() const;
     203             : 
     204             :     /** Retrieves the next sentence.
     205             :      */
     206             :     bool            GetNextSentence_Impl(bool bUseSavedSentence, bool bRechek /*for rechecking the current sentence*/);
     207             :     /** Corrects all errors that have been selected to be changed always
     208             :      */
     209             :     bool            ApplyChangeAllList_Impl(SpellPortions& rSentence, bool& bHasReplaced);
     210             :     void            SetTitle_Impl(LanguageType nLang);
     211             : 
     212             : protected:
     213             :     virtual bool    Notify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
     214             : 
     215             :     OUString getReplacementString() const;
     216             : 
     217             : public:
     218             :     SpellDialog(
     219             :         svx::SpellDialogChildWindow* pChildWindow,
     220             :         Window * pParent,
     221             :         SfxBindings* pBindings);
     222             :     virtual ~SpellDialog();
     223             : 
     224             :     void            SetLanguage( sal_uInt16 nLang );
     225             :     virtual bool    Close() SAL_OVERRIDE;
     226             : 
     227             :     void            InvalidateDialog();
     228             : };
     229             : } //namespace svx
     230             : 
     231             : #endif
     232             : 
     233             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10