SGNameProp Class Reference

Abstract base class for the various kinds of properties associated with SGNameItems. More...

#include <ngprop.h>

Inheritance diagram for SGNameProp:

NamedExportProp NamedTickboxProp NamedSliceProp NamedStretchProp List of all members.

Public Types

enum  { nPropertyCount = 3 }

Public Member Functions

 SGNameProp (const StringBase &strName, INT32 nIndex)
 Constructs an SGNameProp object.
 SGNameProp (const SGNameProp &other)
 Copy constructor.
virtual ~SGNameProp ()
 Destroys an SGNameProp object.
const StringBaseGetName () const
INT32 GetIndex () const
BOOL IsVirgin () const
void SetDirty ()
virtual BOOL HandleMouse (SGNameItem *, SGMouseInfo *, SGMiscInfo *)=0
virtual void CalcUiBounds (SGNameItem *, SGFormatInfo *, SGMiscInfo *, DocRect *)=0
virtual BOOL HandleRedraw (SGNameItem *, SGRedrawInfo *, SGMiscInfo *, const DocRect &)=0
virtual BOOL Write (CXaraFileRecord *pRec)
 Writes out an SGNameProp record. Derived classes should call this before writing their specific data.
virtual BOOL Read (CXaraFileRecord *pRec)
 Reads in an SGNameProp record. Derived classes should call this before reading their specific data.
virtual SGNamePropClone ()=0

Static Public Member Functions

static SGNamePropCreateDefault (const StringBase &strName, INT32 nIndex)

Protected Member Functions

virtual BOOL Change (SGNameItem *pItem, SGNameProp *pNewProp, StringBase *pstrNewName=0)

Private Member Functions

 CC_DECLARE_MEMDUMP (SGNameProp)

Private Attributes

StringBase m_strName
INT32 m_nIndex
BOOL m_fIsVirgin

Detailed Description

Abstract base class for the various kinds of properties associated with SGNameItems.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/8/99
See also:
NamedTickboxProp; SGNameItem; NameGallery

Definition at line 126 of file ngprop.h.


Member Enumeration Documentation

anonymous enum
 

Enumerator:
nPropertyCount 

Definition at line 131 of file ngprop.h.

00131 { nPropertyCount = 3 };


Constructor & Destructor Documentation

SGNameProp::SGNameProp const StringBase strName,
INT32  nIndex
 

Constructs an SGNameProp object.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/8/99
Parameters:
strName --- the name of the set associated with this property [INPUTS] nIndex --- the index (type) of the property

Definition at line 179 of file ngprop.cpp.

00180   : m_nIndex(nIndex),
00181     m_fIsVirgin(TRUE)
00182 {
00183     ERROR3IF(nIndex < 0 || nIndex >= nPropertyCount,
00184                     "SGNameProp::SGNameProp: index out of range");
00185     m_strName.Alloc(strName.Length() + 1);
00186     m_strName = strName;
00187 }

SGNameProp::SGNameProp const SGNameProp other  ) 
 

Copy constructor.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/8/99

Definition at line 214 of file ngprop.cpp.

00215   : m_nIndex(other.m_nIndex),
00216     m_fIsVirgin(other.m_fIsVirgin)
00217 {
00218     m_strName.Alloc(other.m_strName.Length() + 1);
00219     m_strName = other.m_strName;
00220 }

SGNameProp::~SGNameProp  )  [virtual]
 

Destroys an SGNameProp object.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/8/99

Definition at line 199 of file ngprop.cpp.

00200 {
00201     // Empty.
00202 }


Member Function Documentation

virtual void SGNameProp::CalcUiBounds SGNameItem ,
SGFormatInfo ,
SGMiscInfo ,
DocRect
[pure virtual]
 

Implemented in NamedTickboxProp, NamedExportProp, and NamedStretchProp.

SGNameProp::CC_DECLARE_MEMDUMP SGNameProp   )  [private]
 

BOOL SGNameProp::Change SGNameItem pItem,
SGNameProp pNewProp,
StringBase pstrNewName = 0
[protected, virtual]
 

Definition at line 277 of file ngprop.cpp.

