1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 #ifndef _OLMENU_HXX 28 #define _OLMENU_HXX 29 30 #include <com/sun/star/linguistic2/XDictionary.hpp> 31 #include <com/sun/star/linguistic2/XSpellAlternatives.hpp> 32 #include <com/sun/star/linguistic2/ProofreadingResult.hpp> 33 #include <com/sun/star/uno/Sequence.h> 34 35 #include <rtl/ustring.hxx> 36 #include <vcl/image.hxx> 37 #include <vcl/menu.hxx> 38 39 #include <map> 40 #include <vector> 41 42 43 class SwWrtShell; 44 45 class SwSpellPopup : public PopupMenu 46 { 47 SwWrtShell* pSh; 48 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< 49 ::com::sun::star::linguistic2::XDictionary > > aDics; 50 ::com::sun::star::uno::Reference< 51 ::com::sun::star::linguistic2::XSpellAlternatives > xSpellAlt; 52 53 ::com::sun::star::uno::Sequence< rtl::OUString > aSuggestions; 54 55 LanguageType nCheckedLanguage; 56 LanguageType nGuessLangWord; 57 LanguageType nGuessLangPara; 58 59 std::map< sal_Int16, ::rtl::OUString > aLangTable_Text; 60 std::map< sal_Int16, ::rtl::OUString > aLangTable_Paragraph; 61 // std::map< sal_Int16, ::rtl::OUString > aLangTable_Document; 62 63 bool bGrammarResults; // show grammar results? Or show spellcheck results? 64 65 Image aInfo16; 66 67 void fillLangPopupMenu( PopupMenu *pPopupMenu, sal_uInt16 nLangStart, 68 ::com::sun::star::uno::Sequence< ::rtl::OUString > aSeq, SwWrtShell* pWrtSh, 69 std::map< sal_Int16, ::rtl::OUString > &rLangTable ); 70 71 using PopupMenu::Execute; 72 73 public: 74 SwSpellPopup( SwWrtShell *pWrtSh, 75 const ::com::sun::star::uno::Reference< 76 ::com::sun::star::linguistic2::XSpellAlternatives > &xAlt, 77 const String & rParaText ); 78 79 SwSpellPopup( SwWrtShell *pWrtSh, 80 const ::com::sun::star::linguistic2::ProofreadingResult &rResult, 81 sal_Int32 nErrorInResult, 82 const ::com::sun::star::uno::Sequence< rtl::OUString > &rSuggestions, 83 const String & rParaText ); 84 85 sal_uInt16 Execute( const Rectangle& rPopupPos, Window* pWin ); 86 void Execute( sal_uInt16 nId ); 87 88 }; 89 90 #endif 91 92