InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ListLazyNotificationData< ItemType > Class Template Reference

#include <ListLazyNotificationData.h>

Inheritance diagram for ListLazyNotificationData< ItemType >:
LazyNotificationData

Public Member Functions

 ListLazyNotificationData ()
 
virtual void Add (const LazyNotificationData *other)
 
virtual LazyNotificationDataClone (bool16 undoData) const
 
virtual void MarkShouldRebuildAll ()
 
void ItemAdded (ItemType itemID)
 
void ItemDeleted (ItemType itemID)
 
void ItemChanged (ItemType itemID)
 
void BreakoutChanges (K2Vector< ItemType > *addedItems, K2Vector< ItemType > *deletedItems, K2Vector< ItemType > *changedItems) const
 
bool ShouldRebuildAll () const
 
virtual void Validate (IDataBase *db)
 
- Public Member Functions inherited from LazyNotificationData
virtual ~LazyNotificationData ()
 

Detailed Description

template<class ItemType>
class ListLazyNotificationData< ItemType >

This class should be used to indicate to observers which items in a list have changed and how they have actually changed.

Constructor & Destructor Documentation

template<class ItemType>
ListLazyNotificationData< ItemType >::ListLazyNotificationData()
inline

Default Constructor

Member Function Documentation

template<class ItemType>
virtual void ListLazyNotificationData< ItemType >::Add (const LazyNotificationDataother)
virtual

Use this to add another cookie (of the same type) into this cookie All of the appropriate rules for merging cookies will be followed. While this method can be called by anybody it was created to allow the multiple cookies created from a string of commands to be combined into a single cookie for passing to the appropriate observers.

Parameters
other- The other item to add into this one. NOTE: This method assumes that the two objects can be downcast to the same type of object.

Implements LazyNotificationData.

template<class ItemType>
void ListLazyNotificationData< ItemType >::BreakoutChanges (K2Vector< ItemType > * addedItems,
K2Vector< ItemType > * deletedItems,
K2Vector< ItemType > * changedItems 
) const

Use this method to determine what changes have actually happened to the model. Items will be separated into three lists for you. This method should be called by the observer in LazyUpdate to figure out which items actually changed and how.

Parameters
addedItems- OPTIONAL IN/OUT will be filled with the list of items which were added. Pass nil to ignore added items
deletedItems- OPTIONAL IN/OUT will be filled with the list of items which were deleted. Pass nil to ignore deleted items
changedItems- OPTIONAL IN/OUT will be filled with the list of items which were changed. Pass nil to ignore changed items
template<class ItemType>
virtual LazyNotificationData* ListLazyNotificationData< ItemType >::Clone (bool16 undoData) const
virtual

This method is used to create a copy of its class which may or may not be setup for undo rather than do or redo. The meaning of undo is that added items are switched to deleted items and deleted items are switched to added. the changed items are not modified. While this method can be called by anybody it was created to allow cookies to be stored sot hat they can be sent to appropriate observers more than once and with undo information if needed.

Parameters
undoData- IN kTrue - Swap the adds and deletes
Returns
- A new object which looks like this one. Note: the new object is no longer owned by this method so callers need to be sure to clean up pointers that they are no longer in need of.

Implements LazyNotificationData.

template<class ItemType>
void ListLazyNotificationData< ItemType >::ItemChanged (ItemType itemID)

Indicate that an item of ItemType was changed in the model. This method should be called by the command when creating the cookie to be passed to ModelChange.

Parameters
itemID- IN The item that was changed.
template<class ItemType>
void ListLazyNotificationData< ItemType >::ItemDeleted (ItemType itemID)

Indicate that an item of ItemType was removed from the model. This method should be called by the command when creating the cookie to be passed to ModelChange.

Parameters
itemID- IN The item that was deleted.
template<class ItemType>
virtual void ListLazyNotificationData< ItemType >::MarkShouldRebuildAll ()
virtual

Indicate that a new item of ItemType was added to the model. This method should be called by the command when creating the cookie to be passed to ModelChange.

Parameters
itemID- IN The item that was added.Mark the cookie indicating that all needs rebuilding

Implements LazyNotificationData.

template<class ItemType>
bool ListLazyNotificationData< ItemType >::ShouldRebuildAll () const
inlinevirtual
template<class ItemType>
virtual void ListLazyNotificationData< ItemType >::Validate (IDataBasedb)
virtual

Validate the cookie against the model. This is only really used for UIDs. There are some problems with deleting objects twice which will cause the cookie to think that an item which never existed actually existed and was deleted. This call will verify that items which are currently marked for add (undo of a delete) exist in the database. NOTE: This call will not do anything in the release build

Parameters
db- The database that is associated with this cookie

Implements LazyNotificationData.