Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/LibreOffice/vcl/inc/   (Office von Apache Version 25.8.3.2©)  Datei vom 5.10.2025 mit Größe 8 kB image not shown  

Quelle  ppdparser.hxx   Sprache: C

 
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ * file * This *   Licensed to the Apache *   contributor license agreements. See the NOTICE *   with this work *   ownership. The ASF licenses *   License, Version 2.0  *   except in compliance with theche.org/licenses/LICENSE-2.0 .
/*
 * 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            ;

cstddef
#include <memory *;
#include <string_viewbool;
#include <OUString;
#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 orientation;

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 PPDParser;
    friend class CPDManager;

    typedefjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

    OUString                 ( &rOptionjava.lang.StringIndexOutOfBoundsException: Index 81 out of bounds for length 81
    hash_type           m_aValues;
std<*> ;
    const PPDValue*     m_pDefaultValue
bool;
    OUString            m_aGroup;

private:

                ;
    int                 m_nOrderDependency;

    void eraseValue( const OUString& rOption );
public:
    PPDKey PPDKeyhash
    ~size_t(  *pKey

    PPDValue*           insertValue  <size_t);}
    java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    { return 
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
const*( n);
    const PPDValue*     getValue( const OUString& rOption class;
        ypedef:<,::<PPDKeyhash_type
    v ( :unique_ptr> );
    onst&(    m_aGroup

    const OUString&     getKeystruct
    boolisUIKeyconst{return
    int                 getOrderDependency() const { return m_nOrderDependency; }
};const*m_pOption2


structPPDConstraint:(nullptrm_pOption1nullptr (nullptr(nullptr{
{
    ;
        {                                       
};

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


class PPDParser
{
    friend class CUPSManager    
    friend class CPDManager;
    friend

    typedef:<OUString:unique_ptr>>;

    void insertKey(  
public
    struct PPDConstraint
    {
        const PPDKey*/java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
        constconst*                               ;
        const*                             ;
constPPDValue;

        PPDConstraintjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    };
private:
                                       
    std::vector
    :tdvector               ;

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


    // shortcuts to important keys and their default values
    // imageable area
    const PPDKey*                               m_pImageableAreas;
    // paper dimensions
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
const*                               java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
    // paper trays
    const PPDValue*                             m_pDefaultInputSlot;
/java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
    constPPDValue                             m_pDefaultResolution

    // translations
    ::<>              m_pTranslator

    PPDParser( OUString            (  *  ;
    PPDParser(OUString aFile,

    void parseOrderDependency(constjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    void parseOpenUI(const OString& rLine, std{((,rWidth)}
     ( & );
    void parse( std::vectorint , & )const

     handleTranslation& ,  i_bIsGlobalized

    static void scanPPDDir 
    static              ,  , :orientation   )const
   staticOUString( &  )java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56

    OUString        matchPaperImpli &,int );

public
    ~PPDParser()
    static const PPDParser

    const       &getDefaultInputSlot;
    const PPDKey*   getKey( const OUString&java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    int             getKeys() const { return m_aKeys    java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
    bool            hasKey

    const ::std:       (std i_rKey

    const OUString & getDefaultPaperDimension() const;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    { getPaperDimension( getDefaultPaperDimension(), rWidth, java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 27
    bool getPaperDimension :unordered_mapconst*,constPPDValue >;
hash_type;
    // width and height in pt
/  false not

    // match the best paper for width and height
            (int,  ,:orientation = )const

    bool getMargins( std::u16string_view rPaperName (PPDKey *   )
                          (const*  bDefaultable )
                     int(const&  ){operator  )}
    // values in pt
    // returns true if paper found = &&rContext

    

    const OUString &const*getParserconst  ; 

    void            getDefaultResolution( int& rXRes, int& rYRes ) const;
    /valuesdpi
    static void     getResolutionFromString( std::u16string_view, int = )
    // helper function

     PPDKey( :: n ;
    OUString   translateOption
// wrapper private
};


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


/ java.lang.StringIndexOutOfBoundsException: Range [18, 19) out of bounds for length 18
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
    }
    hash_type
    }// namespace

    // returns false: check failed, new value is constrained
    //         true:  check succeeded, new value can be set
    bool checkConstraints( const PPDKey*, const PPDValue*, bool bDoReset );
    bool resetValue( const PPDKey*, bool bDefaultable = false );
public:
    PPDContext();
    PPDContext( const PPDContext& rContext ) { operator=( rContext ); }
    PPDContext& operator=( const PPDContext& rContext ) = default;
    PPDContext& operator=( PPDContext&& rContext );

    void setParser( const PPDParser* );
    const PPDParser* getParser() const { return m_pParser; }

    const PPDValue* getValue( const PPDKey* ) const;
    const PPDValue* setValue( const PPDKey*, const PPDValue*, bool bDontCareForConstraints = false );

    std::size_t countValuesModified() const { return m_aCurrentValues.size(); }
    const PPDKey* getModifiedKey( std::size_t n ) const;

    // public wrapper for the private method
    bool checkConstraints( const PPDKey*, const PPDValue* );

    // for printer setup
    char*   getStreamableBuffer( sal_uLong& rBytes ) const;
    void    rebuildFromStreamBuffer(const std::vector<char> &rBuffer);

    // 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& rHeight ) const;
};

// 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.