All Frameworks Class Hierarchy This Framework Indexes
PrintBase Class 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
GetDefaultPrinterIndex(void)
- Returns the default printer index.
- o
GetDefaultPrinter(void)
- Returns the default printer.
- 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
WritePrinterProperties(CATPrinter*,CATBaseUnknown*)
- Writes printer properties.
- o
Write(CATPrinter&,CATPrintStream&,int)
- Sends data to a printer.
Constructor and Destructor
o CATPrinterManager
| public CATPrinterManager( | ) |
-
Constructs a CATPrinterManager.
o ~CATPrinterManager
| public ~CATPrinterManager( | ) |
-
Methods
o Begin
| public static Begin( | const | iDirectory | =NULL) |
-
Initializes and builts printer list.
- Parameters:
-
- iDirectory
- The printers directory.
Legal values: The default is $CATUserSettingPath/Printers.
o End
-
Terminates the using of printer management.
o GetDefaultParameters
| public static GetDefaultParameters( | | ) |
-
Returns the default parameters.
- Returns:
- The default parameters.
o GetDefaultPrinterIndex
| public static GetDefaultPrinterIndex( | | ) |
-
Returns the default printer index.
- Returns:
- The the default printer index.
o GetDefaultPrinter
| public static GetDefaultPrinter( | | ) |
-
Returns the default printer.
- Returns:
- The default printer.
o GetDefaultUnit
| public static GetDefaultUnit( | | ) |
-
Returns the default unit.
- Returns:
- The default unit.
o GetInstance
| public static GetInstance( | ) |
-
Returns the instance of CATPrinterManager.
Only one CATPrinterManager can be instancied.
- Returns:
- The CATPrinterManager instance.
o GetPrinterCount
| public static GetPrinterCount( | | ) |
-
Returns the number of available printers.
- Returns:
- The number of available printers.
o GetPrinterFromIndex
| public static GetPrinterFromIndex( | | 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 GetPrinterList( | | ) |
-
Returns the list of available printers.
- Returns:
- The list of available printers.
o GetTempDirectory
| public static GetTempDirectory( | | ) |
-
Returns the temporary directory.
- Returns:
- The temporary directory.
o GetUserPrintersDir
| public static GetUserPrintersDir( | | ) |
-
Returns the user printers directory.
- Returns:
- The printers directory.
o ReadPrinterProperties
| public static ReadPrinterProperties( | const | iPrinter, |
| | ioProperties) |
-
Reads printer properties.
- Parameters:
-
- iPrinter
- The printer to scan.
- ioProperties
- The properties of the printer.
o SetDefaultParameters
| public static SetDefaultParameters( | const | iParameters) |
-
Sets the default parameters.
- Parameters:
-
- iParameters
- The default parameters.
o SetDefaultPrinterIndex
| public static SetDefaultPrinterIndex( | | iIndex) |
-
Sets the default printer index.
- Parameters:
-
- iIndex
- The index of the default printer.
o SetDefaultUnit
| public static SetDefaultUnit( | | iUnit) |
-
Sets the default unit.
- Parameters:
-
- iUnit
- The default unit.
o WritePrinterProperties
| public static WritePrinterProperties( | const | iPrinter, |
| | iProperties) |
-
Writes printer properties.
- Parameters:
-
- iPrinter
- The printer to update.
- iProperties
- The properties of the printer.
o Write
| public static Write( | const | iPrinter, |
| const | iStream, |
| | 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.
This object is included in the file: CATPrinterManager.h
If needed, your Imakefile.mk should include the module: CATPrintBase