19#ifndef INCLUDED_VCL_PPDPARSER_HXX
20#define INCLUDED_VCL_PPDPARSER_HXX
27#include <unordered_map>
30#include <rtl/string.hxx>
31#include <rtl/ustring.hxx>
35#define PRINTER_PPDDIR "driver"
69 typedef std::unordered_map< OUString, PPDValue >
hash_type;
80 enum class SetupType { ExitServer, Prolog, DocumentSetup, PageSetup, JCLSetup, AnySetup };
112 {
return reinterpret_cast<size_t>(pKey); }
126 typedef std::unordered_map< OUString, std::unique_ptr<PPDKey> >
hash_type;
169 PPDParser(OUString aFile,
const std::vector<PPDKey*>& keys);
172 void parseOpenUI(
const OString& rLine, std::string_view rPPDGroup);
174 void parse( std::vector< OString >& rLines );
203 int& rWidth,
int& rHeight )
const;
211 int &rLeft,
int& rRight,
212 int &rUpper,
int& rLower )
const;
227 const OUString& i_rOption )
const;
238 typedef std::unordered_map< const PPDKey*, const PPDValue*, PPDKeyhash >
hash_type;
273 void getPageSize( OUString& rPaper,
int& rWidth,
int& rHeight )
const;
bool checkConstraints(const PPDKey *, const PPDValue *, bool bDoReset)
const PPDParser * getParser() const
void setParser(const PPDParser *)
void getPageSize(OUString &rPaper, int &rWidth, int &rHeight) const
const PPDValue * getValue(const PPDKey *) const
PPDContext & operator=(PPDContext &&rContext)
std::size_t countValuesModified() const
PPDContext(const PPDContext &rContext)
char * getStreamableBuffer(sal_uLong &rBytes) const
bool checkConstraints(const PPDKey *, const PPDValue *)
PPDContext & operator=(const PPDContext &rContext)=default
hash_type m_aCurrentValues
bool resetValue(const PPDKey *, bool bDefaultable=false)
void rebuildFromStreamBuffer(const std::vector< char > &rBuffer)
const PPDKey * getModifiedKey(std::size_t n) const
int getRenderResolution() const
const PPDParser * m_pParser
std::unordered_map< const PPDKey *, const PPDValue *, PPDKeyhash > hash_type
const PPDValue * setValue(const PPDKey *, const PPDValue *, bool bDontCareForConstraints=false)
const OUString & getGroup() const
const PPDValue * getDefaultValue() const
SetupType getSetupType() const
value_type m_aOrderedValues
const PPDValue * m_pDefaultValue
const PPDValue * getValueCaseInsensitive(const OUString &rOption) const
const PPDValue * getValue(const OUString &rOption) const
const PPDValue * getValue(int n) const
PPDValue * insertValue(const OUString &rOption, PPDValueType eType, bool bCustomOption=false)
int getOrderDependency() const
const OUString & getKey() const
void eraseValue(const OUString &rOption)
std::unordered_map< OUString, PPDValue > hash_type
std::vector< PPDValue * > value_type
static const PPDParser * getParser(const OUString &rFile)
const PPDValue * m_pDefaultPaperDimension
void insertKey(std::unique_ptr< PPDKey > pKey)
void getDefaultResolution(int &rXRes, int &rYRes) const
OUString matchPaperImpl(int nWidth, int nHeight, bool bDontSwap=false, psp::orientation *pOrientation=nullptr) const
static void scanPPDDir(const OUString &rDir)
const PPDKey * m_pPaperDimensions
OUString handleTranslation(const OString &i_rString, bool i_bIsGlobalized)
value_type m_aOrderedKeys
::std::vector< PPDConstraint > m_aConstraints
PPDParser(OUString aFile, const std::vector< PPDKey * > &keys)
void getDefaultPaperDimension(int &rWidth, int &rHeight) const
OUString translateOption(std::u16string_view i_rKey, const OUString &i_rOption) const
rtl_TextEncoding m_aFileEncoding
void parse(std::vector< OString > &rLines)
std::vector< PPDKey * > value_type
const ::std::vector< PPDConstraint > & getConstraints() const
void parseConstraint(const OString &rLine)
bool getPaperDimension(std::u16string_view rPaperName, int &rWidth, int &rHeight) const
OUString getDefaultPaperDimension() const
sal_uLong m_nLanguageLevel
std::unique_ptr< PPDTranslator > m_pTranslator
OUString translateKey(const OUString &i_rKey) const
bool getMargins(std::u16string_view rPaperName, int &rLeft, int &rRight, int &rUpper, int &rLower) const
const PPDValue * m_pDefaultInputSlot
const PPDKey * getKey(int n) const
void parseOrderDependency(const OString &rLine)
sal_uLong getLanguageLevel() const
bool hasKey(const PPDKey *) const
OUString matchPaper(int nWidth, int nHeight, psp::orientation *pOrientation=nullptr) const
static void initPPDFiles(PPDCache &rPPDCache)
PPDParser(OUString aFile)
const PPDKey * m_pImageableAreas
static OUString getPPDFile(const OUString &rFile)
bool isColorDevice() const
const PPDKey * getKey(const OUString &rKey) const
std::unordered_map< OUString, std::unique_ptr< PPDKey > > hash_type
void parseOpenUI(const OString &rLine, std::string_view rPPDGroup)
bool isType42Capable() const
OUString getDefaultInputSlot() const
static void getResolutionFromString(std::u16string_view, int &, int &)
const PPDValue * m_pDefaultResolution
size_t operator()(const PPDKey *pKey) const
const PPDValue * m_pOption2
const PPDValue * m_pOption1
bool m_bCustomOptionSetViaApp