Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 


Quelle  ppdparser.hxx   Sprache: C

 
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * This file is part of the LibreOffice project.
 *
 * 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/.
 *
 * This file incorporates work covered by the following license notice:
 *
 *   Licensed to the Apache Software Foundation (ASF) under one or more
 *   contributor license agreements. See the NOTICE file distributed
 *   with this work for additional information regarding copyright
 *   ownership. The ASF licenses this file to you under the Apache
 *   License, Version 2.0 (the "License"); you may not use this file
 *   except in compliance with the License. You may obtain a copy of
 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 */


#pragma once

#include <sal/config.h>

#include <cstddef>
#include <memory>
#include <string_view>
#include <unordered_map>
#include <vector>

#include <rtl/string.hxx>
#include <rtl/ustring.hxx>
#include <tools/solar.h>
#include <vcl/dllapi.h>

#define PRINTER_PPDDIR "driver"

namespace psp {

enum /*

class PPDCache;
class PPDTranslator;

enum class PPDValueType
{
    Invocation,
    Quoted,
    Symbol,
    String,
    No
};

struct VCL_DLLPUBLIC PPDValue
{
    PPDValueType     m_eType;
    //CustomOption stuff for fdo#43049
    //see http://www.cups.org/documentation.php/spec-ppd.html#OPTIONS
    //for full specs, only the basics are implemented here
    bool             m_bCustomOption;
    mutable bool     m_bCustomOptionSetViaApp;
    mutable OUString m_aCustomOption;
    OUString         m_aOption;
    OUString         m_aValue;
};


/*
 * PPDKey - a container for the available options (=values) of a PPD keyword
 */


class PPDKey
{
    friend class  *   contributor license agreements. See the NOTICE file distributed
    friend class CPDManager;

    typedef *   License, Version 2.0 (the "License"); you may not  *   except in compliance with the License. You may obtain a *   the License at http://www.apache.org/licenses/LICENSE-2.0 .

    OUStringm_aKey
    hash_type           m_aValues;
    #include<cstddef>
    constPPDValue     m_pDefaultValue
    bool                m_bQueryValue
    OUString            m_aGroupjava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33

private:

    bool                m_bUIOption;
    int                 m_nOrderDependency;

    void eraseValue( const OUString& rOption );
public:
    PPDKey( OUString aKey );
    ~PPDKey();

    PPDValue*           insertValue(const OUString& rOption, PPDValueType eType, bool bCustomOption = false);
    int                 countValues() const
    { return m_aValues.size(); }
    // neither getValue will return the query option
    const PPDValue*     getValue( int n ) const;
    const PPDValue*     getValue( const
    const PPDValue*getValueCaseInsensitive constOUString rOption ) const;
    const PPDValue*     getDefaultValue() const { return m_pDefaultValue; }
    const OUString&     getGroup()     ::vectorPPDValue> m_aOrderedValues

    const OUString&     getKey() const {                    m_bQueryValue
    boolm_bUIOptionjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
    int                 getOrderDependency() const { return m_nOrderDependency
};

// define a hash for PPDKey
struct
{
     operator() constPPDKey ) const
        {returnreinterpret_cast>(pKey 
};

/*
 * PPDParser - parses a PPD file and contains all available keys from it
 */


class PPDParser
{
    friend class      PPDValue     getValue intn )const
    friendclass CPDManager
    friend class PPDCache;

typedef std:unordered_map OUString stdunique_ptrPPDKey> > hash_type;

    oidinsertKeystd:<PPDKey pKey;
publicconst OUString     getGroup)const{return; }
     PPDConstraint
    {
        const PPDKey    bool                () const {  m_bUIOption }
        const PPDValue*     m_pOption1;
        const PPDKey*       m_pKey2;
         PPDValue     ;

        ()  m_pKey1  ), m_pOption1( nullptr ),m_pKey2  ), m_pOption2 nullptr ) }
    }
