1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
23 #include <com/sun/star/lang/XServiceInfo.hpp>
24 #include <com/sun/star/task/XJob.hpp>
25 #include <com/sun/star/lang/XInitialization.hpp>
26 #include <com/sun/star/xml/dom/XDocumentBuilder.hpp>
27 #include <com/sun/star/ucb/XSimpleFileAccess3.hpp>
28 #include <com/sun/star/ucb/XCommandEnvironment.hpp>
29 #include <com/sun/star/ucb/XProgressHandler.hpp>
31 #include <osl/mutex.hxx>
32 #include <cppuhelper/implbase.hxx>
34 namespace com::sun::star::uno
{ class XComponentContext
; }
42 typedef ::cppu::WeakImplHelper
<
43 css::lang::XServiceInfo
,
44 css::lang::XInitialization
,
45 css::task::XJob
> ExtensionMigration_BASE
;
47 class OO3ExtensionMigration
: public ExtensionMigration_BASE
50 css::uno::Reference
< css::uno::XComponentContext
> m_ctx
;
51 css::uno::Reference
< css::xml::dom::XDocumentBuilder
> m_xDocBuilder
;
52 css::uno::Reference
< css::ucb::XSimpleFileAccess3
> m_xSimpleFileAccess
;
53 ::osl::Mutex m_aMutex
;
54 OUString m_sSourceDir
;
55 OUString m_sTargetDir
;
56 TStringVector m_aDenyList
;
61 SCANRESULT_MIGRATE_EXTENSION
,
62 SCANRESULT_DONTMIGRATE_EXTENSION
65 ScanResult
scanExtensionFolder( const OUString
& sExtFolder
);
66 void scanUserExtensions( const OUString
& sSourceDir
, TStringVector
& aMigrateExtensions
);
67 bool scanDescriptionXml( const OUString
& sDescriptionXmlFilePath
);
68 void migrateExtension( const OUString
& sSourceDir
);
71 explicit OO3ExtensionMigration(css::uno::Reference
<
72 css::uno::XComponentContext
> const & ctx
);
73 virtual ~OO3ExtensionMigration() override
;
76 virtual OUString SAL_CALL
getImplementationName() override
;
77 virtual sal_Bool SAL_CALL
supportsService( const OUString
& rServiceName
) override
;
78 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames() override
;
81 virtual void SAL_CALL
initialize( const css::uno::Sequence
< css::uno::Any
>& aArguments
) override
;
84 virtual css::uno::Any SAL_CALL
execute(
85 const css::uno::Sequence
< css::beans::NamedValue
>& Arguments
) override
;
88 class TmpRepositoryCommandEnv
89 : public ::cppu::WeakImplHelper
< css::ucb::XCommandEnvironment
,
90 css::task::XInteractionHandler
,
91 css::ucb::XProgressHandler
>
94 virtual ~TmpRepositoryCommandEnv() override
;
95 TmpRepositoryCommandEnv();
97 // XCommandEnvironment
98 virtual css::uno::Reference
< css::task::XInteractionHandler
> SAL_CALL
99 getInteractionHandler() override
;
100 virtual css::uno::Reference
< css::ucb::XProgressHandler
>
101 SAL_CALL
getProgressHandler() override
;
103 // XInteractionHandler
104 virtual void SAL_CALL
handle(
105 css::uno::Reference
< css::task::XInteractionRequest
> const & xRequest
) override
;
108 virtual void SAL_CALL
push( css::uno::Any
const & Status
) override
;
109 virtual void SAL_CALL
update( css::uno::Any
const & Status
) override
;
110 virtual void SAL_CALL
pop() override
;
114 } // namespace migration
117 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */