PrintMark Class Reference

This class contains all the information pertaining to a mark. ie the type of mark it is, its menu text, icon id and a list of all the regions and formatting rules it uses. More...

#include <prnmks.h>

List of all members.

Public Member Functions

 PrintMark ()
 Construct a new print mark.
 ~PrintMark ()
 virtual destructor, destroys all instances of the 'MarkPositions' list
void SetCustomOrDefault (BOOL IsCustom)
void SetIDByte (BYTE NewID)
void SetType (MarkType type)
void SetMarkMenuText (const String_256 *pMenuText)
 Set this print mars menu text.
void SetOrientation (MarkOrient orient)
void SetDefaultState (BOOL enabled)
void AddNewPosition (MarkPosition *pMarkPos)
 Return the menu text string saved in this print mark.
BOOL DefaultsToOn () const
BOOL IsCustom (void) const
BYTE GetIDByte (void) const
MarkType GetType () const
String_256 GetMarkMenuText () const
 Return the menu text string saved in this print mark.
BOOL FindMarkPosition (const MarkPosition *pSearchMark, MarkPosition **pFoundMark=NULL) const
 Check the cache to see if there's a mark already in it which matches pSearchMark. You can get the pointer to this cached mark by using pFoundMark.
BOOL IsSimilarTo (const PrintMark *pOther) const
 Checks whether this print mark is similar to pOther. The current checks for similarity are... (1) the mark is of the same type (2) the mark has the same menu text.
MarkOrient GetOrientation () const
MarkPositionGetFirstPosition () const
MarkPositionGetNextPosition (MarkPosition *pMP) const

Private Member Functions

 CC_DECLARE_MEMDUMP (PrintMark)

Private Attributes

BOOL MarkIsCustom
BYTE IDByte
MarkType Type
MarkOrient Orientation
BOOL OnAsDefault
String_256 MenuText
List MarkPositions


Detailed Description

This class contains all the information pertaining to a mark. ie the type of mark it is, its menu text, icon id and a list of all the regions and formatting rules it uses.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/07/96

Definition at line 289 of file prnmks.h.


Constructor & Destructor Documentation

PrintMark::PrintMark  ) 
 

Construct a new print mark.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/07/96

Definition at line 320 of file prnmks.cpp.

00321 {
00322     MarkIsCustom    = FALSE;
00323     IDByte          = 0;
00324     Type            = MarkType_Unknown;
00325     Orientation     = MO_None;
00326     OnAsDefault     = FALSE;
00327 }

PrintMark::~PrintMark  ) 
 

virtual destructor, destroys all instances of the 'MarkPositions' list

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/07/96

Definition at line 340 of file prnmks.cpp.

00341 {
00342     MarkPosition* pMarkPos;
00343     while ((pMarkPos=(MarkPosition*)MarkPositions.RemoveTail()))
00344         delete pMarkPos;
00345 }


Member Function Documentation

void PrintMark::AddNewPosition MarkPosition pNewMarkPos  ) 
 

Return the menu text string saved in this print mark.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/07/96
Parameters:
pNewMarkPos,a pointer to a new mark position [INPUTS]
Returns:
This print marks textual description

Definition at line 399 of file prnmks.cpp.

00400 {
00401     ERROR3IF(pNewMarkPos==NULL,"NULL MarkPosition pointer passed to AddNewPosition");
00402     if (pNewMarkPos)
00403     {
00404         if (!FindMarkPosition(pNewMarkPos))
00405             MarkPositions.AddTail(pNewMarkPos);
00406     }
00407 }

PrintMark::CC_DECLARE_MEMDUMP PrintMark   )  [private]
 

BOOL PrintMark::DefaultsToOn  )  const [inline]
 

Definition at line 305 of file prnmks.h.

00305 { return OnAsDefault; }

BOOL PrintMark::FindMarkPosition const MarkPosition pSearchMark,
MarkPosition **  pFoundMark = NULL
const
 

Check the cache to see if there's a mark already in it which matches pSearchMark. You can get the pointer to this cached mark by using pFoundMark.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/07/96
Parameters:
pSearchMark = a pointer to a print mark to search for [INPUTS] pFoundMark, a pointer to a pointer to be set on exit. This defaults to null when we're only interested in whether the mark exists or not.
pFoundMark set to a pointer to the print mark in the cache if we find it [OUTPUTS] pFoundMark set to NULL if no match found
Returns:
TRUE if there is a mark in the cache identical to this search mark FALSE if there isn't

Definition at line 429 of file prnmks.cpp.

