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_SW_SOURCE_UIBASE_INC_OLMENU_HXX
20 : #define INCLUDED_SW_SOURCE_UIBASE_INC_OLMENU_HXX
21 :
22 : #include <com/sun/star/linguistic2/XDictionary.hpp>
23 : #include <com/sun/star/linguistic2/XSpellAlternatives.hpp>
24 : #include <com/sun/star/linguistic2/ProofreadingResult.hpp>
25 : #include <com/sun/star/uno/Sequence.h>
26 :
27 : #include <rtl/ustring.hxx>
28 : #include <vcl/image.hxx>
29 : #include <vcl/menu.hxx>
30 :
31 : #include <map>
32 : #include <vector>
33 :
34 : class SwWrtShell;
35 :
36 1 : class SW_DLLPUBLIC SwSpellPopup : public PopupMenu
37 : {
38 : SwWrtShell* m_pSh;
39 : ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference<
40 : ::com::sun::star::linguistic2::XDictionary > > m_aDics;
41 : ::com::sun::star::uno::Reference<
42 : ::com::sun::star::linguistic2::XSpellAlternatives > m_xSpellAlt;
43 :
44 : ::com::sun::star::linguistic2::ProofreadingResult m_xGrammarResult;
45 : sal_Int32 m_nGrammarError;
46 :
47 : ::com::sun::star::uno::Sequence< OUString > m_aSuggestions;
48 : OUString m_sExplanationLink;
49 :
50 : LanguageType m_nCheckedLanguage;
51 : LanguageType m_nGuessLangWord;
52 : LanguageType m_nGuessLangPara;
53 :
54 : std::map< sal_Int16, OUString > m_aLangTable_Text;
55 : std::map< sal_Int16, OUString > m_aLangTable_Paragraph;
56 : // std::map< sal_Int16, OUString > aLangTable_Document;
57 :
58 : OUString m_aDicNameSingle;
59 : bool m_bGrammarResults; // show grammar results? Or show spellcheck results?
60 :
61 : Image m_aInfo16;
62 :
63 : static void fillLangPopupMenu( PopupMenu *pPopupMenu, sal_uInt16 nLangStart,
64 : const ::com::sun::star::uno::Sequence< OUString >& aSeq, SwWrtShell* pWrtSh,
65 : std::map< sal_Int16, OUString > &rLangTable );
66 :
67 : using PopupMenu::Execute;
68 :
69 : /// Checks if any of the redline menu items should be hidden.
70 : void checkRedline();
71 :
72 : public:
73 : SwSpellPopup( SwWrtShell *pWrtSh,
74 : const ::com::sun::star::uno::Reference<
75 : ::com::sun::star::linguistic2::XSpellAlternatives > &xAlt,
76 : const OUString & rParaText );
77 :
78 : SwSpellPopup( SwWrtShell *pWrtSh,
79 : const ::com::sun::star::linguistic2::ProofreadingResult &rResult,
80 : sal_Int32 nErrorInResult,
81 : const ::com::sun::star::uno::Sequence< OUString > &rSuggestions,
82 : const OUString & rParaText );
83 :
84 : sal_uInt16 Execute( const Rectangle& rPopupPos, vcl::Window* pWin );
85 : void Execute( sal_uInt16 nId );
86 :
87 : };
88 :
89 : #endif
90 :
91 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|