InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
CGenStyleListMgr Class Referenceabstract
Inheritance diagram for CGenStyleListMgr:
IGenStlEdtListMgrIPMUnknown

Public Member Functions

 CGenStyleListMgr (IPMUnknown *pBoss)
 
virtual int32 GetNumStyles ()
 
virtual ErrorCode GetNthStyleName (int32 index, PMString *pName)
 
virtual ErrorCode GetNthStyleDescription (int32 index, PMString *pDesc)
 
virtual bool32 IsNthStyleEditable (int32 index)
 
virtual bool32 IsNthStyleDeleteable (int32 index)
 
virtual int32 GetStyleIndexByName (const PMString &pName)
 
virtual ErrorCode AddStyle (PMString &name)
 
virtual ErrorCode CopyNthStyle (int32 srcIndex, PMString &newName)
 
virtual ErrorCode DeleteNthStyle (int32 index)
 
virtual PMString GetUniqueStyleName (PMString &baseName)
 
virtual PMString GetConformingStyleName (PMString &baseName)
 
virtual ErrorCode SetNthStyleName (int32 index, PMString &name)
 
virtual bool32 CustomImport (const IDFile *theFile)
 
virtual bool32 CustomExport (const IDFile *theFile, K2Vector< int32 > &indexList)
 
virtual ErrorCode ImportStyles (UIDRef uidrefFrom)
 
virtual ErrorCode ExportStyles (UIDRef uidrefTo, K2Vector< int32 > &indexList)
 
virtual void GetImportExportFileMagicByte (DBUtils::MagicBytes magicBytes)
 
virtual UIDRef GetNthStyleRef (int32 index)
 
virtual void ReadWrite (IPMStream *s, ImplementationID prop)
 
virtual void ListInsert (UID uid, int32 index=-1)
 
virtual void ListRemove (int32 index)
 
virtual void ListReplace (UID uid, int32 index)
 
ErrorCode ImportFlattenerStyle (int32 nOwningStyle, const PMString &strOwningStyle, IGenStlEdtListMgr *pStyleMgr)
 
ErrorCode AddFlattenerStyle (int32 nSrcIndex, const PMString &strNewName, IGenStlEdtListMgr *pSrc, IGenStlEdtListMgr *pDst)
 
virtual bool16 ReferencesFlattenerStyle ()
 
virtual UIDRef GetReferencedFlattenerStyle (int32 nIndex)
 
virtual PMString GetFlattenerStyleName (int32 nIndex)
 
virtual void SetFlattenerStyleName (int32 nIndex, const PMString &strName)
 
virtual bool16 EnabledInNoPubState ()
 
- Public Member Functions inherited from IGenStlEdtListMgr
virtual bool32 GetUIString (GenStlEdtUIStringID whichString, PMString *pName)=0
 
virtual ClassID GetExportFileRootBossClassID ()=0
 
virtual void GetExportFileCreatorAndType (OSType *pCreator, OSType *pType)=0
 
virtual void GetExportFileExtension (PMString *pExt)=0
 
virtual bool32 EditNthStyle (int32 index, bool16 bNew)=0
 
virtual ErrorCode CopyStyleData (UIDRef srcStyle, UIDRef dstStyle)=0
 
virtual ErrorCode InvokeNthStyle (int32 index, bool32 displayUI=kTrue)=0
 
- Public Member Functions inherited from IPMUnknown
virtual IPMUnknownQueryInterface (PMIID interfaceID) const =0
 
virtual void AddRef () const =0
 
virtual void Release () const =0
 

Protected Member Functions

virtual IGenericSettingsQuerySettings (int32 nIndex)=0
 
virtual PMString GetDefaultName ()=0
 
virtual ClassID GetAddStyleCmdBossID ()=0
 
virtual ClassID GetSetStyleNameCmdBossID ()=0
 
virtual ClassID GetDeleteStyleCmdBossID ()=0
 
virtual ClassID GetStyleBossID ()=0
 
virtual PMIID GetListMgrIID ()=0
 
virtual PMIID GetLockInfoIID ()
 
UIDRef GetSelfUIDRef () const
 
PMString GetNextUniqueStyleName (int32 i, const PMString &baseName)
 

Protected Attributes

PersistUIDList fStyleUIDList
 

Additional Inherited Members

- Public Types inherited from IGenStlEdtListMgr
enum  GenStlEdtUIStringID {
  kDialogTitle, kStyleListTitle, kNewStyleNameTitle, kRenameStyleTitle,
  kNameConflictPrompt, kNameRequiredPrompt, kImportTitle, kExportTitle,
  kExportFileClassName, kExportDefaultFileName, kAlertCannotLoadStyles, kNameReservedPrompt,
  kLastGenStlEdtUIStringID
}
 

