NameItemIter Class Reference

Abstract base classes for iterations and searches over all groups and all items in the Name gallery. More...

#include <ngiter.h>

Inheritance diagram for NameItemIter:

CreateDisplayScan::ClearCounters CreateDisplayScan::DelItemIfUnref NameIterOp OpExportSets::ExportHighlightedIter SelectUnionScan::Test AllowOpScan::IsLitUsedName ApplyScan::ApplyItems HideScan::HideItems HidePropScan::HideProp List of all members.

Public Types

enum  Mask { ALL_ITEMS, ALL_NAMES, HIGHLIGHTED_ITEMS, HIGHLIGHTED_NAMES }

Public Member Functions

virtual ~NameItemIter ()
 NameItemIter (Mask mask=ALL_ITEMS)
 Constructs a NameItemIter.
virtual SGNameItemForEach ()
 Calls NameItemIter::Do for every item in the name gallery.

Protected Member Functions

SGNameItemForEachItem (SGNameGroup *pGroup)
 Calls NameItemIter::Do for every item in the given group.

Private Member Functions

virtual BOOL Do (SGNameItem *pItem)=0

Private Attributes

Mask m_eMask

Detailed Description

Abstract base classes for iterations and searches over all groups and all items in the Name gallery.

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

Definition at line 350 of file ngiter.h.


Member Enumeration Documentation

enum NameItemIter::Mask
 

Enumerator:
ALL_ITEMS 
ALL_NAMES 
HIGHLIGHTED_ITEMS 
HIGHLIGHTED_NAMES 

Definition at line 356 of file ngiter.h.


Constructor & Destructor Documentation

virtual NameItemIter::~NameItemIter  )  [inline, virtual]
 

Definition at line 353 of file ngiter.h.

00353 { }

NameItemIter::NameItemIter NameItemIter::Mask  mask = ALL_ITEMS  ) 
 

Constructs a NameItemIter.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/7/99
Parameters:
mask --- what to iterate over (ALL_ITEMS, ALL_NAMES, [INPUTS] HIGHLIGHTED_ITEMS, HIGHLIGHTED_NAMES)
See also:
NameGroupIter; NameIterOp

Definition at line 581 of file ngiter.cpp.

00582   : m_eMask(mask)
00583 {
00584     // Empty.
00585 }


Member Function Documentation

virtual BOOL NameItemIter::Do SGNameItem pItem  )  [private, pure virtual]
 

Implemented in SelectUnionScan::Test, AllowOpScan::IsLitUsedName, ApplyScan::ApplyItems, HideScan::HideItems, HidePropScan::HideProp, CreateDisplayScan::ClearCounters, CreateDisplayScan::DelItemIfUnref, and OpExportSets::ExportHighlightedIter.

SGNameItem * NameItemIter::ForEach  )  [virtual]
 

Calls NameItemIter::Do for every item in the name gallery.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/7/99
Returns:
Null if all Do() calls succeed, a pointer to the failing item if a Do() call fails.
See also:
NodeScan

Definition at line 599 of file ngiter.cpp.

00600 {
00601     PORTNOTETRACE("other","NameItemIter::ForEach - do nothing");
00602 #ifndef EXCLUDE_FROM_XARALX
00603     // Just the items in 'Used Names'?
00604     if (INT32(m_eMask) & 1)
00605         return ForEachItem(NameGallery::Instance()->GetUsedNames());
00606 
00607     // Items in all the groups.
00608     SGNameGroup* pGroup = NameGallery::Instance()->GetFirstGroup();
00609     while (pGroup != 0)
00610     {
00611         SGNameGroup* pNextGroup = (SGNameGroup*) pGroup->GetNext();
00612         SGNameItem* pStopItem = ForEachItem(pGroup);
00613         if (pStopItem != 0) return pStopItem;
00614         pGroup = pNextGroup;
00615     }
00616 #endif
00617     // No item stopped the iteration.
00618     return NULL;
00619 }

SGNameItem * NameItemIter::ForEachItem SGNameGroup pGroup  )  [protected]
 

Calls NameItemIter::Do for every item in the given group.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/7/99
Returns:
Null if all Do() calls succeed, a pointer to the failing item if a Do() call fails.
See also:
NameIterItem::ForEach

Definition at line 634 of file ngiter.cpp.

00635 {
00636     if (pGroup == 0) return 0;
00637 
00638     SGNameItem* pItem = (SGNameItem*) pGroup->GetChild();
00639     while (pItem != 0)
00640     {
00641         // NB. careful to fetch next item in iteration before calling Do() in case
00642         // Do() deletes the item and we lose its next link.
00643         SGNameItem* pNextItem = (SGNameItem*) pItem->GetNext();
00644         if (((INT32(m_eMask) & 2) == 0 || pItem->IsSelected()) && !Do(pItem))
00645             return pItem;
00646         pItem = pNextItem;
00647     }
00648 
00649     return 0;
00650 }


Member Data Documentation

Mask NameItemIter::m_eMask [private]
 

Definition at line 369 of file ngiter.h.


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