InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
AttributeBossList Class Reference

#include <AttributeBossList.h>

Public Types

enum  ReadWriteStatus { kSuccess, kListChangedOnRead }
 
typedef object_type data_type
 

Public Member Functions

 AttributeBossList (const AttributeBossList &copy)
 
AttributeBossListoperator= (const AttributeBossList &other)
 
ReadWriteStatus ReadWrite (IPMStream *stream)
 
 AttributeBossList (AttributeBossList &&copy) noexcept
 
AttributeBossListoperator= (AttributeBossList &&copy) noexcept
 
int32 CountBosses () const
 
ClassID GetClassN (int32 n) const
 
const IPMUnknownQueryBossN (int32 n, PMIID id) const
 
const IPMUnknownQueryByClassID (ClassID c, PMIID id) const
 
void ApplyAttribute (const IPMUnknown *newone, const ClassID attrClass=kInvalidClass)
 
void ApplyAttributes (const AttributeBossList *list)
 
void ClearOverride (ClassID id)
 
void ClearOverrides (const AttributeBossList *list)
 
void ClearNonStyleOverrides ()
 
void ClearAllOverrides ()
 
AttributeBossListDuplicate () const
 
AttributeBossListCopyTheseAttributes (const AttributeBossList *filter) const
 
bool16 ContainsAttribute (ClassID klas) const
 
bool16 ContainsExact (IDataBase *db, const IPMUnknown *check, ClassID klas=kInvalidClass) const
 
bool16 IsEqual (IDataBase *db, const AttributeBossList *other) const
 
bool16 Intersects (const AttributeBossList *other) const
 
bool16 IntersectionContainsDifferences (IDataBase *db, const AttributeBossList *other) const
 

Static Public Member Functions

static uint32 ConvertAttributeList (IPMStream *inStream, IPMStream *outStream, ImplementationID context)
 
static uint32 CopyAttributeList (IPMStream *inStream, IPMStream *outStream)
 

Static Public Attributes

static boost::shared_ptr
< AttributeBossList
kNil_shared_ptr
 

Protected Member Functions

ReadWriteStatus DoWrite (IPMStream *stream)
 
ReadWriteStatus DoRead (IPMStream *stream)
 
void CopyInto (AttributeBossList *) const
 
bool16 AllowCopy (ClassID attrClass, IPMUnknown *boss) const
 

Friends

void swap (AttributeBossList &a, AttributeBossList &b) noexcept
 

Detailed Description

AttributeBossList is a data structure that groups a set of attributes with distinct classes. AttributeBossList is used both in the model and in the user interface to collect lists of attributes. The class supports the following basic operations:

  1. query for particular attributes,
  2. apply overrides,
  3. clear overrides,
  4. copy, and
  5. read write.

Member Function Documentation

void AttributeBossList::ApplyAttribute (const IPMUnknownnewone,
const ClassID attrClass = kInvalidClass 
)

Apply a single attribute.

Parameters
newoneIN is a pointer to the attribute boss or an interface on the attribute boss to apply.
attrClassIN the class of the attribute to apply. When attrClass is equal kInvalidClass, the function queries the object model for the class.
void AttributeBossList::ApplyAttributes (const AttributeBossListlist)
Apply a list of attributes. 

Parameters
listIN attribute boss list to apply.
void AttributeBossList::ClearAllOverrides ()

Remove all attributes in the list.

void AttributeBossList::ClearNonStyleOverrides ()

Remove attributes that are not allowed to exist in styles (ie: pair kern amounts).

void AttributeBossList::ClearOverride (ClassID id)
Remove the attribute that has class id from the list.

Parameters
idIN class of attribute to remove.
void AttributeBossList::ClearOverrides (const AttributeBossListlist)
 Remove the attributes that have the classes of the attributes in list.

Parameters
listIN attribute boss list to clear from list. when list is nil this function clears all attributes.
bool16 AttributeBossList::ContainsAttribute (ClassID klas) const
Returns
whether there is an attribute with class klas in the list.
Parameters
klasIN class of attribute.
bool16 AttributeBossList::ContainsExact (IDataBasedb,
const IPMUnknowncheck,
ClassID klas = kInvalidClass 
) const
Returns
whether a copy identical to an attribute exists in the attribute boss list (this is a deep compare).
Parameters
checkIN to attribute searched for.
klasIN of attribute. When klas is equal kInvalidClass, the function queries the model to get the class.
static uint32 AttributeBossList::ConvertAttributeList (IPMStreaminStream,
IPMStreamoutStream,
ImplementationID context 
)
static

Used in legacy conversion of attribute boss lists. Converts attribute boss list ifstreams have different revision numbers.

Parameters
inStreamIN source stream to convert from.
outStreamIN target stream to convert to.
static uint32 AttributeBossList::CopyAttributeList (IPMStreaminStream,
IPMStreamoutStream 
)
static

Used in legacy conversion of attribute boss lists. Copies attribute boss list from inStream to outStream.

Parameters
inStreamIN source stream to copy from.
outStreamIN target stream to copying to.
AttributeBossList* AttributeBossList::CopyTheseAttributes (const AttributeBossListfilter) const
Create a copy of the attributes in the list of which classes appear in filter.

Parameters
filterIN attributes to copy from the list.
Returns
list of attributes copied. The attributes are subject to a shallow copy (their reference count is incremented).
int32 AttributeBossList::CountBosses () const
Returns
the number of attributes in the list.
ReadWriteStatus AttributeBossList::DoWrite (IPMStreamstream)
protected

For Internal use only.

AttributeBossList* AttributeBossList::Duplicate () const
Returns
a copy of the attribute boss list. The attributes in the list are subject to a shallow copy (their reference count is incremented).
ClassID AttributeBossList::GetClassN (int32 n) const
Returns
the class of the Nth attribute in the list.
Parameters
nIN attribute number in the list.
bool16 AttributeBossList::IntersectionContainsDifferences (IDataBasedb,
const AttributeBossListother 
) const
Returns
kTrue if the two lists share attributes in common and at least one of those attributes has different values in the two lists. Otherwise return kFalse. If there is no intersection, this method returns kFalse.
Parameters
dbIN The database the attribute lists are "in".
otherIN attribute boss list to intersect with.
bool16 AttributeBossList::Intersects (const AttributeBossListother) const
Returns
true when both boss lists have at least one attribute with same classe.
Parameters
otherIN attribute boss list to intersect with.
bool16 AttributeBossList::IsEqual (IDataBasedb,
const AttributeBossListother 
) const
Returns
whether all attributes in both lists are identical (deep compare).
Parameters
otherIN list to compare against.
const IPMUnknown* AttributeBossList::QueryBossN (int32 n,
PMIID id 
) const
Returns
a pointer to an interface on the Nth attribute in the list.
Parameters
nIN attribute number in the list.
idIN id of the interface queried for. When id is equal IID_IUNKNOWN, a pointer to the attribute boss is returned.
const IPMUnknown* AttributeBossList::QueryByClassID (ClassID c,
PMIID id 
) const
Returns
a pointer to an interface on the attribute that has class c
Parameters
cIN attribute class.
idIN id of the interface queried for. When id is equal IID_IUNKNOWN, a pointer to the attribute boss is returned.

Member Data Documentation

boost::shared_ptr<AttributeBossList> AttributeBossList::kNil_shared_ptr
static

Use this static to pass a K2:shared_pointer of a nil attribute boss list.