Member Function Documentation

virtual ErrorCode CGenStyleListMgr::AddStyle (PMStringname)
virtual

Adds a new style with specified initial name. If the name is already in the list, the function fails.

Parameters
nameIN The name of the new style.
Returns
Error code, or kSuccess if successful.

Implements IGenStlEdtListMgr.

virtual ErrorCode CGenStyleListMgr::CopyNthStyle (int32 srcIndex,
PMStringnewName 
)
virtual

Makes a copy of the specified style. Fails if newName already exists in the style list.

Parameters
srcIndexIN The index of the style to copy.
newNameIN The name of the new style.
Returns
Error code, or kSuccess if successful.

Implements IGenStlEdtListMgr.

virtual bool32 CGenStyleListMgr::CustomExport (const IDFiletheFile,
K2Vector< int32 > & indexList 
)
inlinevirtual

If you have a custom export (i.e., you don't want to use the default implementation provided by GenericStyleEditor) then do your export in here and return kTrue. Otherwise, return kFalse and the standard implemenation (which calls ImportStyles/ExportStyles below) will be used.

Parameters
theFileIN If null, you should bring up UI to pick the file. Otherwise, should be used as the source or destination export file.
indexListIN A list of the style indices that should be copied (corresponds to the user's selection when they clicked Export).
Returns
kFalse if you don't implement a custom export; kTrue if you did.

Implements IGenStlEdtListMgr.

virtual bool32 CGenStyleListMgr::CustomImport (const IDFiletheFile)
inlinevirtual

If you have a custom import (i.e., you don't want to use the default implementation provided by GenericStyleEditor) then do your import in here and return kTrue. Otherwise, return kFalse and the standard implemenation (which calls ImportStyles/ExportStyles below) will be used.

Parameters
theFileIN If null, you should bring up UI to pick the file. Otherwise, should be used as the source or destination import file.
Returns
kFalse if you don't implement a custom import; kTrue if you did.

Implements IGenStlEdtListMgr.

virtual ErrorCode CGenStyleListMgr::DeleteNthStyle (int32 index)
virtual

Deletes a style.

Parameters
indexIN The index of the style to delete.
Returns
Error code, or kSuccess if successful.

Implements IGenStlEdtListMgr.

virtual bool16 CGenStyleListMgr::EnabledInNoPubState ()
inlinevirtual

Tells whether items of this list are enabled in no-pub state. kFalse by default.

Returns
True if you should be able to edit the list in a no-pub state; false otherwise.

Implements IGenStlEdtListMgr.

virtual ErrorCode CGenStyleListMgr::ExportStyles (UIDRef uidrefTo,
K2Vector< int32 > & indexList 
)
virtual

Exports styles to an open export file. The selected styles are copied from the defaults to the indicated database.

Parameters
uidrefToIN The root of a new export document into which the styles will be copied.
indexListIN A list of the style indices that should be copied (corresponds to the user's selection when they clicked Export).
Returns
Error code, or kSuccess if successful.

Implements IGenStlEdtListMgr.

virtual PMString CGenStyleListMgr::GetFlattenerStyleName (int32 nIndex)
inlinevirtual

For flattener-style-referring lists, obtains the flattener style to which a particular style refers.

Parameters
indexIN The index of the style.
Returns
The name of the flattener style to which this style refers.

Implements IGenStlEdtListMgr.

virtual void CGenStyleListMgr::GetImportExportFileMagicByte (DBUtils::MagicBytes magicBytes)
virtual

Get the magic byte of the export/import file. This is a special unique series of characters that you come up with that ensures that the database won't be accidentally imported as a "real" document.

Parameters
magicBytesOUT Receives the magic bytes to use for the import/export file.

Implements IGenStlEdtListMgr.

virtual ErrorCode CGenStyleListMgr::GetNthStyleDescription (int32 index,
PMStringpDesc 
)
virtual

Obtains the description of the Nth style.

Parameters
indexIN The index of the style you're interested in.
pDescOUT Receives the description of the style.
Returns
An error code or kSuccess if successful.

Implements IGenStlEdtListMgr.

virtual ErrorCode CGenStyleListMgr::GetNthStyleName (int32 index,
PMStringpName 
)
virtual

Obtains the name of the Nth style.

Parameters
indexIN The index of the style you're interested in.
pNameOUT Receives the name of the style.
Returns
An error code or kSuccess if successful.

Implements IGenStlEdtListMgr.

virtual UIDRef CGenStyleListMgr::GetNthStyleRef (int32 index)
virtual

Internal use only. Obtains the UID of the Nth style object. From this you can get/set the client items. Note that this only is used by style lists that use UIDList-based storage.

Parameters
indexIN The style to obtain the UIDRef for.
Returns
The UIDRef of the style.

Implements IGenStlEdtListMgr.

virtual int32 CGenStyleListMgr::GetNumStyles ()
virtual

Returns the number of styles in the list.

Returns
The number of styles.

Implements IGenStlEdtListMgr.

virtual UIDRef CGenStyleListMgr::GetReferencedFlattenerStyle (int32 nIndex)
inlinevirtual

For flattener-style-referring lists, obtains the flattener style to which a particular style refers.

Parameters
indexIN The index of the style.
Returns
The UIDRef of the flattener style to which this style refers.

Implements IGenStlEdtListMgr.

virtual int32 CGenStyleListMgr::GetStyleIndexByName (const PMStringpName)
virtual

Searches the list for a style with the specified name.

Parameters
nameIN The name of the style to look for.
Returns
The index of the style, or -1 if it wasn't found.

Implements IGenStlEdtListMgr.

virtual PMString CGenStyleListMgr::GetUniqueStyleName (PMStringbaseName)
virtual

Generate a unique style name. If the base string is empty, the the new will look something like: style 1, style 2. If the base string contains an exisiting style name, then the new name will look something like: <original name>=""> copy 1, <original name>=""> copy 2.

Parameters
baseNameIN The base name for which you want a unique name.
Returns
A unique name (ie, a version of baseName that is not currently in the list).

Implements IGenStlEdtListMgr.

virtual ErrorCode CGenStyleListMgr::ImportStyles (UIDRef uidrefFrom)
virtual

Imports styles from an open database.

Parameters
uidrefFromIN Points to the UID in another database from which we can obtain a corresponding list manager interface and therefore query for the list of styles in that database. Typically this is the root UID in a style import/export file, but technically any database that can be used to pull styles will do. The key is that we can query for IGenStlEdtListMgr on the boss.
Returns
An error code; kSuccess if import was successful.

Implements IGenStlEdtListMgr.

virtual bool32 CGenStyleListMgr::IsNthStyleDeleteable (int32 index)
virtual

Returns whether a particular style can be deleted.

Parameters
indexIN The index of the style you're interested in.
Returns
True if it can be deleted; False if not.

Implements IGenStlEdtListMgr.

virtual bool32 CGenStyleListMgr::IsNthStyleEditable (int32 index)
virtual

Returns whether a particular style is editable.

Parameters
indexIN The index of the style you're interested in.
Returns
True if it's editable; False if locked or uneditable.

Implements IGenStlEdtListMgr.

virtual void CGenStyleListMgr::ListInsert (UID uid,
int32 index = -1 
)
virtual

Internal use only. Helper function that inserts a list element when lists are UIDList based. This is a direct window into the UIDList and should not be used except by a style list manager itself.

Parameters
uidIN The UID to insert.
indexIN The index before which to insert the UID, or -1 to append.

Implements IGenStlEdtListMgr.

virtual void CGenStyleListMgr::ListRemove (int32 index)
virtual

Internal use only. Helper function that removes a list element when lists are UIDList based. This is a direct window into the UIDList and should not be used except by a style list manager itself.

Parameters
indexIN The index of the UID to remove.

Implements IGenStlEdtListMgr.

virtual void CGenStyleListMgr::ListReplace (UID uid,
int32 index 
)
virtual

Internal use only. Helper function that replaces a list element when lists are UIDList based. This is a direct window into the UIDList and should not be used except by a style list manager itself.

Parameters
uidIN The UID to replace the existing one with.
indexIN The index of the element to replace.

Implements IGenStlEdtListMgr.

virtual bool16 CGenStyleListMgr::ReferencesFlattenerStyle ()
inlinevirtual

Indicates whether this style list type refers to flattener styles as "child" entities (for example, printer styles and pdf export styles). If true, the flattener styles will be included as part of the export/import process.

Returns
True if the style refers to flattener styles; false if it doesn't.

Implements IGenStlEdtListMgr.

virtual void CGenStyleListMgr::SetFlattenerStyleName (int32 nIndex,
const PMStringstrName 
)
inlinevirtual

For flattener-style-referring lists, associates a flattener style with a list element.

Parameters
indexIN The index of the element.
strNameIN The name of the flattener style with which to associate the element.

Implements IGenStlEdtListMgr.

virtual ErrorCode CGenStyleListMgr::SetNthStyleName (int32 index,
PMStringname 
)
virtual

Changes the name of the specified style. Will fail if the name already exists in the style list. N.B.: Because the list is always maintained in alphabetical order, this function will generally cause reordering.

Parameters
indexIN The index of the style that you want to change the name of.
nameIN The name of the new style.
Returns
Error code, or kSuccess if successful.

Implements IGenStlEdtListMgr.