Version 6.1.4.1, tag libreoffice-6.1.4.1
[LibreOffice.git] / vcl / inc / unx / geninst.h
blobaf97a2d9ba83f957c1f9fec115140afa3dc22b92
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/.
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 .
20 #ifndef INCLUDED_VCL_INC_GENERIC_GENINST_H
21 #define INCLUDED_VCL_INC_GENERIC_GENINST_H
23 #include <comphelper/solarmutex.hxx>
24 #include <tools/solar.h>
25 #include <osl/thread.hxx>
26 #include <vclpluginapi.h>
27 #include <salinst.hxx>
28 #include <saldatabasic.hxx>
29 #include <unx/genprn.h>
31 class VCL_DLLPUBLIC SalYieldMutex : public comphelper::GenericSolarMutex
33 public:
34 SalYieldMutex();
35 virtual ~SalYieldMutex() override;
39 * Abstract generic class to build vclplugin's instance classes from
41 class GenPspGraphics;
42 class PhysicalFontCollection;
43 class VCL_DLLPUBLIC SalGenericInstance : public SalInstance
45 protected:
46 bool mbPrinterInit;
47 std::unique_ptr<SalYieldMutex> mpSalYieldMutex;
49 public:
50 SalGenericInstance( SalYieldMutex* pMutex )
51 : mbPrinterInit( false ), mpSalYieldMutex( pMutex ) {}
52 virtual ~SalGenericInstance() override;
54 // Yield mutex
55 virtual comphelper::SolarMutex* GetYieldMutex() override;
56 virtual sal_uInt32 ReleaseYieldMutexAll() override;
57 virtual void AcquireYieldMutex( sal_uInt32 nCount = 1 ) override;
59 // Printing
60 virtual SalInfoPrinter* CreateInfoPrinter ( SalPrinterQueueInfo* pQueueInfo,
61 ImplJobSetup* pSetupData ) override;
62 virtual void DestroyInfoPrinter ( SalInfoPrinter* pPrinter ) override;
63 virtual SalPrinter* CreatePrinter ( SalInfoPrinter* pInfoPrinter ) override;
64 virtual void DestroyPrinter ( SalPrinter* pPrinter ) override;
65 virtual void GetPrinterQueueInfo ( ImplPrnQueueList* pList ) override;
66 virtual void GetPrinterQueueState ( SalPrinterQueueInfo* pInfo ) override;
67 virtual void DeletePrinterQueueInfo ( SalPrinterQueueInfo* pInfo ) override;
68 virtual OUString GetDefaultPrinter() override;
69 virtual void PostPrintersChanged() = 0;
70 virtual void updatePrinterUpdate() override;
71 virtual void jobStartedPrinterUpdate() override;
72 virtual void jobEndedPrinterUpdate() override;
73 bool isPrinterInit() const { return mbPrinterInit; }
74 virtual GenPspGraphics *CreatePrintGraphics() = 0;
76 virtual OUString getOSVersion() override;
78 // prolly belongs somewhere else ... just a font help
79 static void RegisterFontSubstitutors( PhysicalFontCollection* pFontCollection );
81 protected:
82 static void configurePspInfoPrinter( PspSalInfoPrinter* pInfoPrinter,
83 SalPrinterQueueInfo const * pQueueInfo,
84 ImplJobSetup* pSetupData );
87 inline SalGenericInstance *GetGenericInstance()
89 return static_cast<SalGenericInstance *>(GetSalData()->m_pInstance);
92 #endif // INCLUDED_VCL_INC_GENERIC_GENINST_H
94 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */