19 #ifndef INCLUDED_VCL_PPDPARSER_HXX
20 #define INCLUDED_VCL_PPDPARSER_HXX
26 #include <string_view>
27 #include <unordered_map>
30 #include <rtl/string.hxx>
31 #include <rtl/ustring.hxx>
35 #define PRINTER_PPDDIR "driver"
66 typedef std::unordered_map< OUString, PPDValue >
hash_type;
86 PPDKey(
const OUString& rKey );
91 {
return m_aValues.size(); }
109 {
return reinterpret_cast<size_t>(pKey); }
124 typedef std::unordered_map< OUString, std::unique_ptr<PPDKey> >
hash_type;
127 void insertKey( std::unique_ptr<PPDKey> pKey );
136 PPDConstraint() : m_pKey1( nullptr ), m_pOption1( nullptr ), m_pKey2( nullptr ), m_pOption2( nullptr ) {}
167 PPDParser(
const OUString& rFile,
const std::vector<PPDKey*>& keys);
170 void parseOpenUI(
const OString& rLine, std::string_view rPPDGroup);
172 void parse( std::vector< OString >& rLines );
176 static void scanPPDDir(
const OUString& rDir );
178 static OUString
getPPDFile(
const OUString& rFile );
185 int getKeys()
const {
return m_aKeys.size(); }
198 int& rWidth,
int& rHeight )
const;
203 OUString
matchPaper(
int nWidth,
int nHeight )
const;
205 bool getMargins( std::u16string_view rPaperName,
206 int &rLeft,
int& rRight,
207 int &rUpper,
int& rLower )
const;
222 const OUString& i_rOption )
const;
233 typedef std::unordered_map< const PPDKey*, const PPDValue*, PPDKeyhash >
hash_type;
268 void getPageSize( OUString& rPaper,
int& rWidth,
int& rHeight )
const;
273 #endif // INCLUDED_VCL_PPDPARSER_HXX
void parseOrderDependency(const OString &rLine)
OUString translateKey(const OUString &i_rKey) const
void rebuildFromStreamBuffer(const std::vector< char > &rBuffer)
int getRenderResolution() const
OUString getDefaultInputSlot() const
const PPDParser * m_pParser
void parse(std::vector< OString > &rLines)
void parseConstraint(const OString &rLine)
std::vector< PPDValue * > value_type
bool isColorDevice() const
const PPDValue * m_pDefaultResolution
void insertKey(std::unique_ptr< PPDKey > pKey)
const OUString & getKey() const
const PPDKey * getModifiedKey(std::size_t n) const
const PPDValue * m_pDefaultValue
bool getPaperDimension(std::u16string_view rPaperName, int &rWidth, int &rHeight) const
::std::vector< PPDConstraint > m_aConstraints
size_t operator()(const PPDKey *pKey) const
const PPDKey * m_pImageableAreas
void parseOpenUI(const OString &rLine, std::string_view rPPDGroup)
const PPDValue * getValueCaseInsensitive(const OUString &rOption) const
void getDefaultPaperDimension(int &rWidth, int &rHeight) const
PPDKey(const OUString &rKey)
static void scanPPDDir(const OUString &rDir)
const PPDValue * m_pDefaultInputSlot
std::unordered_map< const PPDKey *, const PPDValue *, PPDKeyhash > hash_type
const OUString & getGroup() const
char * getStreamableBuffer(sal_uLong &rBytes) const
const PPDValue * m_pOption2
const PPDValue * m_pDefaultPaperDimension
bool checkConstraints(const PPDKey *, const PPDValue *, bool bDoReset)
void getPageSize(OUString &rPaper, int &rWidth, int &rHeight) const
std::vector< PPDKey * > value_type
const PPDValue * getDefaultValue() const
const PPDValue * setValue(const PPDKey *, const PPDValue *, bool bDontCareForConstraints=false)
PPDParser(const OUString &rFile)
std::unique_ptr< PPDTranslator > m_pTranslator
const ::std::vector< PPDConstraint > & getConstraints() const
const PPDValue * getValue(int n) const
PPDContext & operator=(const PPDContext &rContext)=default
void getDefaultResolution(int &rXRes, int &rYRes) const
value_type m_aOrderedKeys
bool resetValue(const PPDKey *, bool bDefaultable=false)
const PPDValue * m_pOption1
OUString matchPaper(int nWidth, int nHeight) const
PPDContext(const PPDContext &rContext)
hash_type m_aCurrentValues
int getOrderDependency() const
std::size_t countValuesModified() const
static void initPPDFiles(PPDCache &rPPDCache)
PPDValue * insertValue(const OUString &rOption, PPDValueType eType, bool bCustomOption=false)
const PPDKey * getKey(int n) const
const PPDKey * m_pPaperDimensions
rtl_TextEncoding m_aFileEncoding
sal_uLong getLanguageLevel() const
static void getResolutionFromString(std::u16string_view, int &, int &)
static OUString getPPDFile(const OUString &rFile)
std::unordered_map< OUString, PPDValue > hash_type
bool hasKey(const PPDKey *) const
static const PPDParser * getParser(const OUString &rFile)
std::unordered_map< OUString, std::unique_ptr< PPDKey > > hash_type
OUString translateOption(const OUString &i_rKey, const OUString &i_rOption) const
const PPDValue * getValue(const PPDKey *) const
OUString handleTranslation(const OString &i_rString, bool i_bIsGlobalized)
const PPDParser * getParser() const
void setParser(const PPDParser *)
value_type m_aOrderedValues
SetupType getSetupType() const
OUString getDefaultPaperDimension() const
void eraseValue(const OUString &rOption)
sal_uLong m_nLanguageLevel
bool getMargins(std::u16string_view rPaperName, int &rLeft, int &rRight, int &rUpper, int &rLower) const
bool isType42Capable() const