#include <IXMLStructureSuite.h>
|
| enum | { kDefaultIID = IID_IXMLSTRUCTURESUITE } |
| |
|
| virtual bool16 | CanAddElement () const =0 |
| |
| virtual bool16 | WillAddChangeGraphicElementToText () const =0 |
| |
| virtual ErrorCode | AddElement (const UIDRef &tagRef)=0 |
| |
| virtual bool16 | CanWrapWithElement () const =0 |
| |
| virtual ErrorCode | WrapWithElement (const UIDRef &tagRef)=0 |
| |
| virtual bool16 | CanDeleteElements (bool16 deleteChildren=kTrue, bool16 deleteContent=kFalse) const =0 |
| |
| virtual ErrorCode | DeleteElements (bool16 deleteChildren=kTrue, bool16 deleteContent=kFalse)=0 |
| |
| virtual bool16 | CanDeleteSelection (bool16 deleteChildren=kTrue, bool16 deleteContent=kFalse) const =0 |
| |
| virtual ErrorCode | DeleteSelection (bool16 deleteChildren=kTrue, bool16 deleteContent=kFalse)=0 |
| |
| virtual bool16 | CanEditSelection () const =0 |
| |
| virtual ErrorCode | EditSelection ()=0 |
| |
| virtual void | GetCommentInfo (PMString *comment)=0 |
| |
| virtual void | GetProcessingInstructionInfo (PMString *target, PMString *data)=0 |
| |
| virtual bool16 | CanAddAttribute () const =0 |
| |
| virtual bool16 | CanAddSpecificAttribute (const PMString &name) const =0 |
| |
| virtual ErrorCode | AddAttribute (const PMString &name, const PMString &value)=0 |
| |
| virtual bool16 | CanChangeOrReplaceAttribute () const =0 |
| |
| virtual bool16 | CanReplaceAttribute (const PMString &name) const =0 |
| |
| virtual ErrorCode | ChangeAttribute (const PMString &name, const PMString &value)=0 |
| |
| virtual ErrorCode | ReplaceAttribute (const PMString &name, const PMString &value)=0 |
| |
| virtual bool16 | CanDeleteAttributes () const =0 |
| |
| virtual ErrorCode | DeleteAttributes ()=0 |
| |
| virtual void | GetAttributeInfo (PMString *name, PMString *value)=0 |
| |
| virtual ErrorCode | Export (IXMLAccess *access, IXMLHandler *exportHandler, const IDFile &sysFile, bool16 exportPageItem=kFalse, const PMString &formatName="XML", UIFlags uiFlags=kSuppressUI)=0 |
| |
| virtual bool16 | IsExportable () const =0 |
| |
| virtual ErrorCode | Import (IDataBase *db, const IDFile *file, UIFlags flags)=0 |
| |
| virtual bool16 | IsImportable () const =0 |
| |
| virtual bool16 | IsSelectionInErrorState (IAttributeErrorList *attrErrors) const =0 |
| |
| virtual ErrorCode | SelectErrorInValidation (IXMLValidationErrorsCtrlData *validationErrors, IAttributeErrorList *attrErrors)=0 |
| |
| virtual bool16 | CanValidateSelection () const =0 |
| |
| virtual void | ValidateSelection (IXMLValidator *errors)=0 |
| |
| virtual bool16 | CanSetTableTagPreference () const =0 |
| |
| virtual ErrorCode | SetTableTagPreference (IXMLElementCommands::TableTagPreference newSetting)=0 |
| |
| virtual IPMUnknown * | QueryInterface (PMIID interfaceID) const =0 |
| |
| virtual void | AddRef () const =0 |
| |
| virtual void | Release () const =0 |
| |
Interface to manipulate the properties of the structure when there is an active selection. This is appropriate for selections within the structure view.
Underneath, this makes use of the interfaces such as IXMLAttributeCommands and IXMLElementCommands to process the commands relating to the current selection.
| virtual ErrorCode IXMLStructureSuite::AddAttribute | ( | const PMString & | name, | | | const PMString & | value | | ) | | |
| pure virtual |
Determine if we can add an attribute to the current selection
- Parameters
| name | specifies the name for the attribute |
| value | specifies the value that the attribute should have |
- Returns
- ErrorCode kSuccess if operation completed, kFailure otherwise
| virtual ErrorCode IXMLStructureSuite::AddElement | ( | const UIDRef & | tagRef | ) | |
| pure virtual |
Add Element as a child of the selected node; delegates to IXMLElementCommands::CreateElement to create a new element and add into the hierarchy.
If there is more than 1 element selected or if we have no elements selected, would add a child to the root.
- Parameters
| tagRef | specifies the tag (IXMLTag) to use for the given element |
- Returns
- kSuccess if a new element could be created and added, kFalse otherwise
| virtual bool16 IXMLStructureSuite::CanAddAttribute | ( | | ) | const |
| pure virtual |
Determine if we can add an attribute to the current selection
- Returns
- kTrue if attribute can be added to current selection
| virtual bool16 IXMLStructureSuite::CanAddElement | ( | | ) | const |
| pure virtual |
Determine if we can AddElement based on the current selection. You can't add elements to a placed graphic, if any of the selected elements are placed graphics, return kFalse
- Returns
- kTrue if elements can be added to selected element, kFalse otherwise
| virtual bool16 IXMLStructureSuite::CanAddSpecificAttribute | ( | const PMString & | name | ) | const |
| pure virtual |
Determine if we can add the specified attribute to the current selection; if the attribute exists on any of the elements, we can't add it.
- Parameters
| name | specifies the name for the attribute |
- Returns
- kTrue if named attribute can be added, kFalse otherwise
| virtual bool16 IXMLStructureSuite::CanChangeOrReplaceAttribute | ( | | ) | const |
| pure virtual |
Can we replace attribute based on current selection?
- Returns
- kTrue if attribute can be changed/replaced, kFalse otherwise
| virtual bool16 IXMLStructureSuite::CanDeleteAttributes | ( | | ) | const |
| pure virtual |
Determine if we can delete selected attributes
- Returns
- kTrue if we can delete the attributes in the active selection, kFalse otherwise
| virtual bool16 IXMLStructureSuite::CanDeleteElements | ( | bool16 | deleteChildren = kTrue, | | | bool16 | deleteContent = kFalse | | ) | | const |
| pure virtual |
Determine if we can DeleteElements based on the current selection. Can't delete the doc element or the root element; also, if there are no elements selected, return kFalse.
- Parameters
| deleteChildren | kTrue if attempting to delete the children of the given element, and kFalse to leave them in the logical structure |
| deleteContent | kTrue to attempt to remove the content within the tag markers, kFalse to leave it |
- Returns
- kTrue if selected elements can be deleted, kFalse if selected element(s) can't be deleted, for instance, if empty or the root element
| virtual bool16 IXMLStructureSuite::CanDeleteSelection | ( | bool16 | deleteChildren = kTrue, | | | bool16 | deleteContent = kFalse | | ) | | const |
| pure virtual |
Determine if we can delete the current selection. Can't delete the doc element or the root element or the DocType; also, if there are no elements selected, return kFalse.
- Parameters
| deleteChildren | kTrue if attempting to delete the children of the given element, and kFalse to leave them in the logical structure |
| deleteContent | kTrue to attempt to remove the content within the tag markers, kFalse to leave it |
- Returns
- kTrue if selected elements can be deleted, kFalse if selected element(s) can't be deleted, for instance, if empty or the root element
| virtual bool16 IXMLStructureSuite::CanEditSelection | ( | | ) | const |
| pure virtual |
Determine if we can edit the current selection. if there is more or less than one object selected, return kFalse.
- Returns
- kTrue if selected object can be edited, kFalse if selected element(s) can't be edited, for instance, if empty or more than one
| virtual bool16 IXMLStructureSuite::CanReplaceAttribute | ( | const PMString & | name | ) | const |
| pure virtual |
Can we replace attribute with the specified name
- Parameters
| name | specifies the name for the attribute |
- Returns
| virtual bool16 IXMLStructureSuite::CanSetTableTagPreference | ( | | ) | const |
| pure virtual |
Can the current selection change its auto tagging setting?
- Returns
- whether or not it can.
| virtual bool16 IXMLStructureSuite::CanValidateSelection | ( | | ) | const |
| pure virtual |
Can the current selection be validated against the DTD?
- Returns
- whether or not validation can occur.
| virtual bool16 IXMLStructureSuite::CanWrapWithElement | ( | | ) | const |
| pure virtual |
Use this to determine whether the current selection can be wrapped in a new XML element.
- Returns
- - kTrue if the selection can be wrapped
| virtual ErrorCode IXMLStructureSuite::ChangeAttribute | ( | const PMString & | name, | | | const PMString & | value | | ) | | |
| pure virtual |
Change the value of the selected attribute
- Parameters
| name | specifies the name for the attribute |
| value | specifies the value that the attribute should have |
- Returns
- ErrorCode kSuccess if operation completed, kFailure otherwise
| virtual ErrorCode IXMLStructureSuite::DeleteAttributes | ( | | ) | |
| pure virtual |
Delete attributes of selected node
- Returns
- ErrorCode kSucess if the operation completed successfully, kFailure otherwise
| virtual ErrorCode IXMLStructureSuite::DeleteElements | ( | bool16 | deleteChildren = kTrue, | | | bool16 | deleteContent = kFalse | | ) | | |
| pure virtual |
Delete all selected elements; delegates to appropriate methods on IXMLElementCommands.
- Parameters
| deleteChildren | kTrue to delete the children of the given element, and kFalse to leave them in the logical structure |
| deleteContent | kTrue to remove the content within the tag markers, kFalse to leave it |
- Returns
- kSuccess if operation completed, kFailure otherwise
| virtual ErrorCode IXMLStructureSuite::DeleteSelection | ( | bool16 | deleteChildren = kTrue, | | | bool16 | deleteContent = kFalse | | ) | | |
| pure virtual |
Delete all selected elements, comments, PIs, or Attributes; delegates to appropriate methods in this interface.
- Parameters
| deleteChildren | kTrue to delete the children of the given element, and kFalse to leave them in the logical structure |
| deleteContent | kTrue to remove the content within the tag markers, kFalse to leave it |
- Returns
- kSuccess if operation completed, kFailure otherwise
| virtual ErrorCode IXMLStructureSuite::EditSelection | ( | | ) | |
| pure virtual |
Edit selected element, comment, PI, or Attribute; delegates to appropriate methods in this interface.
- Returns
- kSuccess if operation completed, kFailure otherwise
| virtual ErrorCode IXMLStructureSuite::Export | ( | IXMLAccess * | access, | | | IXMLHandler * | exportHandler, | | | const IDFile & | sysFile, | | | bool16 | exportPageItem = kFalse, | | | const PMString & | formatName = "XML", | | | UIFlags | uiFlags = kSuppressUI | | ) | | |
| pure virtual |
Export the XML based on selection; check IsExportable first
- Parameters
| access | specifies interface that's part of Visitor pattern for XML export |
| exportHandler | handler that will invoke IXMLGenerator methods to write out the contebt |
| exportPageItem | If kFalse, export from the selected element. If kTrue, export starts at the page item element associated with the selected element |
- Returns
- ErrorCode kSucess if the operation completed successfully, kFailure otherwise
| virtual void IXMLStructureSuite::GetAttributeInfo | ( | PMString * | name, | | | PMString * | value | | ) | | |
| pure virtual |
Get the name and value of the selected attribute. If the selection is anything other than a single attribute, both name and value will be empty strings.
- Parameters
| name | [OUT] contains name for selected attribute if single attribute selected, empty string otherwise |
| value | [OUT] contains current value for selected attribute if single attribute selected, empty string otherwise |
| virtual void IXMLStructureSuite::GetCommentInfo | ( | PMString * | comment | ) | |
| pure virtual |
Get the value of the selected comment. If the selection is anything other than a single comment, comment will be an empty string.
- Parameters
| value | [OUT] contains current value for selected comment if single comment selected, empty string otherwise |
| virtual void IXMLStructureSuite::GetProcessingInstructionInfo | ( | PMString * | target, | | | PMString * | data | | ) | | |
| pure virtual |
Get the target and data of the selected processing instruction. If the selection is anything other than a single pi, both target and data will be empty strings.
- Parameters
| target | [OUT] contains target for selected pi if single pi selected, empty string otherwise |
| data | [OUT] contains current data for selected pi if single pi selected, empty string otherwise |
| virtual ErrorCode IXMLStructureSuite::Import | ( | IDataBase * | db, | | | const IDFile * | file, | | | UIFlags | flags | | ) | | |
| pure virtual |
Import into selected element from a file; check IsImportable first
- Parameters
| db | database to be imported into |
| file | pointer to a IDFile to import |
| flags | specifies how much UI to show during import |
- Returns
- kSuccess if operation succeeded, kFailure otherwise
| virtual bool16 IXMLStructureSuite::IsExportable | ( | | ) | const |
| pure virtual |
Can we export from the current selection? Return kTrue only if one element is selected.
- Returns
- kTrue if can export from active selection, kFalse if we can't, e.g. if more than one element selected
| virtual bool16 IXMLStructureSuite::IsImportable | ( | | ) | const |
| pure virtual |
Can we import into the current selection? Expects a single selection; will return kFailure if more than one element selected. Return kTrue only if one element is selected.
- Returns
- kTrue if can be imported into current selection, kFalse if can't, or if more than one element selected at entry
| virtual bool16 IXMLStructureSuite::IsSelectionInErrorState | ( | IAttributeErrorList * | attrErrors | ) | const |
| pure virtual |
Is the selected element a known DTD validation problem. This relies on the IID_IBOOLDATA interface on the element (non-persistent) to determine whether or not the element/attribute is in an error state Return kTrue only if one element is selected. and IBoolData is kFalse
- Parameters
| attrErrors | List of attributes currently in an error state |
- Returns
- kTrue single selected element is in an error state, kFalse if element is OK, or if more than one element selected at entry
| virtual ErrorCode IXMLStructureSuite::ReplaceAttribute | ( | const PMString & | name, | | | const PMString & | value | | ) | | |
| pure virtual |
Change the name and value of the selected attribute, essentially removing the selected attribute and adding a new one
- Parameters
| name | specifies the name for the attribute |
| value | specifies the value that the attribute should have |
- Returns
- ErrorCode kSuccess if operation completed, kFailure otherwise
| virtual ErrorCode IXMLStructureSuite::SelectErrorInValidation | ( | IXMLValidationErrorsCtrlData * | validationErrors, | | | IAttributeErrorList * | attrErrors | | ) | | |
| pure virtual |
Select the error that matches this element in the Validation panel
- Parameters
| validationErrors | Interface that contains the current list of known errors. |
| attrErrors | List of attributes currently in an error state |
- Returns
- kFailure if the element isn't in an error state, there is multiple selection, or the error couldn't be found in the list passed in. kSuccess otherwise.
Change the auto tag setting on the current selection
- Parameters
| newSetting | new setting to apply (row/column/none) |
- Returns
- kSuccess or a failure code
| virtual void IXMLStructureSuite::ValidateSelection | ( | IXMLValidator * | errors | ) | |
| pure virtual |
Validate this element and its children against the DTD
| virtual bool16 IXMLStructureSuite::WillAddChangeGraphicElementToText | ( | | ) | const |
| pure virtual |
Graphic elements cannot contain children, so are there any graphic elements in the selection that we would convert? For instance, when you add a child element to a graphic frame, the AddElement method will convert this to a text frame.
- Returns
- kTrue if selection contains graphic elements that would be converted to text frames on AddElement
| virtual ErrorCode IXMLStructureSuite::WrapWithElement | ( | const UIDRef & | tagRef | ) | |
| pure virtual |
Add Element as a parent of the selected nodes and a child of their parent; delegates to IXMLElementCommands::WrapWithElement to create a new element and add into the hierarchy.
- Parameters
| tagRef | specifies the tag (IXMLTag) to use for the given element |
- Returns
- kSuccess if a new element could be created and added, kFalse otherwise