1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: langselectionstatusbarcontroller.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef __FRAMEWORK_UIELEMENT_LANGSELECTIONSTATUSBARCONTROLLER_HXX_
32 #define __FRAMEWORK_UIELEMENT_LANGSELECTIONSTATUSBARCONTROLLER_HXX_
34 #include <macros/generic.hxx>
35 #include <macros/xinterface.hxx>
36 #include <macros/xtypeprovider.hxx>
37 #include <macros/xserviceinfo.hxx>
39 #include <com/sun/star/linguistic2/XLanguageGuessing.hpp>
40 #include <svtools/statusbarcontroller.hxx>
42 #include "helper/mischelper.hxx"
44 // component helper namespace
47 class LangSelectionStatusbarController
: public svt::StatusbarController
50 explicit LangSelectionStatusbarController( const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
>& xServiceManager
);
56 virtual ::com::sun::star::uno::Any SAL_CALL
queryInterface( const ::com::sun::star::uno::Type
& aType
) throw (::com::sun::star::uno::RuntimeException
);
57 virtual void SAL_CALL
acquire() throw ();
58 virtual void SAL_CALL
release() throw ();
61 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
);
64 virtual void SAL_CALL
dispose() throw ( ::com::sun::star::uno::RuntimeException
);
67 virtual void SAL_CALL
disposing( const com::sun::star::lang::EventObject
& Source
) throw ( ::com::sun::star::uno::RuntimeException
);
70 virtual void SAL_CALL
statusChanged( const ::com::sun::star::frame::FeatureStateEvent
& Event
) throw ( ::com::sun::star::uno::RuntimeException
);
72 // XStatusbarController
73 virtual ::sal_Bool SAL_CALL
mouseButtonDown( const ::com::sun::star::awt::MouseEvent
& aMouseEvent
) throw (::com::sun::star::uno::RuntimeException
);
74 virtual ::sal_Bool SAL_CALL
mouseMove( const ::com::sun::star::awt::MouseEvent
& aMouseEvent
) throw (::com::sun::star::uno::RuntimeException
);
75 virtual ::sal_Bool SAL_CALL
mouseButtonUp( const ::com::sun::star::awt::MouseEvent
& aMouseEvent
) throw (::com::sun::star::uno::RuntimeException
);
76 virtual void SAL_CALL
command( const ::com::sun::star::awt::Point
& aPos
,
78 ::sal_Bool bMouseEvent
,
79 const ::com::sun::star::uno::Any
& aData
) throw (::com::sun::star::uno::RuntimeException
);
80 virtual void SAL_CALL
paint( const ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XGraphics
>& xGraphics
,
81 const ::com::sun::star::awt::Rectangle
& rOutputRectangle
,
82 ::sal_Int32 nItemId
, ::sal_Int32 nStyle
) throw (::com::sun::star::uno::RuntimeException
);
83 virtual void SAL_CALL
click() throw (::com::sun::star::uno::RuntimeException
);
84 virtual void SAL_CALL
doubleClick() throw (::com::sun::star::uno::RuntimeException
);
87 virtual ~LangSelectionStatusbarController() {}
88 LangSelectionStatusbarController(LangSelectionStatusbarController
&); // not defined
89 void operator =(LangSelectionStatusbarController
&); // not defined
93 sal_Int16 m_nScriptType
;
94 ::rtl::OUString m_aCurrentLanguage
;
95 ::rtl::OUString m_aCurLang
;
96 ::rtl::OUString m_aKeyboardLang
;
97 ::rtl::OUString m_aGuessedText
;
98 LanguageGuessingHelper m_aLangGuessHelper
;
100 void LangMenu() throw (::com::sun::star::uno::RuntimeException
);
103 } // framework namespace
105 #endif // __FRAMEWORK_UIELEMENT_LANGSELECTIONSTATUSBARCONTROLLER_HXX_