LibreOffice Module connectivity (master) 1
MMozillaBootstrap.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#include <com/sun/star/lang/XMultiServiceFactory.hpp>
22#include <com/sun/star/lang/XSingleServiceFactory.hpp>
24#include <cppuhelper/weak.hxx>
25#include "MMozillaBootstrap.hxx"
27
28using namespace com::sun::star::uno;
29using namespace com::sun::star::lang;
30using namespace com::sun::star::mozilla;
31using namespace connectivity::mozab;
32
33using ::com::sun::star::uno::Reference;
34using ::com::sun::star::uno::Sequence;
35
36MozillaBootstrap::MozillaBootstrap()
38{
40 bootupProfile(css::mozilla::MozillaProductType_Mozilla,OUString());
41}
42
44{
45}
46
48{
49 ::osl::MutexGuard aGuard(m_aMutex);
50 OMozillaBootstrap_BASE::disposing();
51}
52
54{
55 return "com.sun.star.comp.mozilla.MozillaBootstrap";
56}
57
58sal_Bool SAL_CALL MozillaBootstrap::supportsService( const OUString& _rServiceName )
59{
60 return cppu::supportsService(this, _rServiceName);
61}
62
64{
65 // which service is supported
66 // for more information @see com.sun.star.mozilla.MozillaBootstrap
67 return { "com.sun.star.mozilla.MozillaBootstrap" };
68}
69
70
71// XProfileDiscover
72::sal_Int32 SAL_CALL MozillaBootstrap::getProfileCount( css::mozilla::MozillaProductType product)
73{
74 return m_ProfileAccess->getProfileCount(product);
75}
76::sal_Int32 SAL_CALL MozillaBootstrap::getProfileList( css::mozilla::MozillaProductType product, css::uno::Sequence< OUString >& list )
77{
78 return m_ProfileAccess->getProfileList(product,list);
79}
80OUString SAL_CALL MozillaBootstrap::getDefaultProfile( css::mozilla::MozillaProductType product )
81{
82 return m_ProfileAccess->getDefaultProfile(product);
83}
84OUString SAL_CALL MozillaBootstrap::getProfilePath( css::mozilla::MozillaProductType product, const OUString& profileName )
85{
86 return m_ProfileAccess->getProfilePath(product,profileName);
87}
88sal_Bool SAL_CALL MozillaBootstrap::isProfileLocked( css::mozilla::MozillaProductType /*product*/, const OUString& /*profileName*/ )
89{
90 return true;
91}
92sal_Bool SAL_CALL MozillaBootstrap::getProfileExists( css::mozilla::MozillaProductType product, const OUString& profileName )
93{
94 return m_ProfileAccess->getProfileExists(product,profileName);
95}
96
97// XProfileManager
98::sal_Int32 SAL_CALL MozillaBootstrap::bootupProfile( css::mozilla::MozillaProductType, const OUString& )
99{
100 return -1;
101}
103{
104 return -1;
105}
106css::mozilla::MozillaProductType SAL_CALL MozillaBootstrap::getCurrentProduct( )
107{
108 return css::mozilla::MozillaProductType_Default;
109}
111{
112 return OUString();
113}
115{
116 return true;
117}
118OUString SAL_CALL MozillaBootstrap::setCurrentProfile( css::mozilla::MozillaProductType, const OUString& )
119{
120 return OUString();
121}
122
123// XProxyRunner
124::sal_Int32 SAL_CALL MozillaBootstrap::Run( const css::uno::Reference< css::mozilla::XCodeProxy >& )
125{
126 return -1;
127}
128
129extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
131 css::uno::XComponentContext* , css::uno::Sequence<css::uno::Any> const&)
132{
133 return cppu::acquire(new connectivity::mozab::MozillaBootstrap());
134}
135
136/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * connectivity_moz_MozillaBootstrap_get_implementation(css::uno::XComponentContext *, css::uno::Sequence< css::uno::Any > const &)
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual OUString SAL_CALL setCurrentProfile(css::mozilla::MozillaProductType product, const OUString &profileName) override
virtual sal_Bool SAL_CALL getProfileExists(css::mozilla::MozillaProductType product, const OUString &profileName) override
virtual sal_Bool SAL_CALL isProfileLocked(css::mozilla::MozillaProductType product, const OUString &profileName) override
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
virtual ::sal_Int32 SAL_CALL shutdownProfile() override
virtual OUString SAL_CALL getDefaultProfile(css::mozilla::MozillaProductType product) override
virtual OUString SAL_CALL getCurrentProfile() override
virtual css::mozilla::MozillaProductType SAL_CALL getCurrentProduct() override
virtual sal_Bool SAL_CALL isCurrentProfileLocked() override
virtual OUString SAL_CALL getImplementationName() override
virtual ::sal_Int32 SAL_CALL bootupProfile(css::mozilla::MozillaProductType product, const OUString &profileName) override
virtual ::sal_Int32 SAL_CALL Run(const css::uno::Reference< css::mozilla::XCodeProxy > &aCode) override
virtual OUString SAL_CALL getProfilePath(css::mozilla::MozillaProductType product, const OUString &profileName) override
virtual ::sal_Int32 SAL_CALL getProfileList(css::mozilla::MozillaProductType product, css::uno::Sequence< OUString > &list) override
std::unique_ptr< ProfileAccess > m_ProfileAccess
virtual void SAL_CALL disposing() override
virtual ::sal_Int32 SAL_CALL getProfileCount(css::mozilla::MozillaProductType product) override
std::mutex m_aMutex
::cppu::WeakComponentImplHelper< css::mozilla::XMozillaBootstrap, css::lang::XServiceInfo > OMozillaBootstrap_BASE
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
unsigned char sal_Bool