1*3334a7e6SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*3334a7e6SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*3334a7e6SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*3334a7e6SAndrew Rist * distributed with this work for additional information 6*3334a7e6SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*3334a7e6SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*3334a7e6SAndrew Rist * "License"); you may not use this file except in compliance 9*3334a7e6SAndrew Rist * with the License. You may obtain a copy of the License at 10*3334a7e6SAndrew Rist * 11*3334a7e6SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*3334a7e6SAndrew Rist * 13*3334a7e6SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*3334a7e6SAndrew Rist * software distributed under the License is distributed on an 15*3334a7e6SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*3334a7e6SAndrew Rist * KIND, either express or implied. See the License for the 17*3334a7e6SAndrew Rist * specific language governing permissions and limitations 18*3334a7e6SAndrew Rist * under the License. 19*3334a7e6SAndrew Rist * 20*3334a7e6SAndrew Rist *************************************************************/ 21*3334a7e6SAndrew Rist 22*3334a7e6SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef _TEXTCONVERSIONDLGS_CHINESE_TRANSLATION_UNODIALOG_HXX 25cdf0e10cSrcweir #define _TEXTCONVERSIONDLGS_CHINESE_TRANSLATION_UNODIALOG_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include <cppuhelper/component.hxx> 28cdf0e10cSrcweir #include <com/sun/star/awt/XWindow.hpp> 29cdf0e10cSrcweir #include <com/sun/star/beans/XPropertySet.hpp> 30cdf0e10cSrcweir #include <com/sun/star/frame/XModel.hpp> 31cdf0e10cSrcweir #include <com/sun/star/lang/XInitialization.hpp> 32cdf0e10cSrcweir #include <com/sun/star/lang/XServiceInfo.hpp> 33cdf0e10cSrcweir #include <com/sun/star/ui/dialogs/XExecutableDialog.hpp> 34cdf0e10cSrcweir #include <com/sun/star/uno/XComponentContext.hpp> 35cdf0e10cSrcweir #include <cppuhelper/implbase5.hxx> 36cdf0e10cSrcweir 37cdf0e10cSrcweir //............................................................................. 38cdf0e10cSrcweir namespace textconversiondlgs 39cdf0e10cSrcweir { 40cdf0e10cSrcweir //............................................................................. 41cdf0e10cSrcweir 42cdf0e10cSrcweir //------------------------------------------------------------------------- 43cdf0e10cSrcweir /** This class provides the chinese translation dialog as an uno component. 44cdf0e10cSrcweir 45cdf0e10cSrcweir It can be created via lang::XMultiComponentFactory::createInstanceWithContext 46cdf0e10cSrcweir with servicename "com.sun.star.linguistic2.ChineseTranslationDialog" 47cdf0e10cSrcweir or implemenation name "com.sun.star.comp.linguistic2.ChineseTranslationDialog" 48cdf0e10cSrcweir 49cdf0e10cSrcweir It can be initialized via the XInitialization interface with the following single parameter: 50cdf0e10cSrcweir PropertyValue-Parameter: Name="ParentWindow" Type="awt::XWindow". 51cdf0e10cSrcweir 52cdf0e10cSrcweir It can be executed via the ui::dialogs::XExecutableDialog interface. 53cdf0e10cSrcweir 54cdf0e10cSrcweir Made settings can be retrieved via beans::XPropertySet interface. 55cdf0e10cSrcweir Following properties are available (read only and not bound): 56cdf0e10cSrcweir 1) Name="IsDirectionToSimplified" Type="sal_Bool" 57cdf0e10cSrcweir 2) Name="IsUseCharacterVariants" Type="sal_Bool" 58cdf0e10cSrcweir 3) Name="IsTranslateCommonTerms" Type="sal_Bool" 59cdf0e10cSrcweir 60cdf0e10cSrcweir The dialog gets this information from the registry on execute and writes it back to the registry if ended with OK. 61cdf0e10cSrcweir */ 62cdf0e10cSrcweir 63cdf0e10cSrcweir class ChineseTranslationDialog; 64cdf0e10cSrcweir 65cdf0e10cSrcweir class ChineseTranslation_UnoDialog : public ::cppu::WeakImplHelper5 < 66cdf0e10cSrcweir ::com::sun::star::ui::dialogs::XExecutableDialog 67cdf0e10cSrcweir , ::com::sun::star::lang::XInitialization 68cdf0e10cSrcweir , ::com::sun::star::beans::XPropertySet 69cdf0e10cSrcweir , ::com::sun::star::lang::XComponent 70cdf0e10cSrcweir , ::com::sun::star::lang::XServiceInfo 71cdf0e10cSrcweir > 72cdf0e10cSrcweir // ,public ::com::sun::star::uno::XWeak // implemented by WeakImplHelper(optional interface) 73cdf0e10cSrcweir // ,public ::com::sun::star::uno::XInterface // implemented by WeakImplHelper(optional interface) 74cdf0e10cSrcweir // ,public ::com::sun::star::lang::XTypeProvider // implemented by WeakImplHelper 75cdf0e10cSrcweir { 76cdf0e10cSrcweir public: 77cdf0e10cSrcweir ChineseTranslation_UnoDialog( const ::com::sun::star::uno::Reference< 78cdf0e10cSrcweir ::com::sun::star::uno::XComponentContext >& xContext ); 79cdf0e10cSrcweir virtual ~ChineseTranslation_UnoDialog(); 80cdf0e10cSrcweir 81cdf0e10cSrcweir // lang::XServiceInfo 82cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException ); 83cdf0e10cSrcweir virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw( ::com::sun::star::uno::RuntimeException ); 84cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException ); 85cdf0e10cSrcweir 86cdf0e10cSrcweir static ::rtl::OUString getImplementationName_Static(); 87cdf0e10cSrcweir static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static(); 88cdf0e10cSrcweir 89cdf0e10cSrcweir static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL create(::com::sun::star::uno::Reference<::com::sun::star::uno::XComponentContext> const & xContext)90cdf0e10cSrcweir create( ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & xContext) throw(::com::sun::star::uno::Exception) 91cdf0e10cSrcweir { 92cdf0e10cSrcweir return (::cppu::OWeakObject *)new ChineseTranslation_UnoDialog( xContext ); 93cdf0e10cSrcweir } 94cdf0e10cSrcweir 95cdf0e10cSrcweir // lang::XInitialization 96cdf0e10cSrcweir 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); 97cdf0e10cSrcweir 98cdf0e10cSrcweir // ui::dialogs::XExecutableDialog 99cdf0e10cSrcweir virtual void SAL_CALL setTitle( const ::rtl::OUString& aTitle ) throw (::com::sun::star::uno::RuntimeException); 100cdf0e10cSrcweir virtual sal_Int16 SAL_CALL execute( ) throw (::com::sun::star::uno::RuntimeException); 101cdf0e10cSrcweir 102cdf0e10cSrcweir // beans::XPropertySet 103cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw (::com::sun::star::uno::RuntimeException); 104cdf0e10cSrcweir virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); 105cdf0e10cSrcweir virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); 106cdf0e10cSrcweir virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); 107cdf0e10cSrcweir virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); 108cdf0e10cSrcweir virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); 109cdf0e10cSrcweir virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); 110cdf0e10cSrcweir 111cdf0e10cSrcweir // lang::XComponent 112cdf0e10cSrcweir virtual void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException); 113cdf0e10cSrcweir virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & xListener ) throw (::com::sun::star::uno::RuntimeException); 114cdf0e10cSrcweir virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & xListener ) throw (::com::sun::star::uno::RuntimeException); 115cdf0e10cSrcweir 116cdf0e10cSrcweir private: 117cdf0e10cSrcweir //no default constructor 118cdf0e10cSrcweir ChineseTranslation_UnoDialog(); 119cdf0e10cSrcweir 120cdf0e10cSrcweir void impl_DeleteDialog(); 121cdf0e10cSrcweir 122cdf0e10cSrcweir private: 123cdf0e10cSrcweir ::com::sun::star::uno::Reference< 124cdf0e10cSrcweir ::com::sun::star::uno::XComponentContext> m_xCC; 125cdf0e10cSrcweir com::sun::star::uno::Reference< 126cdf0e10cSrcweir com::sun::star::awt::XWindow > m_xParentWindow; 127cdf0e10cSrcweir 128cdf0e10cSrcweir ChineseTranslationDialog* m_pDialog; 129cdf0e10cSrcweir 130cdf0e10cSrcweir sal_Bool m_bDisposed; ///Dispose call ready. 131cdf0e10cSrcweir sal_Bool m_bInDispose;///In dispose call 132cdf0e10cSrcweir osl::Mutex m_aContainerMutex; 133cdf0e10cSrcweir cppu::OInterfaceContainerHelper m_aDisposeEventListeners; 134cdf0e10cSrcweir }; 135cdf0e10cSrcweir 136cdf0e10cSrcweir //............................................................................. 137cdf0e10cSrcweir } //end namespace 138cdf0e10cSrcweir //............................................................................. 139cdf0e10cSrcweir #endif 140