1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 #ifndef _NUMUNO_HXX 28 #define _NUMUNO_HXX 29 30 #include "svl/svldllapi.h" 31 #include <com/sun/star/util/XNumberFormatsSupplier.hpp> 32 #include <com/sun/star/lang/XUnoTunnel.hpp> 33 #include <cppuhelper/implbase2.hxx> 34 35 class SvNumberFormatter; 36 class SvNumFmtSuppl_Impl; 37 38 namespace comphelper 39 { 40 class SharedMutex; 41 } 42 43 //------------------------------------------------------------------ 44 45 // SvNumberFormatterServiceObj must be registered as service somewhere 46 47 com::sun::star::uno::Reference<com::sun::star::uno::XInterface> SAL_CALL 48 SvNumberFormatterServiceObj_NewInstance( 49 const com::sun::star::uno::Reference< 50 com::sun::star::lang::XMultiServiceFactory>& rSMgr ); 51 52 //------------------------------------------------------------------ 53 54 // SvNumberFormatsSupplierObj: aggregate to document, 55 // construct with SvNumberFormatter 56 57 class SVL_DLLPUBLIC SvNumberFormatsSupplierObj : public cppu::WeakAggImplHelper2< 58 com::sun::star::util::XNumberFormatsSupplier, 59 com::sun::star::lang::XUnoTunnel> 60 { 61 private: 62 SvNumFmtSuppl_Impl* pImpl; 63 64 public: 65 SvNumberFormatsSupplierObj(); 66 SvNumberFormatsSupplierObj(SvNumberFormatter* pForm); 67 virtual ~SvNumberFormatsSupplierObj(); 68 69 void SetNumberFormatter(SvNumberFormatter* pNew); 70 SvNumberFormatter* GetNumberFormatter() const; 71 72 // ueberladen, um Attribute im Dokument anzupassen 73 virtual void NumberFormatDeleted(sal_uInt32 nKey); 74 // ueberladen, um evtl. neu zu formatieren 75 virtual void SettingsChanged(); 76 77 // XNumberFormatsSupplier 78 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL 79 getNumberFormatSettings() 80 throw(::com::sun::star::uno::RuntimeException); 81 virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormats > SAL_CALL 82 getNumberFormats() 83 throw(::com::sun::star::uno::RuntimeException); 84 85 // XUnoTunnel 86 virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< 87 sal_Int8 >& aIdentifier ) 88 throw(::com::sun::star::uno::RuntimeException); 89 90 static const com::sun::star::uno::Sequence<sal_Int8>& getUnoTunnelId(); 91 static SvNumberFormatsSupplierObj* getImplementation( const com::sun::star::uno::Reference< 92 com::sun::star::util::XNumberFormatsSupplier> xObj ); 93 94 ::comphelper::SharedMutex& getSharedMutex() const; 95 }; 96 97 #endif // #ifndef _NUMUNO_HXX 98 99 100