PrintMonitor Class Reference

Monitors print jobs to ensure that we don't try to start more than one simulataneously, and to ensure that print jobs are released when we suffer a serious error (CPU exception). Also repository for printing preferences. More...

#include <prncamvw.h>

Inheritance diagram for PrintMonitor:

SimpleCCObject List of all members.

Public Types

enum  MaskType { MASK_SIMPLE = 0, MASK_MASKED, MASK_OPTIMAL }

Static Public Member Functions

static BOOL StartPrintJob (CNativeDC *)
static void EndPrintJob ()
static BOOL IsPrintStatusOK ()
static BOOL InitPrefs ()
static void SetPrintingActive (BOOL)
static BOOL IsPrintingActive ()
static BOOL IsPrintingNow ()
 Allows you to determine if there is a currently active print happening. This is used to disable screen redrawing, only during the print itself.
static void WantFullRedraw (BOOL)
 Use this function to tell the PrintMonitor that a Full Redraw will be needed at the end of the print job. You can also use this function to tell it that the Full Redraw has been done.
static BOOL IsYieldDisabled ()

Static Public Attributes

static BOOL PrintWithMask = TRUE
static BOOL PrintWithDriverBands = TRUE
static MaskType PrintMaskType = MASK_OPTIMAL
static BOOL FullRedrawNeeded = FALSE
static BOOL s_YieldDisabled = FALSE

Static Protected Attributes

static CNativeDCCurrentPrintJob = NULL
static INT32 MySeriousErrorCount = 0
static BOOL PrintingIsActive = FALSE

Detailed Description

Monitors print jobs to ensure that we don't try to start more than one simulataneously, and to ensure that print jobs are released when we suffer a serious error (CPU exception). Also repository for printing preferences.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/06/95
See also:

Definition at line 119 of file prncamvw.h.


Member Enumeration Documentation

enum PrintMonitor::MaskType
 

Enumerator:
MASK_SIMPLE 
MASK_MASKED 
MASK_OPTIMAL 

Definition at line 132 of file prncamvw.h.

00133     {
00134         MASK_SIMPLE = 0,
00135         MASK_MASKED,
00136         MASK_OPTIMAL
00137     } MaskType;


Member Function Documentation

void PrintMonitor::EndPrintJob  )  [static]
 

Definition at line 153 of file prncamvw.cpp.

00154 {
00155     // Ok, throw away our reference to the print job.
00156     CurrentPrintJob = NULL;
00157 }

BOOL PrintMonitor::InitPrefs  )  [static]
 

Definition at line 260 of file prncamvw.cpp.

00261 {
00262     // Declare and load the .INI file settings.
00263     BOOL ok = Camelot.DeclareSection(TEXT("Printing"), 10) &&
00264               Camelot.DeclarePref(TEXT("Printing"), TEXT("PrintMaskType"),
00265                                   (INT32 *) &PrintMonitor::PrintMaskType, MASK_SIMPLE, MASK_OPTIMAL) &&
00266               Camelot.DeclarePref(TEXT("Printing"), TEXT("PrintWithDriverBands"),
00267                                   &PrintMonitor::PrintWithDriverBands, FALSE, TRUE);
00268               Camelot.DeclarePref(TEXT("Printing"), TEXT("DisableYield"),
00269                                   &PrintMonitor::s_YieldDisabled, FALSE, TRUE);
00270     return ok;
00271 }

BOOL PrintMonitor::IsPrintingActive  )  [static]
 

Definition at line 211 of file prncamvw.cpp.

00212 {
00213     return (PrintingIsActive);
00214 }

BOOL PrintMonitor::IsPrintingNow  )  [static]
 

Allows you to determine if there is a currently active print happening. This is used to disable screen redrawing, only during the print itself.

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
Date:
3/8/95
Returns:
TRUE if we are activly printing NOW, FALSE if not

Definition at line 229 of file prncamvw.cpp.

00230 {
00231     // if there is no print job, then we are not printing
00232     if (CurrentPrintJob==NULL)
00233         return FALSE;
00234 
00235     // otherwise we are printing
00236     return TRUE;
00237 }

BOOL PrintMonitor::IsPrintStatusOK  )  [static]
 

Definition at line 159 of file prncamvw.cpp.

