forked from Floorp-Projects/Floorp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnsCUPSShim.h
52 lines (44 loc) · 1.64 KB
/
nsCUPSShim.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ex: set tabstop=8 softtabstop=4 shiftwidth=4 expandtab: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef nsCUPSShim_h___
#define nsCUPSShim_h___
#include <cups/cups.h>
struct PRLibrary;
/* Note: this class relies on static initialization. */
class nsCUPSShim {
public:
/**
* Initialize this object. Attempt to load the CUPS shared
* library and find function pointers for the supported
* functions (see below).
* @return false if the shared library could not be loaded, or if
* any of the functions could not be found.
* true for successful initialization.
*/
bool Init();
/**
* @return true if the object was initialized successfully.
* false otherwise.
*/
bool IsInitialized() const { return mInited; }
/* Function pointers for supported functions. These are only
* valid after successful initialization.
*/
decltype(cupsAddOption)* mCupsAddOption;
decltype(cupsCheckDestSupported)* mCupsCheckDestSupported;
decltype(cupsCopyDest)* mCupsCopyDest;
decltype(cupsCopyDestInfo)* mCupsCopyDestInfo;
decltype(cupsFreeDestInfo)* mCupsFreeDestInfo;
decltype(cupsFreeDests)* mCupsFreeDests;
decltype(cupsGetDest)* mCupsGetDest;
decltype(cupsGetDests)* mCupsGetDests;
decltype(cupsPrintFile)* mCupsPrintFile;
decltype(cupsTempFd)* mCupsTempFd;
private:
bool mInited = false;
PRLibrary* mCupsLib;
};
#endif /* nsCUPSShim_h___ */