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 :
20 : #ifndef __FRAMEWORK_UIELEMENT_LANGSELECTIONSTATUSBARCONTROLLER_HXX_
21 : #define __FRAMEWORK_UIELEMENT_LANGSELECTIONSTATUSBARCONTROLLER_HXX_
22 :
23 : #include <macros/generic.hxx>
24 : #include <macros/xinterface.hxx>
25 : #include <macros/xtypeprovider.hxx>
26 : #include <macros/xserviceinfo.hxx>
27 : #include <stdtypes.h>
28 : #include <com/sun/star/linguistic2/XLanguageGuessing.hpp>
29 : #include <svtools/statusbarcontroller.hxx>
30 : #include <rtl/ustring.hxx>
31 :
32 : #include "helper/mischelper.hxx"
33 :
34 : #include <set>
35 :
36 : class SvtLanguageTable;
37 :
38 :
39 : // component helper namespace
40 : namespace framework {
41 :
42 : class LangSelectionStatusbarController : public svt::StatusbarController
43 : {
44 : public:
45 : explicit LangSelectionStatusbarController( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager );
46 :
47 : // XServiceInfo
48 : DECLARE_XSERVICEINFO
49 :
50 : // XInterface
51 : virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw (::com::sun::star::uno::RuntimeException);
52 : virtual void SAL_CALL acquire() throw ();
53 : virtual void SAL_CALL release() throw ();
54 :
55 : // XInitialization
56 : 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);
57 :
58 : // XComponent
59 : virtual void SAL_CALL dispose() throw ( ::com::sun::star::uno::RuntimeException );
60 :
61 : // XEventListener
62 : virtual void SAL_CALL disposing( const com::sun::star::lang::EventObject& Source ) throw ( ::com::sun::star::uno::RuntimeException );
63 :
64 : // XStatusListener
65 : virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException );
66 :
67 : // XStatusbarController
68 : virtual ::sal_Bool SAL_CALL mouseButtonDown( const ::com::sun::star::awt::MouseEvent& aMouseEvent ) throw (::com::sun::star::uno::RuntimeException);
69 : virtual ::sal_Bool SAL_CALL mouseMove( const ::com::sun::star::awt::MouseEvent& aMouseEvent ) throw (::com::sun::star::uno::RuntimeException);
70 : virtual ::sal_Bool SAL_CALL mouseButtonUp( const ::com::sun::star::awt::MouseEvent& aMouseEvent ) throw (::com::sun::star::uno::RuntimeException);
71 : virtual void SAL_CALL command( const ::com::sun::star::awt::Point& aPos,
72 : ::sal_Int32 nCommand,
73 : ::sal_Bool bMouseEvent,
74 : const ::com::sun::star::uno::Any& aData ) throw (::com::sun::star::uno::RuntimeException);
75 : virtual void SAL_CALL paint( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics >& xGraphics,
76 : const ::com::sun::star::awt::Rectangle& rOutputRectangle,
77 : ::sal_Int32 nItemId, ::sal_Int32 nStyle ) throw (::com::sun::star::uno::RuntimeException);
78 : virtual void SAL_CALL click() throw (::com::sun::star::uno::RuntimeException);
79 : virtual void SAL_CALL doubleClick() throw (::com::sun::star::uno::RuntimeException);
80 :
81 : private:
82 0 : virtual ~LangSelectionStatusbarController() {}
83 : LangSelectionStatusbarController(LangSelectionStatusbarController &); // not defined
84 : void operator =(LangSelectionStatusbarController &); // not defined
85 :
86 :
87 : sal_Bool m_bShowMenu; // if the menu is to be displayed or not (depending on the selected object/text)
88 : sal_Int16 m_nScriptType; // the flags for the different script types available in the selection, LATIN = 0x0001, ASIAN = 0x0002, COMPLEX = 0x0004
89 : ::rtl::OUString m_aCurLang; // the language of the current selection, "*" if there are more than one languages
90 : ::rtl::OUString m_aKeyboardLang; // the keyboard language
91 : ::rtl::OUString m_aGuessedTextLang; // the 'guessed' language for the selection, "" if none could be guessed
92 : LanguageGuessingHelper m_aLangGuessHelper;
93 :
94 : void LangMenu() throw (::com::sun::star::uno::RuntimeException);
95 : };
96 :
97 : } // framework namespace
98 :
99 : #endif // __FRAMEWORK_UIELEMENT_LANGSELECTIONSTATUSBARCONTROLLER_HXX_
100 :
101 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|