00160 {
00161 PORTNOTE("printing", "Disabled IsPrintStatusOK()")
00162 #ifndef EXCLUDE_FROM_XARALX
00163     if (CCamApp::SeriousErrorCount == MySeriousErrorCount)
00164     {
00165         // We haven't had a serious error so any current print job will be
00166         // proceeding normally.
00167         return TRUE;
00168     }
00169 
00170     // Update our error count so we get back in sync.
00171     MySeriousErrorCount = CCamApp::SeriousErrorCount;
00172 
00173     BOOL Result = TRUE;
00174 
00175     // An error has occured - delete the print job if necessary.
00176     if (CurrentPrintJob != NULL)
00177     {
00178         // Use a semaphore structure here so we don't do this more than once.
00179         CNativeDC * PrintDC = CurrentPrintJob;
00180         CurrentPrintJob = NULL;
00181         ::AbortDoc(PrintDC);
00182 
00183         // Something's gone wrong - tell caller to remove all printing render regions.
00184         Result = FALSE;
00185     }
00186 //  WEBSTER-ranbirr-12/11/96
00187 #ifndef WEBSTER
00188     CCPrintInfo *pPrintInfo = CCPrintInfo::GetCurrent();
00189     if (pPrintInfo != NULL)
00190     {
00191         // Close down and delete this print info object (this will delete the print progress 
00192         // dialog etc.)
00193         pPrintInfo->EndPrinting();
00194         delete pPrintInfo;
00195 
00196         // Something's gone wrong - tell caller to remove all printing render regions.
00197         Result = FALSE;
00198     }
00199 #endif //webster
00200     // Re-enable print Operation, and return result to caller.
00201     SetPrintingActive(FALSE);
00202 #endif
00203     return TRUE;
00204 }

static BOOL PrintMonitor::IsYieldDisabled  )  [inline, static]
 

Definition at line 130 of file prncamvw.h.

00130 {return s_YieldDisabled;}

void PrintMonitor::SetPrintingActive BOOL   )  [static]
 

Definition at line 206 of file prncamvw.cpp.

00207 {
00208     PrintingIsActive = Flag;
00209 }

BOOL PrintMonitor::StartPrintJob CNativeDC  )  [static]
 

Definition at line 130 of file prncamvw.cpp.

00131 {
00132     // Make sure we don't already have a print job going.
00133     if (CurrentPrintJob != NULL)
00134     {
00135 PORTNOTE("printing", "Don't call ::AbortDoc")
00136 #ifndef EXCLUDE_FROM_XARALX
00137         // Print job going already - must have been terminated early if the
00138         // user has initiated another print job, so clean it up first.
00139         if (::AbortDoc(CurrentPrintJob) <= 0)
00140         {
00141             // Could not abort print job.
00142             CurrentPrintJob = NULL;
00143             ERROR1(FALSE, _R(IDE_ALREADY_PRINTING));
00144         }
00145 #endif
00146     }
00147 
00148     // Ok, starting a print job - keep a record of it.
00149     CurrentPrintJob = PrintJobDC;
00150     return TRUE;
00151 }

void PrintMonitor::WantFullRedraw BOOL  WantRedraw  )  [static]
 

Use this function to tell the PrintMonitor that a Full Redraw will be needed at the end of the print job. You can also use this function to tell it that the Full Redraw has been done.

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
Date:
3/8/95
Parameters:
WantRedraw - TRUE if we want to force a redraw, FALSE if not [INPUTS]

Definition at line 254 of file prncamvw.cpp.

00255 {
00256     FullRedrawNeeded = WantRedraw;
00257 }


Member Data Documentation

CNativeDC * PrintMonitor::CurrentPrintJob = NULL [static, protected]
 

Definition at line 147 of file prncamvw.h.

BOOL PrintMonitor::FullRedrawNeeded = FALSE [static]
 

Definition at line 143 of file prncamvw.h.

INT32 PrintMonitor::MySeriousErrorCount = 0 [static, protected]
 

Definition at line 148 of file prncamvw.h.

BOOL PrintMonitor::PrintingIsActive = FALSE [static, protected]
 

Definition at line 149 of file prncamvw.h.

PrintMonitor::MaskType PrintMonitor::PrintMaskType = MASK_OPTIMAL [static]
 

Definition at line 142 of file prncamvw.h.

BOOL PrintMonitor::PrintWithDriverBands = TRUE [static]
 

Definition at line 141 of file prncamvw.h.

BOOL PrintMonitor::PrintWithMask = TRUE [static]
 

Definition at line 140 of file prncamvw.h.

BOOL PrintMonitor::s_YieldDisabled = FALSE [static]
 

Definition at line 144 of file prncamvw.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 04:00:04 2007 for Camelot by  doxygen 1.4.4