All Frameworks  Class Hierarchy  This Framework  Previous  Indexes

PrintBase Class CATPrinterManager

System.IUnknown
  |
  +---System.IDispatch
    |
    +---System.CATBaseUnknown
      |
      +---System.CATEventSubscriber
        |
        +---System.CATCallbackManager
          |
          +---CATPrinterManager
 

Usage: you must use this class as is. You should never derive it.


public class CATPrinterManager

Class to manage system printers.

Role: A printer manager can retrieve the list of available printers and their attributes, it can retrieve the system default printer or can send data to a specific printer.
It's a pure static and OS-specific class.
Calling Begin at the beginning of the application is not compulsory. Therefore, End should be called at the end in order to release memory and save default print parameters.


Constructor and Destructor Index


o CATPrinterManager()
Constructs a CATPrinterManager.
o ~CATPrinterManager()

Method Index


o Begin(char*)
Initializes and builts printer list.
o End(void)
Terminates the using of printer management.
o GetDefaultParameters(void)
Returns the default parameters.
o GetDefaultPrinter(void)
Returns the default printer.
o GetDefaultPrinterIndex(void)
Returns the default printer index.
o GetDefaultUnit(void)
Returns the default unit.
o GetInstance()
Returns the instance of CATPrinterManager.
o GetPrinterCount(void)
Returns the number of available printers.
o GetPrinterFromIndex(int)
Returns a printer from its index.
o GetPrinterList(void)
Returns the list of available printers.
o GetTempDirectory(void)
Returns the temporary directory.
o GetUserPrintersDir(void)
Returns the user printers directory.
o ReadPrinterProperties(CATPrinter*,CATBaseUnknown*)
Reads printer properties.
o SetDefaultParameters(CATPrintParameters&)
Sets the default parameters.
o SetDefaultPrinterIndex(int)
Sets the default printer index.
o SetDefaultUnit(CATPrintUnit)
Sets the default unit.
o Write(CATPrinter&,CATPrintStream&,int)
Sends data to a printer.
o WritePrinterProperties(CATPrinter*,CATBaseUnknown*)
Writes printer properties.

Constructor and Destructor


o CATPrinterManager
public CATPrinterManager()
Constructs a CATPrinterManager.
o ~CATPrinterManager
public ~CATPrinterManager()

Methods


o Begin
public static void Begin( const char* iDirectory=NULL)
Initializes and builts printer list.
Parameters:
iDirectory
The printers directory.
Legal values: The default is $CATUserSettingPath/Printers.
o End
public static void End(void )
Terminates the using of printer management.
o GetDefaultParameters
public static const CATPrintParameters& GetDefaultParameters(void )
Returns the default parameters.
Returns:
The default parameters.
o GetDefaultPrinter
public static CATPrinter& GetDefaultPrinter(void )
Returns the default printer.
Returns:
The default printer.
o GetDefaultPrinterIndex
public static int GetDefaultPrinterIndex(void )
Returns the default printer index.
Returns:
The the default printer index.
o GetDefaultUnit
public static CATPrintUnit GetDefaultUnit(void )
Returns the default unit.
Returns:
The default unit.
o GetInstance
public static CATPrinterManager* GetInstance()
Returns the instance of CATPrinterManager.
Only one CATPrinterManager can be instancied.
Returns:
The CATPrinterManager instance.
o GetPrinterCount
public static int GetPrinterCount(void )
Returns the number of available printers.
Returns:
The number of available printers.
o GetPrinterFromIndex
public static CATPrinter& GetPrinterFromIndex(int iIndex)
Returns a printer from its index.
Parameters:
iIndex
The index of the printer.
Returns:
The printer which index is iIndex.
o GetPrinterList
public static const CATLISTP(CATPrinter)& GetPrinterList(void )
Returns the list of available printers.
Returns:
The list of available printers.
o GetTempDirectory
public static const char* GetTempDirectory(void )
Returns the temporary directory.
Returns:
The temporary directory.
o GetUserPrintersDir
public static const CATString& GetUserPrintersDir(void )
Returns the user printers directory.
Returns:
The printers directory.
o ReadPrinterProperties
public static void ReadPrinterProperties( const CATPrinter* iPrinter,
CATBaseUnknown* ioProperties)
Reads printer properties.
Parameters:
iPrinter
The printer to scan.
ioProperties
The properties of the printer.
o SetDefaultParameters
public static void SetDefaultParameters( const CATPrintParameters& iParameters)
Sets the default parameters.
Parameters:
iParameters
The default parameters.
o SetDefaultPrinterIndex
public static void SetDefaultPrinterIndex(int iIndex)
Sets the default printer index.
Parameters:
iIndex
The index of the default printer.
o SetDefaultUnit
public static void SetDefaultUnit(CATPrintUnit iUnit)
Sets the default unit.
Parameters:
iUnit
The default unit.
o Write
public static void Write( const CATPrinter& iPrinter,
const CATPrintStream& iStream,
int iNbcopies=1)
Sends data to a printer.
Parameters:
iPrinter
The printer where the data are sent.
iStream
The data to send.
iNbcopies
The number of copies.
Legal values: The defaut is 1.
o WritePrinterProperties
public static void WritePrinterProperties( const CATPrinter* iPrinter,
CATBaseUnknown* iProperties)
Writes printer properties.
Parameters:
iPrinter
The printer to update.
iProperties
The properties of the printer.

This object is included in the file: CATPrinterManager.h
If needed, your Imakefile.mk should include the module: CATPrintBase

Copyright © 2003, Dassault Systèmes. All rights reserved.