Bump version to 24.04.3.4
[LibreOffice.git] / ucb / source / core / cmdenv.cxx
blob9189f0e0f0aad51577732e22bd59b37a5b542441
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
21 #include <cppuhelper/factory.hxx>
22 #include <cppuhelper/supportsservice.hxx>
23 #include <cppuhelper/weak.hxx>
24 #include <com/sun/star/lang/IllegalArgumentException.hpp>
26 #include "cmdenv.hxx"
28 /**************************************************************************
29 TODO
30 **************************************************************************
32 *************************************************************************/
33 using namespace com::sun::star;
34 using namespace ucb_cmdenv;
36 // UcbCommandEnvironment Implementation.
39 UcbCommandEnvironment::UcbCommandEnvironment()
44 // virtual
45 UcbCommandEnvironment::~UcbCommandEnvironment()
49 // XInitialization methods.
52 // virtual
53 void SAL_CALL UcbCommandEnvironment::initialize(
54 const uno::Sequence< uno::Any >& aArguments )
56 if ( ( aArguments.getLength() < 2 ) ||
57 !( aArguments[ 0 ] >>= m_xIH ) ||
58 !( aArguments[ 1 ] >>= m_xPH ))
59 throw lang::IllegalArgumentException();
63 // XServiceInfo methods.
66 // virtual
67 OUString SAL_CALL UcbCommandEnvironment::getImplementationName()
69 return "com.sun.star.comp.ucb.CommandEnvironment";
73 // virtual
74 sal_Bool SAL_CALL
75 UcbCommandEnvironment::supportsService( const OUString& ServiceName )
77 return cppu::supportsService(this, ServiceName);
81 // virtual
82 uno::Sequence< OUString > SAL_CALL
83 UcbCommandEnvironment::getSupportedServiceNames()
85 return { "com.sun.star.ucb.CommandEnvironment" };
89 // XCommandInfo methods.
92 // virtual
93 uno::Reference< task::XInteractionHandler > SAL_CALL
94 UcbCommandEnvironment::getInteractionHandler()
96 return m_xIH;
100 // virtual
101 uno::Reference< ucb::XProgressHandler > SAL_CALL
102 UcbCommandEnvironment::getProgressHandler()
104 return m_xPH;
108 // Service factory implementation.
110 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
111 ucb_UcbCommandEnvironment_get_implementation(
112 css::uno::XComponentContext* , css::uno::Sequence<css::uno::Any> const&)
114 return cppu::acquire(new UcbCommandEnvironment());
117 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */