LibreOffice Module vcl (master) 1
geninst.h
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#pragma once
21
22#include <sal/config.h>
23
24#include <memory>
26#include <salinst.hxx>
27#include <svdata.hxx>
28#include <unx/genprn.h>
29
31{
32public:
34 virtual ~SalYieldMutex() override;
35};
36
37/*
38 * Abstract generic class to build vclplugin's instance classes from
39 */
40class GenPspGraphics;
41namespace vcl::font
42{
43 class PhysicalFontCollection;
44}
45
47{
48protected:
50
51public:
52 SalGenericInstance( std::unique_ptr<comphelper::SolarMutex> pMutex )
53 : SalInstance(std::move(pMutex)), mbPrinterInit(false) {}
54 virtual ~SalGenericInstance() override;
55
56 // Printing
58 ImplJobSetup* pSetupData ) override;
59 virtual void DestroyInfoPrinter ( SalInfoPrinter* pPrinter ) override;
60 virtual std::unique_ptr<SalPrinter> CreatePrinter ( SalInfoPrinter* pInfoPrinter ) override;
61 virtual void GetPrinterQueueInfo ( ImplPrnQueueList* pList ) override;
62 virtual void GetPrinterQueueState ( SalPrinterQueueInfo* pInfo ) override;
63 virtual OUString GetDefaultPrinter() override;
64 virtual void PostPrintersChanged() = 0;
65 virtual void updatePrinterUpdate() override;
66 virtual void jobStartedPrinterUpdate() override;
67 virtual void jobEndedPrinterUpdate() override;
68 bool isPrinterInit() const { return mbPrinterInit; }
69 virtual std::unique_ptr<GenPspGraphics> CreatePrintGraphics() = 0;
70
71 virtual OUString getOSVersion() override;
72
73 // prolly belongs somewhere else ... just a font help
75
76protected:
77 static void configurePspInfoPrinter( PspSalInfoPrinter* pInfoPrinter,
78 SalPrinterQueueInfo const * pQueueInfo,
79 ImplJobSetup* pSetupData );
80};
81
83{
84 return static_cast<SalGenericInstance*>(GetSalInstance());
85}
86
87/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void updatePrinterUpdate() override
virtual void jobEndedPrinterUpdate() override
virtual void jobStartedPrinterUpdate() override
virtual void DestroyInfoPrinter(SalInfoPrinter *pPrinter) override
virtual void GetPrinterQueueState(SalPrinterQueueInfo *pInfo) override
SalGenericInstance(std::unique_ptr< comphelper::SolarMutex > pMutex)
Definition: geninst.h:52
virtual OUString GetDefaultPrinter() override
virtual SalInfoPrinter * CreateInfoPrinter(SalPrinterQueueInfo *pQueueInfo, ImplJobSetup *pSetupData) override
bool mbPrinterInit
Definition: geninst.h:49
bool isPrinterInit() const
Definition: geninst.h:68
static void RegisterFontSubstitutors(vcl::font::PhysicalFontCollection *pFontCollection)
virtual OUString getOSVersion() override
get information about underlying versions
virtual std::unique_ptr< GenPspGraphics > CreatePrintGraphics()=0
virtual std::unique_ptr< SalPrinter > CreatePrinter(SalInfoPrinter *pInfoPrinter) override
virtual void PostPrintersChanged()=0
virtual void GetPrinterQueueInfo(ImplPrnQueueList *pList) override
virtual ~SalGenericInstance() override
static void configurePspInfoPrinter(PspSalInfoPrinter *pInfoPrinter, SalPrinterQueueInfo const *pQueueInfo, ImplJobSetup *pSetupData)
virtual ~SalYieldMutex() override
#define VCL_DLLPUBLIC
Definition: dllapi.h:29
SalGenericInstance * GetGenericInstance()
Definition: geninst.h:82
A PhysicalFontFaceCollection is created by a PhysicalFontCollection and becomes invalid when original...
SalInstance * GetSalInstance()
Definition: svdata.hxx:474