SGUsedColours Class Reference

#include <ngitem.h>

Inheritance diagram for SGUsedColours:

SGNameGroup SGDisplayGroup SGDisplayGroup SGDisplayNode SGDisplayNode CCObject CCObject SimpleCCObject SimpleCCObject List of all members.

Public Member Functions

 SGUsedColours ()
virtual BOOL IsMember (Node *, const StringBase &) const
virtual BOOL CreateItems (Node *)
 Create 'Used Names' set items for the node, as appropriate.

Protected Member Functions

virtual SGNameItemMakeItem (const StringBase &strName) const
 Seize control of the group's title from the base class.
SGUsedColourItemRegisterMember (Node *, const StringBase &, DocColour *pCol)
 Register a 'Used Colours' set item for the node.

Static Protected Member Functions

static const StringBaseIsNamedColour (DocColour *pCol)
 Helper to the SGUsedColours display group.

Detailed Description

Definition at line 350 of file ngitem.h.


Constructor & Destructor Documentation

SGUsedColours::SGUsedColours  )  [inline]
 

Definition at line 353 of file ngitem.h.

00354       : SGNameGroup(_R(IDS_NAMEGAL_COLOURS_TYPE), _R(IDS_NAMEGAL_COLOURS_TITLE))
00355             { /* empty */ }


Member Function Documentation

BOOL SGUsedColours::CreateItems Node pNode  )  [virtual]
 

Create 'Used Names' set items for the node, as appropriate.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/6/99
Parameters:
pNode --- the node to test/register for membership [INPUTS]
Returns:
FALSE for an error, eg. out of memory.
See also:
SGNameGroup::RegisterMember; SGUsedColours::IsMember; CreateDisplayScan::CreateItems::Do

Implements SGNameGroup.

Definition at line 1522 of file ngitem.cpp.

01523 {
01524     const StringBase* pstrCol;
01525     DocColour* pCol;
01526     AttrFillGeometry* pAttr;
01527 
01528     for (pAttr = (AttrFillGeometry*) pNode->FindFirstAttr( &Node::IsAFillAttr );
01529          pAttr != 0;
01530          pAttr = (AttrFillGeometry*) pAttr->FindNextAttr( &Node::IsAFillAttr ))
01531     {
01532         pCol = pAttr->GetStartColour();
01533         if (pCol != 0)
01534         {
01535             pstrCol = IsNamedColour(pCol);
01536             if (pstrCol != 0 && RegisterMember(pNode, *pstrCol, pCol) == 0)
01537                 return FALSE;
01538         }
01539 
01540         pCol = pAttr->GetEndColour();
01541         if (pCol != 0)
01542         {
01543             pstrCol = IsNamedColour(pCol);
01544             if (pstrCol != 0 && RegisterMember(pNode, *pstrCol, pCol) == 0)
01545                 return FALSE;
01546         }
01547 
01548         pCol = pAttr->GetEndColour2();
01549         if (pCol != 0)
01550         {
01551             pstrCol = IsNamedColour(pCol);
01552             if (pstrCol != 0 && RegisterMember(pNode, *pstrCol, pCol) == 0)
01553                 return FALSE;
01554         }
01555 
01556         pCol = pAttr->GetEndColour3();
01557         if (pCol != 0)
01558         {
01559             pstrCol = IsNamedColour(pCol);
01560             if (pstrCol != 0 && RegisterMember(pNode, *pstrCol, pCol) == 0)
01561                 return FALSE;
01562         }
01563     }
01564 
01565     return TRUE;
01566 }

BOOL SGUsedColours::IsMember Node pNode,
const StringBase strName
const [virtual]
 

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/6/99
Parameters:
pNode --- the node to test for membership [INPUTS] strName --- the set value (name) to test for equality
Returns:
TRUE if the given node is a member of the given set within this group.
See also:
SGNameGroup::RegisterMember; SGNameItem::IsMember; CreateDisplayScan::CreateItems::Do

Implements SGNameGroup.

Definition at line 1462 of file ngitem.cpp.

01463 {
01464     const StringBase* pstrCol;
01465     DocColour* pCol;
01466     AttrFillGeometry* pAttr;
01467 
01468     for (pAttr = (AttrFillGeometry*) pNode->FindFirstAttr( &Node::IsAFillAttr );
01469          pAttr != 0;
01470          pAttr = (AttrFillGeometry*) pAttr->FindNextAttr( &Node::IsAFillAttr ) )
01471     {
01472         pCol = pAttr->GetStartColour();
01473         if (pCol != 0)
01474         {
01475             pstrCol = IsNamedColour(pCol);
01476             if (pstrCol != 0 && *pstrCol == strName)
01477                 return TRUE;
01478         }
01479 
01480         pCol = pAttr->GetEndColour();
01481         if (pCol != 0)
01482         {
01483             pstrCol = IsNamedColour(pCol);
01484             if (pstrCol != 0 && *pstrCol == strName)
01485                 return TRUE;
01486         }
01487 
01488         pCol = pAttr->GetEndColour2();
01489         if (pCol != 0)
01490         {
01491             pstrCol = IsNamedColour(pCol);
01492             if (pstrCol != 0 && *pstrCol == strName)
01493                 return TRUE;
01494         }
01495 
01496         pCol = pAttr->GetEndColour3();
01497         if (pCol != 0)
01498         {
01499             pstrCol = IsNamedColour(pCol);
01500             if (pstrCol != 0 && *pstrCol == strName)
01501                 return TRUE;
01502         }
01503     }
01504 
01505     return FALSE;
01506 }

const StringBase * SGUsedColours::IsNamedColour DocColour pCol  )  [static, protected]
 

Helper to the SGUsedColours display group.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/6/99
Parameters:
pCol --- the colour to test for nomination [INPUTS]
strName --- name of the colour, if any [OUTPUTS]
Returns:
Null if the colour isn't named, the address of its name if it is.
See also:
DocColour::FindParentIndexedColour; IndexedColour::GetName SGUsedColours::IsMember; SGUsedColours::CreateItems

Definition at line 1441 of file ngitem.cpp.

01442 {
01443     ERROR3IF(pCol == 0, "SGUsedColours::IsNamedColour: null input");
01444     IndexedColour* pIndex = pCol->FindParentIndexedColour();
01445     return pIndex != 0 && pIndex->IsNamed() ? pIndex->GetName() : 0;
01446 }

virtual SGNameItem* SGUsedColours::MakeItem const StringBase strName  )  const [inline, protected, virtual]
 

Seize control of the group's title from the base class.

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

Reimplemented from SGNameGroup.

Definition at line 363 of file ngitem.h.

00364             { return new SGUsedColourItem(strName); }

SGUsedColourItem * SGUsedColours::RegisterMember Node pNode,
const StringBase strName,
DocColour pCol
[protected]
 

Register a 'Used Colours' set item for the node.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/6/99
Returns:
0 for out of memory, pointer to the SGUsedColourItem if successful.
See also:
SGNameGroup::RegisterMember

Definition at line 1416 of file ngitem.cpp.

01418 {
01419     SGUsedColourItem* pItem =
01420                 (SGUsedColourItem*) SGNameGroup::RegisterMember(pNode, strName);
01421     ERROR3IF(pCol == 0, "SGUsedColours::RegisterMember: null input");
01422     if (pItem != 0) pItem->SetPatchColour(pCol->FindParentIndexedColour());
01423     return pItem;
01424 }


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