/src/libreoffice/vcl/headless/headlessinst.cxx
Line | Count | Source |
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 | | #include <headless/svpinst.hxx> |
10 | | #include <headless/svpdummies.hxx> |
11 | | #include <headless/svpdata.hxx> |
12 | | #include <staticsalinstance.hxx> |
13 | | #include <unistd.h> |
14 | | |
15 | | namespace { |
16 | | |
17 | | class HeadlessSalInstance : public SvpSalInstance |
18 | | { |
19 | | public: |
20 | | explicit HeadlessSalInstance(std::unique_ptr<SalYieldMutex> pMutex); |
21 | | |
22 | | virtual SalSystem* CreateSalSystem() override; |
23 | | }; |
24 | | |
25 | | HeadlessSalInstance::HeadlessSalInstance(std::unique_ptr<SalYieldMutex> pMutex) |
26 | 0 | : SvpSalInstance(std::move(pMutex)) |
27 | 0 | { |
28 | 0 | } |
29 | | |
30 | | class HeadlessSalSystem : public SvpSalSystem { |
31 | | public: |
32 | 0 | HeadlessSalSystem() : SvpSalSystem() {} |
33 | | virtual int ShowNativeDialog( const OUString& rTitle, |
34 | | const OUString& rMessage, |
35 | | const std::vector< OUString >& ) override |
36 | 0 | { |
37 | 0 | SAL_INFO("vcl.headless", |
38 | 0 | "LibreOffice - dialog '" |
39 | 0 | << rTitle << "': '" |
40 | 0 | << rMessage << "'"); |
41 | 0 | return 0; |
42 | 0 | } |
43 | | }; |
44 | | |
45 | | SalSystem *HeadlessSalInstance::CreateSalSystem() |
46 | 0 | { |
47 | 0 | return new HeadlessSalSystem(); |
48 | 0 | } |
49 | | |
50 | | } |
51 | | |
52 | | extern "C" SalInstance *create_SalInstance() |
53 | 0 | { |
54 | 0 | HeadlessSalInstance* pInstance = new HeadlessSalInstance(std::make_unique<SvpSalYieldMutex>()); |
55 | 0 | new SvpSalData(); |
56 | 0 | return pInstance; |
57 | 0 | } |
58 | | |
59 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |