LCOV - code coverage report
Current view: top level - vcl/inc - salprn.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 1 2 50.0 %
Date: 2012-08-25 Functions: 1 2 50.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 0 -

           Branch data     Line data    Source code
       1                 :            : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2                 :            : /*************************************************************************
       3                 :            :  *
       4                 :            :  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       5                 :            :  *
       6                 :            :  * Copyright 2000, 2010 Oracle and/or its affiliates.
       7                 :            :  *
       8                 :            :  * OpenOffice.org - a multi-platform office productivity suite
       9                 :            :  *
      10                 :            :  * This file is part of OpenOffice.org.
      11                 :            :  *
      12                 :            :  * OpenOffice.org is free software: you can redistribute it and/or modify
      13                 :            :  * it under the terms of the GNU Lesser General Public License version 3
      14                 :            :  * only, as published by the Free Software Foundation.
      15                 :            :  *
      16                 :            :  * OpenOffice.org is distributed in the hope that it will be useful,
      17                 :            :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      18                 :            :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      19                 :            :  * GNU Lesser General Public License version 3 for more details
      20                 :            :  * (a copy is included in the LICENSE file that accompanied this code).
      21                 :            :  *
      22                 :            :  * You should have received a copy of the GNU Lesser General Public License
      23                 :            :  * version 3 along with OpenOffice.org.  If not, see
      24                 :            :  * <http://www.openoffice.org/license.html>
      25                 :            :  * for a copy of the LGPLv3 License.
      26                 :            :  *
      27                 :            :  ************************************************************************/
      28                 :            : 
      29                 :            : #ifndef _SV_SALPRN_HXX
      30                 :            : #define _SV_SALPRN_HXX
      31                 :            : 
      32                 :            : #include <rtl/ustring.hxx>
      33                 :            : 
      34                 :            : #include <tools/solar.h>
      35                 :            : #include <vcl/dllapi.h>
      36                 :            : #include <vcl/prntypes.hxx>
      37                 :            : 
      38                 :            : #include <vector>
      39                 :            : 
      40                 :            : class SalGraphics;
      41                 :            : class SalFrame;
      42                 :            : struct ImplJobSetup;
      43                 :            : namespace vcl { class PrinterController; }
      44                 :            : 
      45                 :            : // -----------------------
      46                 :            : // - SalPrinterQueueInfo -
      47                 :            : // -----------------------
      48                 :            : 
      49                 :            : struct VCL_PLUGIN_PUBLIC SalPrinterQueueInfo
      50                 :            : {
      51                 :            :     rtl::OUString               maPrinterName;
      52                 :            :     rtl::OUString               maDriver;
      53                 :            :     rtl::OUString               maLocation;
      54                 :            :     rtl::OUString               maComment;
      55                 :            :     sal_uLong                   mnStatus;
      56                 :            :     sal_uLong                   mnJobs;
      57                 :            :     rtl::OUString*              mpSysData;
      58                 :            : 
      59                 :            :                             SalPrinterQueueInfo();
      60                 :            :                             ~SalPrinterQueueInfo();
      61                 :            : };
      62                 :            : 
      63                 :            : // ------------------
      64                 :            : // - SalInfoPrinter -
      65                 :            : // ------------------
      66                 :            : 
      67                 :            : class VCL_PLUGIN_PUBLIC SalInfoPrinter
      68                 :            : {
      69                 :            : public:
      70                 :            :     std::vector< PaperInfo  >           m_aPaperFormats;    // all printer supported formats
      71                 :            :     bool                                m_bPapersInit;      // set to true after InitPaperFormats
      72                 :            :     bool                                m_bCompatMetrics;
      73                 :            : 
      74                 :        109 :     SalInfoPrinter() : m_bPapersInit( false ), m_bCompatMetrics( false ) {}
      75                 :            :     virtual ~SalInfoPrinter();
      76                 :            : 
      77                 :            :     // SalGraphics or NULL, but two Graphics for all SalFrames
      78                 :            :     // must be returned
      79                 :            :     virtual SalGraphics*            GetGraphics() = 0;
      80                 :            :     virtual void                    ReleaseGraphics( SalGraphics* pGraphics ) = 0;
      81                 :            : 
      82                 :            :     virtual sal_Bool                    Setup( SalFrame* pFrame, ImplJobSetup* pSetupData ) = 0;
      83                 :            :     // This function set the driver data and
      84                 :            :     // set the new indepen data in pSetupData
      85                 :            :     virtual sal_Bool                    SetPrinterData( ImplJobSetup* pSetupData ) = 0;
      86                 :            :     // This function merged the indepen driver data
      87                 :            :     // and set the new indepen data in pSetupData
      88                 :            :     // Only the data must changed, where the bit
      89                 :            :     // in nFlags is set
      90                 :            :     virtual sal_Bool                    SetData( sal_uLong nFlags, ImplJobSetup* pSetupData ) = 0;
      91                 :            : 
      92                 :            :     virtual void                    GetPageInfo( const ImplJobSetup* pSetupData,
      93                 :            :                                                  long& rOutWidth, long& rOutHeight,
      94                 :            :                                                  long& rPageOffX, long& rPageOffY,
      95                 :            :                                                  long& rPageWidth, long& rPageHeight ) = 0;
      96                 :            :     virtual sal_uLong                   GetCapabilities( const ImplJobSetup* pSetupData, sal_uInt16 nType ) = 0;
      97                 :            :     virtual sal_uLong                   GetPaperBinCount( const ImplJobSetup* pSetupData ) = 0;
      98                 :            :     virtual rtl::OUString                  GetPaperBinName( const ImplJobSetup* pSetupData, sal_uLong nPaperBin ) = 0;
      99                 :            :     // fills m_aPaperFormats and sets m_bPapersInit to true
     100                 :            :     virtual void                    InitPaperFormats( const ImplJobSetup* pSetupData ) = 0;
     101                 :            :     // returns angle that a landscape page will be turned counterclockwise wrt to portrait
     102                 :            :     virtual int                 GetLandscapeAngle( const ImplJobSetup* pSetupData ) = 0;
     103                 :            : };
     104                 :            : 
     105                 :            : // --------------
     106                 :            : // - SalPrinter -
     107                 :            : // --------------
     108                 :            : 
     109                 :            : class VCL_PLUGIN_PUBLIC SalPrinter
     110                 :            : {
     111                 :            : public:                     // public for Sal Implementation
     112                 :          0 :     SalPrinter() {}
     113                 :            :     virtual ~SalPrinter();
     114                 :            : 
     115                 :            :     virtual sal_Bool                    StartJob( const rtl::OUString* pFileName,
     116                 :            :                                               const rtl::OUString& rJobName,
     117                 :            :                                               const rtl::OUString& rAppName,
     118                 :            :                                               sal_uLong nCopies,
     119                 :            :                                               bool bCollate,
     120                 :            :                                               bool bDirect,
     121                 :            :                                               ImplJobSetup* pSetupData ) = 0;
     122                 :            : 
     123                 :            :     // implement for pull model print systems only,
     124                 :            :     // default implementations (see salvtables.cxx) just returns sal_False
     125                 :            :     virtual sal_Bool                    StartJob( const rtl::OUString* pFileName,
     126                 :            :                                               const rtl::OUString& rJobName,
     127                 :            :                                               const rtl::OUString& rAppName,
     128                 :            :                                               ImplJobSetup* pSetupData,
     129                 :            :                                               vcl::PrinterController& rController );
     130                 :            : 
     131                 :            :     virtual sal_Bool                    EndJob() = 0;
     132                 :            :     virtual sal_Bool                    AbortJob() = 0;
     133                 :            :     virtual SalGraphics*            StartPage( ImplJobSetup* pSetupData, sal_Bool bNewJobData ) = 0;
     134                 :            :     virtual sal_Bool                    EndPage() = 0;
     135                 :            :     virtual sal_uLong                   GetErrorCode() = 0;
     136                 :            : 
     137                 :            : };
     138                 :            : 
     139                 :            : #endif // _SV_SALPRN_HXX
     140                 :            : 
     141                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10