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 .
21 #include <cppuhelper/factory.hxx>
22 #include <cppuhelper/supportsservice.hxx>
23 #include <cppuhelper/weak.hxx>
24 #include <com/sun/star/lang/IllegalArgumentException.hpp>
28 /**************************************************************************
30 **************************************************************************
32 *************************************************************************/
33 using namespace com::sun::star
;
34 using namespace ucb_cmdenv
;
36 // UcbCommandEnvironment Implementation.
39 UcbCommandEnvironment::UcbCommandEnvironment()
45 UcbCommandEnvironment::~UcbCommandEnvironment()
49 // XInitialization methods.
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.
67 OUString SAL_CALL
UcbCommandEnvironment::getImplementationName()
69 return "com.sun.star.comp.ucb.CommandEnvironment";
75 UcbCommandEnvironment::supportsService( const OUString
& ServiceName
)
77 return cppu::supportsService(this, ServiceName
);
82 uno::Sequence
< OUString
> SAL_CALL
83 UcbCommandEnvironment::getSupportedServiceNames()
85 return { "com.sun.star.ucb.CommandEnvironment" };
89 // XCommandInfo methods.
93 uno::Reference
< task::XInteractionHandler
> SAL_CALL
94 UcbCommandEnvironment::getInteractionHandler()
101 uno::Reference
< ucb::XProgressHandler
> SAL_CALL
102 UcbCommandEnvironment::getProgressHandler()
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: */