Simplify using designated initializers
[LibreOffice.git] / avmedia / source / gtk / gtkmanager.cxx
blobfe823c1f49edd067719aa79edf3377bcf1feb168
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
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/.
8 */
10 #include <cppuhelper/supportsservice.hxx>
12 #include "gtkmanager.hxx"
13 #include "gtkplayer.hxx"
15 #include <tools/urlobj.hxx>
16 #include <rtl/ref.hxx>
18 using namespace ::com::sun::star;
20 namespace avmedia::gtk
22 Manager::Manager() {}
24 Manager::~Manager() {}
26 uno::Reference<media::XPlayer> SAL_CALL Manager::createPlayer(const OUString& rURL)
28 const INetURLObject aURL(rURL);
29 OUString sMainURL = aURL.GetMainURL(INetURLObject::DecodeMechanism::Unambiguous);
31 rtl::Reference<GtkPlayer> xPlayer(new GtkPlayer);
32 if (!xPlayer->create(sMainURL))
33 xPlayer.clear();
34 return xPlayer;
37 OUString SAL_CALL Manager::getImplementationName() { return "com.sun.star.comp.media.Manager_Gtk"; }
39 sal_Bool SAL_CALL Manager::supportsService(const OUString& ServiceName)
41 return cppu::supportsService(this, ServiceName);
44 uno::Sequence<OUString> SAL_CALL Manager::getSupportedServiceNames()
46 return { "com.sun.star.media.Manager" };
49 } // namespace
51 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
52 com_sun_star_comp_media_Manager_Gtk_get_implementation(css::uno::XComponentContext*,
53 css::uno::Sequence<css::uno::Any> const&)
55 return cppu::acquire(new avmedia::gtk::Manager());
58 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */