20#ifndef INCLUDED_VCL_INC_UNX_CPDMGR_HXX
21#define INCLUDED_VCL_INC_UNX_CPDMGR_HXX
23#include <config_dbus.h>
24#include <config_gio.h>
26#if ENABLE_DBUS && ENABLE_GIO
36#define BACKEND_DIR "/usr/share/print-backends"
37#define FRONTEND_INTERFACE "/usr/share/dbus-1/interfaces/org.openprinting.Frontend.xml"
38#define BACKEND_INTERFACE "/usr/share/dbus-1/interfaces/org.openprinting.Backend.xml"
60#if ENABLE_DBUS && ENABLE_GIO
62 bool m_aPrintersChanged =
true;
63 std::vector<std::pair<std::string, gchar*>> m_tBackends;
64 std::unordered_map< std::string, GDBusProxy * > m_pBackends;
65 std::unordered_map< FILE*, OString, FPtrHash > m_aSpoolFiles;
66 std::unordered_map< OUString, CPDPrinter * > m_aCPDDestMap;
67 std::unordered_map< OUString, PPDContext > m_aDefaultContexts;
75#if ENABLE_DBUS && ENABLE_GIO
76 static void onNameAcquired(
GDBusConnection *connection,
const gchar* name, gpointer user_data);
77 static void onNameLost (
GDBusConnection *,
const gchar *name, gpointer);
79 const gchar *sender_name,
80 const gchar *object_path,
81 const gchar *interface_name,
82 const gchar *signal_name,
86 const gchar *sender_name,
87 const gchar *object_path,
88 const gchar *interface_name,
89 const gchar *signal_name,
93 static void getOptionsFromDocumentSetup(
const JobData& rJob,
bool bBanner,
const OString& rJobName,
int& rNumOptions, GVariant **arr );
97#if ENABLE_DBUS && ENABLE_GIO
99 GDBusProxy* getProxy(
const std::string& target);
100 void addBackend( std::pair< std::string, GDBusProxy * > pair );
101 void addTempBackend(
const std::pair<std::string, gchar*>& pair);
102 std::vector<std::pair<std::string, gchar*>>
const & getTempBackends()
const;
103 void addNewPrinter(
const OUString&,
const OUString&,
CPDPrinter * );
113 virtual FILE*
startSpool(
const OUString& rPrinterName,
bool bQuickCommand )
override;
114 virtual bool endSpool(
const OUString& rPrinterName,
const OUString& rJobTitle, FILE* pFile,
const JobData& rDocumentJobData,
bool bBanner,
const OUString& rFaxNumber )
override;
virtual void initialize() override
virtual bool endSpool(const OUString &rPrinterName, const OUString &rJobTitle, FILE *pFile, const JobData &rDocumentJobData, bool bBanner, const OUString &rFaxNumber) override
virtual FILE * startSpool(const OUString &rPrinterName, bool bQuickCommand) override
virtual void setupJobContextData(JobData &rData) override
virtual ~CPDManager() override
virtual bool checkPrintersChanged(bool bWait) override
const PPDParser * createCPDParser(const OUString &rPrinter)
static CPDManager * tryLoadCPD()
struct _GDBusProxy GDBusProxy
struct _GDBusConnection GDBusConnection
const char * make_and_model
const char * backend_name
const char * printer_state