Back to index

lightning-sunbird  0.9+nobinonly
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Private Member Functions | Private Attributes
NS_PSSHARED Protocol Reference

#include <nsCUPSShim.h>

Collaboration diagram for NS_PSSHARED:
Collaboration graph
[legend]

List of all members.

Public Types

enum  PrinterType { kTypeUnknown, kTypePS, kTypeCUPS }

Public Member Functions

 nsCUPSShim ()
 ~nsCUPSShim ()
PRBool Init ()
 Initialize this object.
PRBool IsInitialized ()
 nsPaperSizePS ()
 
Constructor
PRBool AtEnd ()
 

void First ()
 
Position the cursor at the beginning of the paper size list.
void Next ()
 
Advance the cursor to the next item.
PRBool Find (const char *aName)
 
Point the cursor to the entry with the given paper name.
const char * Name ()
 

float Width_mm ()
 

float Height_mm ()
 

PRBool IsMetric ()
 

nsresult Init ()
 Initialize a printer manager object.
PRBool Enabled ()
 Is the PostScript module enabled or disabled?
void GetPrinterList (nsCStringArray &aList)
 Obtain a list of printers (print destinations) supported by the PostScript module, Each entry will be in the form <type>/<name>, where <type> is a printer type string, and <name> is the actual printer name.

Static Public Member Functions

static PrinterType GetPrinterType (const nsACString &aName)
 Identify a printer's type from its name.

Public Attributes

CupsAddOptionType mCupsAddOption
CupsFreeDestsType mCupsFreeDests
CupsGetDestType mCupsGetDest
CupsGetDestsType mCupsGetDests
CupsPrintFileType mCupsPrintFile
CupsTempFdType mCupsTempFd

Static Private Member Functions

static NS_PSSHARED_STATIC_MEMBER_ (const nsPaperSizePS_) mList[]
static NS_PSSHARED_STATIC_MEMBER_ (const unsigned int) mCount

Private Attributes

PRLibrarymCupsLib
unsigned int mCurrent
nsCOMPtr< nsIPrefServicemPrefSvc
nsCOMPtr< nsIPrefBranchmPref
nsCUPSShim mCups

Detailed Description

Definition at line 86 of file nsCUPSShim.h.


Member Enumeration Documentation

Enumerator:
kTypeUnknown 
kTypePS 
kTypeCUPS 

Definition at line 82 of file nsPSPrinters.h.

                         {
            kTypeUnknown,         // Not actually handled by the PS module
            kTypePS,              // Generic postscript module printer
            kTypeCUPS             // CUPS printer
        };

Constructor & Destructor Documentation


Member Function Documentation

PRBool NS_PSSHARED::AtEnd ( ) [inline]


Returns:
PR_TRUE if the cursor points past the last item.

Definition at line 64 of file nsPaperPS.h.

{ return mCurrent >= mCount; }

Here is the caller graph for this function:

Is the PostScript module enabled or disabled?

Returns:
PR_TRUE if enabled, PR_FALSE if not.
PRBool NS_PSSHARED::Find ( const char *  aName)


Point the cursor to the entry with the given paper name.

Returns:
PR_TRUE if pointing to a valid entry.
void NS_PSSHARED::First ( ) [inline]


Position the cursor at the beginning of the paper size list.

Returns:
VOID

Definition at line 70 of file nsPaperPS.h.

{ mCurrent = 0; }
void NS_PSSHARED::GetPrinterList ( nsCStringArray &  aList)

Obtain a list of printers (print destinations) supported by the PostScript module, Each entry will be in the form <type>/<name>, where <type> is a printer type string, and <name> is the actual printer name.

Parameters:
aListUpon return, this is populated with the list of printer names as described above, replacing any previous contents. Each entry is a UTF8 string. There should always be at least one entry. The first entry is the default print destination.
static PrinterType NS_PSSHARED::GetPrinterType ( const nsACString &  aName) [static]

Identify a printer's type from its name.

Parameters:
aNameThe printer's full name as a UTF8 string, including the <type> portion as described for GetPrinterList().
Returns:
The PrinterType value for this name.
float NS_PSSHARED::Height_mm ( ) [inline]


Returns:
the height of the page in millimeters

Definition at line 106 of file nsPaperPS.h.

                          {
            NS_PRECONDITION(!AtEnd(), "Invalid current item");
            return mList[mCurrent].height_mm;
        }

Here is the call graph for this function:

Initialize a printer manager object.

Returns:
NS_ERROR_NOT_INITIALIZED if unable to access prefs NS_OK for successful initialization.

Initialize this object.

Attempt to load the CUPS shared library and find function pointers for the supported functions (see below).

Returns:
PR_FALSE if the shared library could not be loaded, or if any of the functions could not be found. PR_TRUE for successful initialization.
Returns:
PR_TRUE if the object was initialized successfully. PR_FALSE otherwise.

Definition at line 105 of file nsCUPSShim.h.

{ return nsnull != mCupsLib; }


Returns:
PR_TRUE if the paper should be presented to the user in metric units.

Definition at line 115 of file nsPaperPS.h.

                          {
            NS_PRECONDITION(!AtEnd(), "Invalid current item");
            return mList[mCurrent].isMetric;
        }

Here is the call graph for this function:

const char* NS_PSSHARED::Name ( ) [inline]


Returns:
a pointer to the name of the current paper size

Definition at line 90 of file nsPaperPS.h.

                           {
            NS_PRECONDITION(!AtEnd(), "Invalid current item");
            return mList[mCurrent].name;
        }

Here is the call graph for this function:

void NS_PSSHARED::Next ( ) [inline]


Advance the cursor to the next item.

Returns:
VOID

Definition at line 76 of file nsPaperPS.h.

                    {
            NS_WARN_IF_FALSE(!AtEnd(), "Invalid current item");
            mCurrent++;
        }

Here is the call graph for this function:

static NS_PSSHARED::NS_PSSHARED_STATIC_MEMBER_ ( const unsigned  int) [static, private]

Definition at line 88 of file nsCUPSShim.h.


Constructor

Definition at line 59 of file nsPaperPS.h.

{ mCurrent = 0; }
float NS_PSSHARED::Width_mm ( ) [inline]


Returns:
the width of the page in millimeters

Definition at line 98 of file nsPaperPS.h.

                         {
            NS_PRECONDITION(!AtEnd(), "Invalid current item");
            return mList[mCurrent].width_mm;
        }

Here is the call graph for this function:


Member Data Documentation

Definition at line 99 of file nsPSPrinters.h.

Definition at line 110 of file nsCUPSShim.h.

Definition at line 111 of file nsCUPSShim.h.

Definition at line 112 of file nsCUPSShim.h.

Definition at line 113 of file nsCUPSShim.h.

Definition at line 118 of file nsCUPSShim.h.

Definition at line 114 of file nsCUPSShim.h.

Definition at line 115 of file nsCUPSShim.h.

unsigned int NS_PSSHARED::mCurrent [private]

Definition at line 121 of file nsPaperPS.h.

Definition at line 98 of file nsPSPrinters.h.

Definition at line 97 of file nsPSPrinters.h.


The documentation for this protocol was generated from the following files: