/src/libreoffice/vcl/inc/unx/gendata.hxx
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 | | |
10 | | #pragma once |
11 | | |
12 | | #include <svdata.hxx> |
13 | | |
14 | | #include <memory> |
15 | | |
16 | | #ifndef IOS |
17 | | class FreetypeManager; |
18 | | |
19 | | namespace psp |
20 | | { |
21 | | class PrintFontManager; |
22 | | class PrinterInfoManager; |
23 | | } |
24 | | |
25 | | // SalData is a bit of a mess. For ImplSVData we need a SalData base class. |
26 | | // Windows, MacOS and iOS implement their own SalData class, so there is no |
27 | | // way to do inheritance from the "top" in all plugins. We also really don't |
28 | | // want to rename GenericUnixSalData and don't want to reinterpret_cast some |
29 | | // dummy pointer everywhere, so this seems the only sensible solution. |
30 | | class VCL_PLUGIN_PUBLIC SalData |
31 | | { |
32 | | protected: |
33 | | SalData(); |
34 | | |
35 | | public: |
36 | | virtual ~SalData(); |
37 | | }; |
38 | | |
39 | | #endif |
40 | | |
41 | | // This class is kind of a misnomer. What this class is mainly about is the |
42 | | // usage of Freetype and Fontconfig, which happens to match all *nix backends; |
43 | | // except that the osx and ios backends are *nix but don't use this. |
44 | | class VCL_PLUGIN_PUBLIC GenericUnixSalData : public SalData |
45 | | { |
46 | | #ifndef IOS |
47 | | friend class ::psp::PrinterInfoManager; |
48 | | |
49 | | std::unique_ptr<FreetypeManager> m_pFreetypeManager; |
50 | | std::unique_ptr<psp::PrintFontManager> m_pPrintFontManager; |
51 | | std::unique_ptr<psp::PrinterInfoManager> m_pPrinterInfoManager; |
52 | | #endif |
53 | | |
54 | | public: |
55 | | GenericUnixSalData(); |
56 | | virtual ~GenericUnixSalData() override; |
57 | | |
58 | | #ifndef IOS |
59 | | FreetypeManager* GetFreetypeManager(); |
60 | | psp::PrintFontManager* GetPrintFontManager(); |
61 | | #endif |
62 | | }; |
63 | | |
64 | | inline GenericUnixSalData* GetGenericUnixSalData() |
65 | 142k | { |
66 | 142k | return static_cast<GenericUnixSalData*>(GetSalData()); |
67 | 142k | } |
68 | | |
69 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |