1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 #ifndef _PSPRINT_JOBDATA_HXX_ 25 #define _PSPRINT_JOBDATA_HXX_ 26 27 #include "vcl/ppdparser.hxx" 28 29 namespace psp { 30 31 namespace orientation { 32 enum type { 33 Portrait, 34 Landscape 35 }; 36 } 37 38 struct VCL_DLLPUBLIC JobData 39 { 40 int m_nCopies; 41 int m_nLeftMarginAdjust; 42 int m_nRightMarginAdjust; 43 int m_nTopMarginAdjust; 44 int m_nBottomMarginAdjust; 45 // user overrides for PPD 46 int m_nColorDepth; 47 int m_nPSLevel; // 0: no override, else languaglevel to use 48 int m_nColorDevice; // 0: no override, -1 grey scale, +1 color 49 int m_nPDFDevice; // 0: PostScript, 1: PDF 50 orientation::type m_eOrientation; 51 ::rtl::OUString m_aPrinterName; 52 const PPDParser* m_pParser; 53 PPDContext m_aContext; 54 JobDatapsp::JobData55 JobData() : 56 m_nCopies( 1 ), 57 m_nLeftMarginAdjust( 0 ), 58 m_nRightMarginAdjust( 0 ), 59 m_nTopMarginAdjust( 0 ), 60 m_nBottomMarginAdjust( 0 ), 61 m_nColorDepth( 24 ), 62 m_nPSLevel( 0 ), 63 m_nColorDevice( 0 ), 64 m_nPDFDevice( 0 ), 65 m_eOrientation( orientation::Portrait ), 66 m_pParser( NULL ) {} 67 68 JobData& operator=(const psp::JobData& rRight); 69 JobDatapsp::JobData70 JobData( const JobData& rData ) { *this = rData; } 71 72 void setCollate( bool bCollate ); 73 bool setPaper( int nWidth, int nHeight ); // dimensions in pt 74 bool setPaperBin( int nPaperBin ); // dimensions in pt 75 76 // creates a new buffer using new 77 // it is up to the user to delete it again 78 bool getStreamBuffer( void*& pData, int& bytes ); 79 static bool constructFromStreamBuffer( void* pData, int bytes, JobData& rJobData ); 80 }; 81 82 } // namespace 83 84 85 #endif // PSPRINT_JOBDATA_HXX 86