#include <ngiter.h>
Inheritance diagram for NameItemIter:
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 SGNameItem * | ForEach () |
Calls NameItemIter::Do for every item in the name gallery. | |
Protected Member Functions | |
SGNameItem * | ForEachItem (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 |
Definition at line 350 of file ngiter.h.
|
Definition at line 356 of file ngiter.h. 00356 { ALL_ITEMS, ALL_NAMES, HIGHLIGHTED_ITEMS, HIGHLIGHTED_NAMES };
|
|
Definition at line 353 of file ngiter.h.
|
|
Constructs a NameItemIter.
Definition at line 581 of file ngiter.cpp. 00582 : m_eMask(mask) 00583 { 00584 // Empty. 00585 }
|
|
|
Calls NameItemIter::Do for every item in the name gallery.
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 }
|
|
Calls NameItemIter::Do for every item in the given group.
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 }
|
|
|