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

Public Types

enum  GenStlEdtUIStringID {
  kDialogTitle, kStyleListTitle, kNewStyleNameTitle, kRenameStyleTitle,
  kNameConflictPrompt, kNameRequiredPrompt, kImportTitle, kExportTitle,
  kExportFileClassName, kExportDefaultFileName, kAlertCannotLoadStyles, kNameReservedPrompt,
  kLastGenStlEdtUIStringID
}
 

Public Member Functions

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

Member Enumeration Documentation

String IDs for GetUIString.

Member Function Documentation

virtual ErrorCode IGenStlEdtListMgr::AddStyle (PMStringname)
pure 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.

Implemented in CGenStyleListMgr.

virtual ErrorCode IGenStlEdtListMgr::CopyNthStyle (int32 srcIndex,
PMStringnewName 
)
pure 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.

Implemented in CGenStyleListMgr.

virtual ErrorCode IGenStlEdtListMgr::CopyStyleData (UIDRef srcStyle,
UIDRef dstStyle 
)
pure virtual

Helper function that copies style data from one style to another.

Parameters
srcStyleIN The style from which to copy the data.
dstStyleIN The style to which to copy the data.
Returns
Error code, or kSuccess if successful.
virtual bool32 IGenStlEdtListMgr::CustomExport (const IDFiletheFile,
K2Vector< int32 > & indexList 
)
pure virtual

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.

Implemented in CGenStyleListMgr.

virtual bool32 IGenStlEdtListMgr::CustomImport (const IDFiletheFile)
pure virtual

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.

Implemented in CGenStyleListMgr.

virtual ErrorCode IGenStlEdtListMgr::DeleteNthStyle (int32 index)
pure virtual

Deletes a style.

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

Implemented in CGenStyleListMgr.

virtual bool32 IGenStlEdtListMgr::EditNthStyle (int32 index,
bool16 bNew 
)
pure virtual

Invokes UI to edit the styles. Returns true if the user clicked OK (whether or not they actually made changes).

Parameters
indexIN The index of the style to edit.
bNewIN True if the style is a new style (ie, this corresponds to the New button).
Returns
True for an OK, false for cancel.
virtual bool16 IGenStlEdtListMgr::EnabledInNoPubState ()
pure virtual

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.

Implemented in CGenStyleListMgr.

virtual ErrorCode IGenStlEdtListMgr::ExportStyles (UIDRef uidrefTo,
K2Vector< int32 > & indexList 
)
pure 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.

Implemented in CGenStyleListMgr.

virtual void IGenStlEdtListMgr::GetExportFileCreatorAndType (OSType * pCreator,
OSType * pType 
)
pure virtual

Determines the creator and type of the export/import file.

Parameters
pCreatorOUT Receives the creator for the export/import file.
pTypeOUT Receives the type of the export/import file.
virtual void IGenStlEdtListMgr::GetExportFileExtension (PMStringpExt)
pure virtual

Determines the extension of the export/import file.

Parameters
pExtOUT Receives the extension to use for the import/export file.
virtual ClassID IGenStlEdtListMgr::GetExportFileRootBossClassID ()
pure virtual

Return the class ID of the boss that you want as the root UID in a new export styles document. Your plug-in provides the class definition and ID. Your list mgr interface must live on the boss.

Returns
The boss's class ID.
virtual PMString IGenStlEdtListMgr::GetFlattenerStyleName (int32 nIndex)
pure virtual

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.

Implemented in CGenStyleListMgr.

virtual void IGenStlEdtListMgr::GetImportExportFileMagicByte (DBUtils::MagicBytes magicBytes)
pure 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.

Implemented in CGenStyleListMgr.

virtual ErrorCode IGenStlEdtListMgr::GetNthStyleDescription (int32 index,
PMStringpDesc 
)
pure 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.

Implemented in CGenStyleListMgr.

virtual ErrorCode IGenStlEdtListMgr::GetNthStyleName (int32 index,
PMStringpName 
)
pure 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.

Implemented in CGenStyleListMgr.

virtual UIDRef IGenStlEdtListMgr::GetNthStyleRef (int32 index)
pure 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.

Implemented in CGenStyleListMgr.

virtual int32 IGenStlEdtListMgr::GetNumStyles ()
pure virtual

Returns the number of styles in the list.

Returns
The number of styles.

Implemented in CGenStyleListMgr.

virtual UIDRef IGenStlEdtListMgr::GetReferencedFlattenerStyle (int32 nIndex)
pure virtual

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.

Implemented in CGenStyleListMgr.

virtual int32 IGenStlEdtListMgr::GetStyleIndexByName (const PMStringpName)
pure 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.

Implemented in CGenStyleListMgr.

virtual bool32 IGenStlEdtListMgr::GetUIString (GenStlEdtUIStringID whichString,
PMStringpName 
)
pure virtual

Allows you to override the default strings used in the edit styles interface. If you want to override the string, set up 'pname' with the string and return TRUE. If you want to use the default, return FALSE.

Parameters
whichStringIN Identifies the string (by ID) that will be shown in the UI.
pNameOUT Receives the literal string to show in the UI.
Returns
kTrue to override the string; kFalse otherwise.
virtual PMString IGenStlEdtListMgr::GetUniqueStyleName (PMStringbaseName)
pure 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).

Implemented in CGenStyleListMgr.

virtual ErrorCode IGenStlEdtListMgr::ImportStyles (UIDRef uidrefFrom)
pure 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.

Implemented in CGenStyleListMgr.

virtual ErrorCode IGenStlEdtListMgr::InvokeNthStyle (int32 index,
bool32 displayUI = kTrue 
)
pure virtual

Selects the specified style and invokes it; used for print/pdf styles where the user can bypass or access the export/print dialog directly from a menu.

Parameters
indexIN The index of the style to invoke.
displayUIIN If true, the print/export dialog is presented first (so the user can change as needed). Otherwise, it goes right to printing/exporting.
Returns
Error code, or kSuccess if successful.
virtual bool32 IGenStlEdtListMgr::IsNthStyleDeleteable (int32 index)
pure 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.

Implemented in CGenStyleListMgr.

virtual bool32 IGenStlEdtListMgr::IsNthStyleEditable (int32 index)
pure 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.

Implemented in CGenStyleListMgr.

virtual void IGenStlEdtListMgr::ListInsert (UID uid,
int32 index = -1 
)
pure 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.

Implemented in CGenStyleListMgr.

virtual void IGenStlEdtListMgr::ListRemove (int32 index)
pure 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.

Implemented in CGenStyleListMgr.

virtual void IGenStlEdtListMgr::ListReplace (UID uid,
int32 index 
)
pure 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.

Implemented in CGenStyleListMgr.

virtual bool16 IGenStlEdtListMgr::ReferencesFlattenerStyle ()
pure virtual

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.

Implemented in CGenStyleListMgr.

virtual void IGenStlEdtListMgr::SetFlattenerStyleName (int32 nIndex,
const PMStringstrName 
)
pure virtual

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.

Implemented in CGenStyleListMgr.

virtual ErrorCode IGenStlEdtListMgr::SetNthStyleName (int32 index,
PMStringname 
)
pure 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.

Implemented in CGenStyleListMgr.