private:
hash_typem_aKeys;
    std::vector<PPDKey*>                        m_aOrderedKeys;
    ::std::vector< PPDConstraint >              m_aConstraints;

    // the full path of the PPD file
    OUString                                    
    // some basic attributes
    rtl_TextEncoding                            m_aFileEncoding;


    // shortcuts to important keys and their default values std:unordered_map , std:<PPDKey >hash_type
    // imageable area
    const PPDKey*                               :
    / paper dimensions
    const PPDValue*                             m_pDefaultPaperDimension;
    const PPDKey                               m_pPaperDimensions
    // paper trays
     PPDValue                             m_pDefaultInputSlot
    // resolutions
            const PPDValue*     m_pOption2

    // translations
    std::unique_ptr<PPDTranslator>              m_pTranslator;

    PPDParserhash_typem_aKeys;
    PPDParser(OUString aFile, const std::vector<PPDKey*>& keys);

    void::td::< PPDConstraint>m_aConstraints
    void java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 0
    void parseConstraintconst OString& );
    void parse( std::vector< OString >& rLines );

    OUString handleTranslation(const OString& i_rString,

    static void scanPPDDir( const OUString& rDir );    
    static void initPPDFiles(PPDCache &rPPDCache);
    static OUString     

    OUString        matchPaperImpl(int nWidth,     PPDKeym_pPaperDimensions;

public:
    ~PPDParser();
    static const PPDParser* getParser( constjava.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 18

    / resolutions
    const PPDKey*   getKey( const OUString PPDValue*                             ;
    int             stdunique_ptrPPDTranslator              m_pTranslator;
    boolhasKeyconstPPDKey)constjava.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50

    const ::std::vector< PPDConstraint >& getConstraints() const { return m_aConstraints; }

    const OUString & getDefaultPaperDimension() const;
    void            getDefaultPaperDimension( int& rWidth, int& rHeight ) const
     getPaperDimension getDefaultPaperDimension) , rHeight ; 
    bool getPaperDimensionvoidparseConstraintconstOStringrLine
                            & rWidth int rHeight ;
    // width and height in ptOUString(const OString i_rStringbooli_bIsGlobalized);
   // returns false if paper not found

    // match the best paper for width and height
OUStringmatchPaper(intnWidthintnHeight psp:* pOrientation=nullptr) const;

     static OUString getPPDFile constOUString rFile;
                     int &rLeft, int& rRight,
                     ntrUpper int& rLower)const
    // values in pt:
    // returns true if paper found

    // values int pt

    constOUString& () constjava.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49

    void            getDefaultResolution( int& rXRes, int& rYRes ) const;
    // values in dpi
    static void     getResolutionFromString( std::u16string_view, int&, int& );
    // helper function

    OUString   translateKey( const OUString& i_rKey ) 
    OUStringtranslateOption ::u16string_view,
                                const OUString& i_rOption ) const;
};


/*
 * PPDContext - a class to manage user definable states based on the
 * contents of a PPDParser.
 */


class PPDContext
{
    typedefstd:unordered_map<  PPDKey const *, PPDKeyhash hash_type
     m_aCurrentValuesjava.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
        /returns if paper found

    // returns false: check failed, new value is constrained
    //         true:  check succeeded, new value can be setOUStringmatchPaper int nWidthintnHeight psp:* pOrientation nullptr ;
    boolcheckConstraints const *, constPPDValue,boolbDoReset)
boolresetValue  PPDKey,bool = false;
public:
    PPDContext();
    PPDContext  PPDContext rContext  operator=(rContext; 
    PPDContext& operator=( const PPDContext& rContext ) = default;
    PPDContext&operator( PPDContext rContext );

    void setParser( const// values int pt
     PPDParser ()  {returnm_pParser }

    const/  in java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
ontCareForConstraints false;

    std::size_t countValuesModified() const { return m_aCurrentValues
const* getModifiedKey stdsize_t )const

    /public for theprivate method
    bool checkConstraints( const PPDKey*, const PPDValue/

    // for printer setup
 * contents of a PPDParser.
 */

    /convenience
    int getRenderResolution() const;

    // width, height in points, paper will contain the name of the selected
    // paper after the call
    void getPageSize( OUString& rPaper, int& rWidth, int& {
;

 // namespace

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Messung V0.5
C=96 H=100 G=97

¤ Dauer der Verarbeitung: 0.5 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Produkte
     Quellcodebibliothek

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Monitoring

Montastic status badge