diff options
author | Xisco Fauli <anistenis@gmail.com> | 2016-05-02 19:07:23 +0200 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2016-06-24 23:01:04 +0000 |
commit | 0325b22a2a2b537a71f53b7c5d3e6c13fef68911 (patch) | |
tree | 185ce849074b367c8005abb704fc4c7f271fca00 /vcl/inc | |
parent | 46773b0b59bb9061c5f5660e65e4ebc0d455fe02 (diff) |
tdf#62525 vcl: use cow_wrapper for jobset
Besides:
* Convert ImplJobSetup to be a class.
* Use ImplJobSetup's setters and getters everywhere
* add some const-correctness at places
Change-Id: I32101048e9be4f3950a4540b0666ed548bbcb211
Reviewed-on: https://gerrit.libreoffice.org/24594
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'vcl/inc')
-rw-r--r-- | vcl/inc/jobset.h | 55 | ||||
-rw-r--r-- | vcl/inc/salinst.hxx | 2 | ||||
-rw-r--r-- | vcl/inc/salprn.hxx | 2 | ||||
-rw-r--r-- | vcl/inc/unx/geninst.h | 4 |
4 files changed, 53 insertions, 10 deletions
diff --git a/vcl/inc/jobset.h b/vcl/inc/jobset.h index 09480202dccb..db833018f905 100644 --- a/vcl/inc/jobset.h +++ b/vcl/inc/jobset.h @@ -29,13 +29,9 @@ #define JOBSETUP_SYSTEM_UNIX 3 #define JOBSETUP_SYSTEM_MAC 4 -struct ImplJobSetup +class ImplJobSetup { - ImplJobSetup(); - ImplJobSetup( const ImplJobSetup& rJobSetup ); - ~ImplJobSetup(); - - sal_uInt16 mnRefCount; //< RefCount (only independent data) +private: sal_uInt16 mnSystem; //< System - JOBSETUP_SYSTEM_xxxx OUString maPrinterName; //< Printer-Name OUString maDriver; //< Driver-Name @@ -49,6 +45,53 @@ struct ImplJobSetup sal_uInt8* mpDriverData; //< system specific data (will be streamed a byte block) bool mbPapersizeFromSetup; std::unordered_map< OUString, OUString, OUStringHash > maValueMap; + +public: + ImplJobSetup(); + ImplJobSetup( const ImplJobSetup& rJobSetup ); + ~ImplJobSetup(); + + bool operator==( const ImplJobSetup& rImplJobSetup ) const; + + sal_uInt16 GetSystem() const { return mnSystem; } + void SetSystem(sal_uInt16 nSystem); + + const OUString& GetPrinterName() const { return maPrinterName; } + void SetPrinterName(const OUString& rPrinterName); + + const OUString& GetDriver() const { return maDriver; } + void SetDriver(const OUString& rDriver); + + Orientation GetOrientation() const { return meOrientation; } + void SetOrientation(Orientation eOrientation); + + DuplexMode GetDuplexMode() const { return meDuplexMode; } + void SetDuplexMode(DuplexMode eDuplexMode); + + sal_uInt16 GetPaperBin() const { return mnPaperBin; } + void SetPaperBin(sal_uInt16 nPaperBin); + + Paper GetPaperFormat() const { return mePaperFormat; } + void SetPaperFormat(Paper ePaperFormat); + + long GetPaperWidth() const { return mnPaperWidth; } + void SetPaperWidth(long nWidth); + + long GetPaperHeight() const { return mnPaperHeight; } + void SetPaperHeight(long nHeight); + + sal_uInt32 GetDriverDataLen() const { return mnDriverDataLen; } + void SetDriverDataLen(sal_uInt32 nDriverDataLen); + + const sal_uInt8* GetDriverData() const { return mpDriverData; } + void SetDriverData(sal_uInt8* pDriverData); + + bool GetPapersizeFromSetup() const { return mbPapersizeFromSetup; } + void SetPapersizeFromSetup(bool bPapersizeFromSetup); + + const std::unordered_map< OUString, OUString, OUStringHash >& GetValueMap() const + { return maValueMap; } + void SetValueMap(const OUString& rKey, const OUString& rValue); }; // If paper format is PAPER_USER, in the system-independent part it will diff --git a/vcl/inc/salinst.hxx b/vcl/inc/salinst.hxx index 21f7be27711f..c86d1f31c1a5 100644 --- a/vcl/inc/salinst.hxx +++ b/vcl/inc/salinst.hxx @@ -35,7 +35,7 @@ namespace comphelper { class SolarMutex; } struct SystemParentData; struct SalPrinterQueueInfo; -struct ImplJobSetup; +class ImplJobSetup; class OpenGLContext; class SalGraphics; class SalFrame; diff --git a/vcl/inc/salprn.hxx b/vcl/inc/salprn.hxx index beafef246ffa..54726847e94e 100644 --- a/vcl/inc/salprn.hxx +++ b/vcl/inc/salprn.hxx @@ -28,7 +28,7 @@ class SalGraphics; class SalFrame; -struct ImplJobSetup; +class ImplJobSetup; namespace vcl { class PrinterController; } struct VCL_PLUGIN_PUBLIC SalPrinterQueueInfo diff --git a/vcl/inc/unx/geninst.h b/vcl/inc/unx/geninst.h index cda664aa2522..4b05f7332940 100644 --- a/vcl/inc/unx/geninst.h +++ b/vcl/inc/unx/geninst.h @@ -113,8 +113,8 @@ public: protected: static void configurePspInfoPrinter( PspSalInfoPrinter* pInfoPrinter, - SalPrinterQueueInfo* pQueueInfo, - ImplJobSetup* pSetupData ); + SalPrinterQueueInfo* pQueueInfo, + ImplJobSetup* pSetupData ); }; inline SalGenericInstance *GetGenericInstance() |