merge the formfield patch from ooo-build
[ooovba.git] / desktop / source / migration / services / autocorrmigration.hxx
blob669ff5830c71b94bde07c1c455461fd16a3006a8
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: autocorrmigration.hxx,v $
10 * $Revision: 1.4 $
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 _DESKTOP_AUTOCORRMIGRATION_HXX_
32 #define _DESKTOP_AUTOCORRMIGRATION_HXX_
34 #include "misc.hxx"
35 #include <com/sun/star/lang/XServiceInfo.hpp>
36 #include <com/sun/star/lang/XInitialization.hpp>
37 #include <com/sun/star/task/XJob.hpp>
38 #include <com/sun/star/uno/XComponentContext.hpp>
39 #include <cppuhelper/implbase3.hxx>
40 #include <osl/mutex.hxx>
41 #include <osl/file.hxx>
44 class INetURLObject;
47 //.........................................................................
48 namespace migration
50 //.........................................................................
52 ::rtl::OUString SAL_CALL AutocorrectionMigration_getImplementationName();
53 ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL AutocorrectionMigration_getSupportedServiceNames();
54 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL AutocorrectionMigration_create(
55 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & xContext )
56 SAL_THROW( (::com::sun::star::uno::Exception) );
59 // =============================================================================
60 // class AutocorrectionMigration
61 // =============================================================================
63 typedef ::cppu::WeakImplHelper3<
64 ::com::sun::star::lang::XServiceInfo,
65 ::com::sun::star::lang::XInitialization,
66 ::com::sun::star::task::XJob > AutocorrectionMigration_BASE;
68 class AutocorrectionMigration : public AutocorrectionMigration_BASE
70 private:
71 ::osl::Mutex m_aMutex;
72 ::rtl::OUString m_sSourceDir;
74 TStringVectorPtr getFiles( const ::rtl::OUString& rBaseURL ) const;
75 ::osl::FileBase::RC checkAndCreateDirectory( INetURLObject& rDirURL );
76 void copyFiles();
78 public:
79 AutocorrectionMigration();
80 virtual ~AutocorrectionMigration();
82 // XServiceInfo
83 virtual ::rtl::OUString SAL_CALL getImplementationName()
84 throw (::com::sun::star::uno::RuntimeException);
85 virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& rServiceName )
86 throw (::com::sun::star::uno::RuntimeException);
87 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
88 throw (::com::sun::star::uno::RuntimeException);
90 // XInitialization
91 virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments )
92 throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
94 // XJob
95 virtual ::com::sun::star::uno::Any SAL_CALL execute(
96 const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& Arguments )
97 throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::Exception,
98 ::com::sun::star::uno::RuntimeException);
101 //.........................................................................
102 } // namespace migration
103 //.........................................................................
105 #endif // _DESKTOP_AUTOCORRMIGRATION_HXX_