xref: /aoo41x/main/sw/source/ui/inc/olmenu.hxx (revision 1d2dbeb0)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef _OLMENU_HXX
24 #define _OLMENU_HXX
25 
26 #include <com/sun/star/linguistic2/XDictionary.hpp>
27 #include <com/sun/star/linguistic2/XSpellAlternatives.hpp>
28 #include <com/sun/star/linguistic2/ProofreadingResult.hpp>
29 #include <com/sun/star/uno/Sequence.h>
30 
31 #include <rtl/ustring.hxx>
32 #include <vcl/image.hxx>
33 #include <vcl/menu.hxx>
34 
35 #include <map>
36 #include <vector>
37 
38 
39 class SwWrtShell;
40 
41 class SwSpellPopup : public PopupMenu
42 {
43 	SwWrtShell*	pSh;
44 	::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference<
45 		::com::sun::star::linguistic2::XDictionary >  >		aDics;
46 	::com::sun::star::uno::Reference<
47 		::com::sun::star::linguistic2::XSpellAlternatives >	xSpellAlt;
48 
49     ::com::sun::star::uno::Sequence< rtl::OUString >  aSuggestions;
50 
51     LanguageType                nCheckedLanguage;
52     LanguageType                nGuessLangWord;
53     LanguageType                nGuessLangPara;
54 
55     std::map< sal_Int16, ::rtl::OUString > aLangTable_Text;
56     std::map< sal_Int16, ::rtl::OUString > aLangTable_Paragraph;
57 //    std::map< sal_Int16, ::rtl::OUString > aLangTable_Document;
58 
59     bool    bGrammarResults;    // show grammar results? Or show spellcheck results?
60 
61     Image   aInfo16;
62 
63     void fillLangPopupMenu( PopupMenu *pPopupMenu, sal_uInt16 nLangStart,
64             ::com::sun::star::uno::Sequence< ::rtl::OUString > aSeq, SwWrtShell* pWrtSh,
65             std::map< sal_Int16, ::rtl::OUString > &rLangTable );
66 
67     using PopupMenu::Execute;
68 
69 public:
70     SwSpellPopup( SwWrtShell *pWrtSh,
71 			const ::com::sun::star::uno::Reference<
72                 ::com::sun::star::linguistic2::XSpellAlternatives >  &xAlt,
73             const String & rParaText );
74 
75     SwSpellPopup( SwWrtShell *pWrtSh,
76             const ::com::sun::star::linguistic2::ProofreadingResult &rResult,
77             sal_Int32 nErrorInResult,
78             const ::com::sun::star::uno::Sequence< rtl::OUString > &rSuggestions,
79             const String & rParaText );
80 
81     sal_uInt16  Execute( const Rectangle& rPopupPos, Window* pWin );
82     void Execute( sal_uInt16 nId );
83 
84 };
85 
86 #endif
87 
88