00278 {
00279     String_256 strName;
00280     pItem->GetNameText(&strName);
00281 
00282     StringBase* apstr[2];
00283     apstr[0] = &strName;
00284     apstr[1] = pstrNewName;
00285     
00286     OpDescriptor* pDesc = OpDescriptor::FindOpDescriptor( OPTOKEN_CHANGE_SET_PROPERTY );
00287     ERROR3IF(pDesc == 0, "SGNameProp::Change: can't find OpDescriptor");
00288     OpParam             param( apstr, pNewProp );
00289     pDesc->Invoke( &param );
00290     return TRUE;
00291 }

virtual SGNameProp* SGNameProp::Clone  )  [pure virtual]
 

Implemented in NamedExportProp, NamedSliceProp, and NamedStretchProp.

SGNameProp * SGNameProp::CreateDefault const StringBase strName,
INT32  nIndex
[static]
 

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/8/99
Parameters:
strName --- the name of the set to create a default SGNameProp for [INPUTS] nIndex --- the type of property to create
Returns:
A default property of the given index (type) created in the heap.

Definition at line 234 of file ngprop.cpp.

00235 {
00236     SGNameProp* pProp;
00237     switch (nIndex)
00238     {
00239     case NamedExportProp::nIndex:
00240         pProp = new NamedExportProp(strName);
00241         break;
00242 
00243     case NamedSliceProp::nIndex:
00244         pProp = new NamedSliceProp(strName, TRUE);      // by default is a slice
00245         break;
00246 
00247     case NamedStretchProp::nIndex:
00248         pProp = new NamedStretchProp(strName);
00249         break;
00250 
00251     default:
00252         ERROR3("SGNameProp::CreateDefault: index out of range");
00253         pProp = 0;
00254         break;
00255     }
00256 
00257     ERRORIF(pProp == 0, _R(IDE_NOMORE_MEMORY), 0);
00258     return pProp;
00259 }

INT32 SGNameProp::GetIndex  )  const [inline]
 

Definition at line 143 of file ngprop.h.

00143 { return m_nIndex; }

const StringBase& SGNameProp::GetName void   )  const [inline]
 

Definition at line 142 of file ngprop.h.

00142 { return m_strName; }

virtual BOOL SGNameProp::HandleMouse SGNameItem ,
SGMouseInfo ,
SGMiscInfo
[pure virtual]
 

Implemented in NamedTickboxProp, NamedExportProp, and NamedStretchProp.

virtual BOOL SGNameProp::HandleRedraw SGNameItem ,
SGRedrawInfo ,
SGMiscInfo ,
const DocRect
[pure virtual]
 

Implemented in NamedTickboxProp, NamedExportProp, and NamedStretchProp.

BOOL SGNameProp::IsVirgin  )  const [inline]
 

Definition at line 147 of file ngprop.h.

00147 { return m_fIsVirgin; }

BOOL SGNameProp::Read CXaraFileRecord pRec  )  [virtual]
 

Reads in an SGNameProp record. Derived classes should call this before reading their specific data.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
31/9/99
Parameters:
pRec --- record to read from [INPUTS]
Returns:
TRUE if the object has successfully read in its record.

Reimplemented in NamedTickboxProp, NamedExportProp, NamedSliceProp, and NamedStretchProp.

Definition at line 325 of file ngprop.cpp.

00326 {
00327     // Read in the virgin state.
00328     BYTE n;
00329     if (!pRec->ReadBYTE(&n)) return FALSE;
00330     m_fIsVirgin = (BOOL) n;
00331     return TRUE;
00332 }

void SGNameProp::SetDirty  )  [inline]
 

Definition at line 148 of file ngprop.h.

00148 { m_fIsVirgin = FALSE; }

BOOL SGNameProp::Write CXaraFileRecord pRec  )  [virtual]
 

Writes out an SGNameProp record. Derived classes should call this before writing their specific data.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
31/9/99
Parameters:
pRec --- record to write to [INPUTS]
Returns:
TRUE if the object has successfully written out its record.

Reimplemented in NamedTickboxProp, NamedExportProp, NamedSliceProp, and NamedStretchProp.

Definition at line 306 of file ngprop.cpp.

00307 {
00308     // Write out the virgin state.
00309     return pRec->WriteBYTE((BYTE) m_fIsVirgin);
00310 }


Member Data Documentation

BOOL SGNameProp::m_fIsVirgin [private]
 

Definition at line 177 of file ngprop.h.

INT32 SGNameProp::m_nIndex [private]
 

Definition at line 176 of file ngprop.h.

StringBase SGNameProp::m_strName [private]
 

Definition at line 175 of file ngprop.h.


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