1f8e07b45SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3f8e07b45SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4f8e07b45SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5f8e07b45SAndrew Rist  * distributed with this work for additional information
6f8e07b45SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7f8e07b45SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8f8e07b45SAndrew Rist  * "License"); you may not use this file except in compliance
9f8e07b45SAndrew Rist  * with the License.  You may obtain a copy of the License at
10f8e07b45SAndrew Rist  *
11f8e07b45SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12f8e07b45SAndrew Rist  *
13f8e07b45SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14f8e07b45SAndrew Rist  * software distributed under the License is distributed on an
15f8e07b45SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16f8e07b45SAndrew Rist  * KIND, either express or implied.  See the License for the
17f8e07b45SAndrew Rist  * specific language governing permissions and limitations
18f8e07b45SAndrew Rist  * under the License.
19f8e07b45SAndrew Rist  *
20f8e07b45SAndrew Rist  *************************************************************/
21f8e07b45SAndrew Rist 
22f8e07b45SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef __FRAMEWORK_UIELEMENT_LANGSELECTIONSTATUSBARCONTROLLER_HXX_
25cdf0e10cSrcweir #define __FRAMEWORK_UIELEMENT_LANGSELECTIONSTATUSBARCONTROLLER_HXX_
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <macros/generic.hxx>
28cdf0e10cSrcweir #include <macros/xinterface.hxx>
29cdf0e10cSrcweir #include <macros/xtypeprovider.hxx>
30cdf0e10cSrcweir #include <macros/xserviceinfo.hxx>
31cdf0e10cSrcweir #include <stdtypes.h>
32cdf0e10cSrcweir #include <com/sun/star/linguistic2/XLanguageGuessing.hpp>
33cdf0e10cSrcweir #include <svtools/statusbarcontroller.hxx>
34cdf0e10cSrcweir #include <rtl/ustring.hxx>
35cdf0e10cSrcweir 
36cdf0e10cSrcweir #include "helper/mischelper.hxx"
37cdf0e10cSrcweir 
38cdf0e10cSrcweir #include <set>
39cdf0e10cSrcweir 
40cdf0e10cSrcweir class SvtLanguageTable;
41cdf0e10cSrcweir 
42cdf0e10cSrcweir 
43cdf0e10cSrcweir // component helper namespace
44cdf0e10cSrcweir namespace framework {
45cdf0e10cSrcweir 
46cdf0e10cSrcweir class LangSelectionStatusbarController : public svt::StatusbarController
47cdf0e10cSrcweir {
48cdf0e10cSrcweir     public:
49cdf0e10cSrcweir         explicit LangSelectionStatusbarController( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager );
50cdf0e10cSrcweir 
51cdf0e10cSrcweir         // XServiceInfo
52*450ff861SAriel Constenla-Haile         DECLARE_XSERVICEINFO
53cdf0e10cSrcweir 
54cdf0e10cSrcweir         // XInitialization
55cdf0e10cSrcweir         virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
56cdf0e10cSrcweir 
57cdf0e10cSrcweir         // XStatusListener
58cdf0e10cSrcweir         virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException );
59*450ff861SAriel Constenla-Haile 
60cdf0e10cSrcweir         // XStatusbarController
61*450ff861SAriel Constenla-Haile         virtual void SAL_CALL command( const ::com::sun::star::awt::Point& aPos,
62*450ff861SAriel Constenla-Haile                                        ::sal_Int32 nCommand,
63*450ff861SAriel Constenla-Haile                                        ::sal_Bool bMouseEvent,
64cdf0e10cSrcweir                                        const ::com::sun::star::uno::Any& aData ) throw (::com::sun::star::uno::RuntimeException);
65*450ff861SAriel Constenla-Haile         virtual void SAL_CALL click( const ::com::sun::star::awt::Point& aPos ) throw (::com::sun::star::uno::RuntimeException);
66*450ff861SAriel Constenla-Haile 
67cdf0e10cSrcweir     private:
~LangSelectionStatusbarController()68cdf0e10cSrcweir         virtual ~LangSelectionStatusbarController() {}
69cdf0e10cSrcweir         LangSelectionStatusbarController(LangSelectionStatusbarController &); // not defined
70cdf0e10cSrcweir         void operator =(LangSelectionStatusbarController &); // not defined
71cdf0e10cSrcweir 
72cdf0e10cSrcweir 
73cdf0e10cSrcweir         sal_Bool            m_bShowMenu;        // if the menu is to be displayed or not (depending on the selected object/text)
74cdf0e10cSrcweir         sal_Int16           m_nScriptType;      // the flags for the different script types available in the selection, LATIN = 0x0001, ASIAN = 0x0002, COMPLEX = 0x0004
75cdf0e10cSrcweir         ::rtl::OUString     m_aCurLang;         // the language of the current selection, "*" if there are more than one languages
76cdf0e10cSrcweir         ::rtl::OUString     m_aKeyboardLang;    // the keyboard language
77cdf0e10cSrcweir         ::rtl::OUString     m_aGuessedTextLang;     // the 'guessed' language for the selection, "" if none could be guessed
78cdf0e10cSrcweir         LanguageGuessingHelper      m_aLangGuessHelper;
79cdf0e10cSrcweir 
80*450ff861SAriel Constenla-Haile         void LangMenu( const ::com::sun::star::awt::Point& aPos ) throw (::com::sun::star::uno::RuntimeException);
81cdf0e10cSrcweir };
82cdf0e10cSrcweir 
83cdf0e10cSrcweir } // framework namespace
84cdf0e10cSrcweir 
85cdf0e10cSrcweir #endif // __FRAMEWORK_UIELEMENT_LANGSELECTIONSTATUSBARCONTROLLER_HXX_
86