00430 {
00431     ERROR3IF(pSearchMark==NULL,"PrintMark::FindMarkPosition passed a NULL search mark pointer");
00432     if (pSearchMark)
00433     {
00434         MarkPosition* pMarkPos = GetFirstPosition();
00435         while (pMarkPos)
00436         {
00437             // Check to see if this exists
00438             if (pSearchMark->IsEqualTo(pMarkPos))
00439             {
00440                 if (pFoundMark!=NULL)
00441                     (*pFoundMark=pMarkPos);
00442                 return TRUE;
00443             }
00444             pMarkPos = GetNextPosition(pMarkPos);
00445         }
00446     }
00447     if (pFoundMark!=NULL)
00448         (*pFoundMark=NULL);
00449     return FALSE;
00450 }

MarkPosition* PrintMark::GetFirstPosition  )  const [inline]
 

Definition at line 316 of file prnmks.h.

00316 { return (MarkPosition*)MarkPositions.GetHead(); }

BYTE PrintMark::GetIDByte void   )  const [inline]
 

Definition at line 308 of file prnmks.h.

00308 { return(IDByte); }

String_256 PrintMark::GetMarkMenuText  )  const
 

Return the menu text string saved in this print mark.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/07/96
Parameters:
- [INPUTS]
Returns:
This print marks textual description

Definition at line 381 of file prnmks.cpp.

00382 {
00383     return MenuText;
00384 }

MarkPosition* PrintMark::GetNextPosition MarkPosition pMP  )  const [inline]
 

Definition at line 318 of file prnmks.h.

00319                                                         { return (MarkPosition*)MarkPositions.GetNext(pMP); }

MarkOrient PrintMark::GetOrientation  )  const [inline]
 

Definition at line 314 of file prnmks.h.

00314 { return Orientation; }

MarkType PrintMark::GetType void   )  const [inline]
 

Definition at line 309 of file prnmks.h.

00309 { return Type; }

BOOL PrintMark::IsCustom void   )  const [inline]
 

Definition at line 307 of file prnmks.h.

00307 { return(MarkIsCustom); }

BOOL PrintMark::IsSimilarTo const PrintMark pOther  )  const
 

Checks whether this print mark is similar to pOther. The current checks for similarity are... (1) the mark is of the same type (2) the mark has the same menu text.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/07/96
Parameters:
pOther,a pointer to another print mark [INPUTS]
Returns:
TRUE if this print mark is similar to pOther. FALSE if not

Definition at line 468 of file prnmks.cpp.

00469 {
00470     ERROR2IF(pOther==NULL, FALSE, "NULL PrintMark pointer passed to IsSimilar()");
00471 
00472     if (Type == pOther->GetType())
00473     {
00474         if (MenuText == pOther->GetMarkMenuText())
00475             return TRUE;
00476     }
00477     return FALSE;
00478 }

void PrintMark::SetCustomOrDefault BOOL  IsCustom  )  [inline]
 

Definition at line 297 of file prnmks.h.

00297 { MarkIsCustom = IsCustom; }

void PrintMark::SetDefaultState BOOL  enabled  )  [inline]
 

Definition at line 302 of file prnmks.h.

00302 { OnAsDefault = enabled; }

void PrintMark::SetIDByte BYTE  NewID  )  [inline]
 

Definition at line 298 of file prnmks.h.

00298 { IDByte = NewID; }

void PrintMark::SetMarkMenuText const String_256 pMenuText  ) 
 

Set this print mars menu text.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/07/96
Parameters:
pMenuText = a pointer to a string containing the textual description of [INPUTS] the print mark, (may be used in menus).

Definition at line 361 of file prnmks.cpp.

00362 {
00363     ERROR3IF(pMenuText==NULL,"ERROR ERROR, NULL pointer passed to SetMarkMenuText");
00364     if (pMenuText!=NULL)
00365         MenuText = (*pMenuText);
00366 }

void PrintMark::SetOrientation MarkOrient  orient  )  [inline]
 

Definition at line 301 of file prnmks.h.

00301 { Orientation = orient; }

void PrintMark::SetType MarkType  type  )  [inline]
 

Definition at line 299 of file prnmks.h.

00299 { Type = type; }


Member Data Documentation

BYTE PrintMark::IDByte [private]
 

Definition at line 323 of file prnmks.h.

BOOL PrintMark::MarkIsCustom [private]
 

Definition at line 322 of file prnmks.h.

List PrintMark::MarkPositions [private]
 

Definition at line 328 of file prnmks.h.

String_256 PrintMark::MenuText [private]
 

Definition at line 327 of file prnmks.h.

BOOL PrintMark::OnAsDefault [private]
 

Definition at line 326 of file prnmks.h.

MarkOrient PrintMark::Orientation [private]
 

Definition at line 325 of file prnmks.h.

MarkType PrintMark::Type [private]
 

Definition at line 324 of file prnmks.h.


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