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

Public Member Functions

 SnpManipulateTextFrame ()
 
virtual ~SnpManipulateTextFrame ()
 
ErrorCode InspectTextFrame (const UIDRef &graphicFrameUIDRef)
 
ErrorCode InspectFrameList (const UIDRef &graphicFrameUIDRef)
 
ErrorCode InspectTextInFrame (const UIDRef &graphicFrameUIDRef)
 
ErrorCode InspectThreadedTextFrames (const UIDRef &graphicFrameUIDRef)
 
UIDRef CreateAndThreadTextFrame (const UIDRef &fromGraphicFrameUIDRef)
 
ErrorCode DeleteTextFrame (const UIDRef &graphicFrameUIDRef)
 
bool16 CanThreadTextFrames (IDataBase *database, const UID &fromGraphicFrameUID, const UID &toGraphicFrameUID)
 
ErrorCode ThreadTextFrames (IDataBase *database, const UID &fromGraphicFrameUID, const UID &toGraphicFrameUID)
 
bool16 CanUnthreadTextFrame (const UIDRef &graphicFrameUIDRef)
 
ErrorCode UnthreadTextFrame (const UIDRef &graphicFrameUIDRef)
 
ErrorCode IncrementNumberOfColumns (const UIDRef &graphicFrameUIDRef)
 
ErrorCode IncrementTextInset (const UIDRef &graphicFrameUIDRef, const PMReal &increment)
 
ErrorCode ChangeTextWrapMode (const UIDRef &graphicFrameUIDRef, IStandOff::mode mode)
 
ErrorCode SelectTextInFrame (const UIDRef &graphicFrameUIDRef, ISelectionManager *selectionManager)
 
ErrorCode SelectFrameDisplayingTextIndex (const UIDRef &graphicFrameUIDRef, ISelectionManager *selectionManager)
 
ErrorCode CreateLinkedStory (const UIDRef &sourceTextFrameRef)
 
ErrorCode SelectTextAtTextIndex (const UIDRef &graphicFrameUIDRef, ISelectionManager *selectionManager)
 
bool16 ActivateTextEditor ()
 
bool16 IsTextFrame (const UIDRef &graphicFrameUIDRef)
 
UID GetTextContentUID (const UIDRef &graphicFrameUIDRef)
 
bool16 IsThreadedTextFrame (const UIDRef &graphicFrameUIDRef)
 
UIDRef GetNextGraphicFrame (const UIDRef &graphicFrameUIDRef)
 
UIDRef GetPreviousGraphicFrame (const UIDRef &graphicFrameUIDRef)
 
UIDRef GetGraphicFrameRef (const InterfacePtr< ITextFrameColumn > &textFrameColumn, const bool16 isTOPFrameAllowed)
 
InDesign::TextRange GetTextFrameTextRange (IMultiColumnTextFrame *mcf)
 
InDesign::TextRange GetFrameTextRange (const UIDRef &graphicFrameUIDRef)
 
WideString GetWideStringFromTextFrame (IMultiColumnTextFrame *mcf)
 
ITextFrameColumnQueryTextFrameContaining (ITextModel *textModel, const TextIndex at)
 

Detailed Description

  • How to inspect the structure and properties of a text frame,
  • how to create and delete a text frame,
  • how to link text frames together so that text flows between them and how to unlink them,
  • how change the properties of a text frame such as number of columns, the text inset, the text wrap mode,
  • how to make sure text is composed and discover the range of text displayed by a text frame,
  • how to estimate the composed depth of text in a frame,
  • how to select text displayed in a frame.
  • how to create linked story.

Integrated the following 2.x code snippets in here so far. SnipNudgeNumTextCols.cpp SnipTextLinkCmd.cpp

Constructor & Destructor Documentation

SnpManipulateTextFrame::SnpManipulateTextFrame ()
inline

Constructor.

virtual SnpManipulateTextFrame::~SnpManipulateTextFrame ()
inlinevirtual

Destructor

Member Function Documentation

bool16 SnpManipulateTextFrame::ActivateTextEditor ()

Activate kIBeamToolBoss if a text tool is not already active.

Returns
kTrue on success, kFalse otherwise.
bool16 SnpManipulateTextFrame::CanThreadTextFrames (IDataBasedatabase,
const UIDfromGraphicFrameUID,
const UIDtoGraphicFrameUID 
)

Return kTrue if the given text frames can be threaded so that text flows between them, kFalse otherwise. There are a few checks made:

  • the stories associated with the frames must be unlocked,
  • if the story underlying toGraphicFrameUID is empty we can link the frame anywhere in the frame list, otherwise we must be appending toGraphicFrameUID onto the end of the frame list underlying fromGraphicFrameUID.
Parameters
databasecontaining frames to be threaded.
fromGraphicFrameUIDreference to source text frame
toGraphicFrameUIDreference to destination text frame.
Returns
kTrue if the given text frames can be threaded so that text flows between them, kFalse otherwise.
bool16 SnpManipulateTextFrame::CanUnthreadTextFrame (const UIDRefgraphicFrameUIDRef)

Return kTrue if the given text frames can be unthreaded so that text no longer flows between them, kFalse otherwise.

Parameters
graphicFrameUIDRefreference to the text frame's kSplineItemBoss object.
Returns
kTrue if the given text frames can be unthreaded so that text no longer flows between them, kFalse otherwise.
ErrorCode SnpManipulateTextFrame::ChangeTextWrapMode (const UIDRefgraphicFrameUIDRef,
IStandOff::mode mode 
)

Adjust the stand off mode of the given frame using ITextWrapFacade.

Parameters
graphicFrameUIDRefreference to the frame object (kSplineItemBoss).
modethe kind of stand off to be applied.
Returns
kSuccess on success, other ErrorCode otherwise.
See Also
ITextWrapFacade
ITextWrapSuite
kStandOffModeCmdBoss, kStandOffFormCmdBoss, kStandOffMarginCmdBoss
UIDRef SnpManipulateTextFrame::CreateAndThreadTextFrame (const UIDReffromGraphicFrameUIDRef)

Create a new text frame and thread the out-port of the given text frame to the in-port of the new text frame.

Parameters
fromGraphicFrameUIDRefreference to the text frame's kSplineItemBoss object.
Returns
kSuccess on success, other ErrorCode otherwise.
ErrorCode SnpManipulateTextFrame::CreateLinkedStory (const UIDRefsourceTextFrameRef)

Create an internal or external linked story for the text diaplayed by the given frame.

Parameters
sourceTextFrameRefreference to the text frame's kSplineItemBoss object.
Returns
kSuccess on success, other ErrorCode otherwise.
ErrorCode SnpManipulateTextFrame::DeleteTextFrame (const UIDRefgraphicFrameUIDRef)

Delete the given text frame.

Parameters
graphicFrameUIDRefreference to the text frame's kSplineItemBoss object.
Returns
kSuccess on success, other ErrorCode otherwise.
InDesign::TextRange SnpManipulateTextFrame::GetFrameTextRange (const UIDRefgraphicFrameUIDRef)

Return the range of text displayed by the given text frame.

Parameters
graphicFrameUIDRefreference to the text frame's kSplineItemBoss object.
Returns
the range of text displayed by the given frame.
UIDRef SnpManipulateTextFrame::GetGraphicFrameRef (const InterfacePtr< ITextFrameColumn > & textFrameColumn,
const bool16 isTOPFrameAllowed 
)

Return reference to the text frame's kSplineItemBoss object.

Parameters
textFrameColumn
isTOPFrameAllowedif kTrue and the given textFrameColumn is a text on a path frame then the kTOPSplineItemBoss reference will be returned, otherwise a kSplineItemBoss reference will be returned.
Returns
reference to the text frame's kSplineItemBoss object.
UIDRef SnpManipulateTextFrame::GetNextGraphicFrame (const UIDRefgraphicFrameUIDRef)

Return reference to the frame(kSplineItemBoss) into which text from the given frame flows, UIDRef::gNull if there is no next frame.

Parameters
graphicFrameUIDRefreference to the text frame's kSplineItemBoss object.
Returns
reference to the frame(kSplineItemBoss) into which text from the given frame flows, UIDRef::gNull if there is no next frame.
UIDRef SnpManipulateTextFrame::GetPreviousGraphicFrame (const UIDRefgraphicFrameUIDRef)

Return reference to the frame(kSplineItemBoss) from which text flows into the given frame, UIDRef::gNull if there is no previous frame.

Parameters
graphicFrameUIDRefreference to the text frame's kSplineItemBoss object.
Returns
reference to the frame(kSplineItemBoss) from which text flows into the given frame, UIDRef::gNull if there is no previous frame.
UID SnpManipulateTextFrame::GetTextContentUID (const UIDRefgraphicFrameUIDRef)

Return UID of the multi-column item (kMultiColumnItemBoss) associated with the given text frame, kInvalidUID if none.

Parameters
graphicFrameUIDRefreference to the text frame's kSplineItemBoss object.
Returns
UID of the multi-column item (kMultiColumnItemBoss) associated with the given text frame, kInvalidUID if none.
InDesign::TextRange SnpManipulateTextFrame::GetTextFrameTextRange (IMultiColumnTextFramemcf)

Return the range of text displayed by the given text frame.

Parameters
mcf
Returns
the range of text displayed by the given frame.
WideString SnpManipulateTextFrame::GetWideStringFromTextFrame (IMultiColumnTextFramemcf)

Return string containing the text displayed in the given text frame.

Parameters
mcfspecifies the frame whose text is wanted.
Returns
string containing the text displayed in the given text frame.
ErrorCode SnpManipulateTextFrame::IncrementNumberOfColumns (const UIDRefgraphicFrameUIDRef)

Add a column to the given text frame using kChangeNumberOfColumnsCmdBoss.

Parameters
graphicFrameUIDRefreference to the text frame's kSplineItemBoss object.
Returns
kSuccess on success, other ErrorCode otherwise.
See Also
kChangeNumberOfColumnsCmdBoss
ErrorCode SnpManipulateTextFrame::IncrementTextInset (const UIDRefgraphicFrameUIDRef,
const PMRealincrement 
)

Adjust the text inset applied to the given text frame using kSetTextInsetCmdBoss.

Parameters
graphicFrameUIDRefreference to the text frame's kSplineItemBoss object.
incrementthe adjustment to be made to the inset on all sides.
Returns
kSuccess on success, other ErrorCode otherwise.
See Also
kSetTextInsetCmdBoss
ITextFrameOptionsSuite and ITextFrameOptionsData
ITextFrameDialogUtils/ITextFrameOptionsData
ErrorCode SnpManipulateTextFrame::InspectFrameList (const UIDRefgraphicFrameUIDRef)

Inspect the structure of the frame list and story associated with a text frame.

Parameters
graphicFrameUIDRefreference to the text frame's kSplineItemBoss object.
Returns
kSuccess on success, other ErrorCode otherwise.
ErrorCode SnpManipulateTextFrame::InspectTextFrame (const UIDRefgraphicFrameUIDRef)

Inspect the structure of a text frame.

Parameters
graphicFrameUIDRefreference to the text frame's kSplineItemBoss object.
Returns
kSuccess on success, other ErrorCode otherwise.
ErrorCode SnpManipulateTextFrame::InspectTextInFrame (const UIDRefgraphicFrameUIDRef)

Inspect the characters displayed in a text frame.

Parameters
graphicFrameUIDRefreference to the text frame's kSplineItemBoss object.
Returns
kSuccess on success, other ErrorCode otherwise.
ErrorCode SnpManipulateTextFrame::InspectThreadedTextFrames (const UIDRefgraphicFrameUIDRef)

Inspect the frames that preceed and succeed the given text frame, text can flow between threaded frames.

Parameters
graphicFrameUIDRefreference to the text frame's kSplineItemBoss object.
Returns
kSuccess on success, other ErrorCode otherwise.
bool16 SnpManipulateTextFrame::IsTextFrame (const UIDRefgraphicFrameUIDRef)

Return kTrue if the given frame is a text frame, kFalse otherwise.

Parameters
graphicFrameUIDRefreference to the text frame's kSplineItemBoss object.
bool16 SnpManipulateTextFrame::IsThreadedTextFrame (const UIDRefgraphicFrameUIDRef)

Return kTrue if text flows into the given frame another frame or if text flows out of the given frame into another frame, kFalse otherwise.

Parameters
graphicFrameUIDRefreference to the text frame's kSplineItemBoss object.
ITextFrameColumn * SnpManipulateTextFrame::QueryTextFrameContaining (ITextModeltextModel,
const TextIndex at 
)

Return interface pointer to text frame that displays the given TextIndex or nil if the TextIndex is not displayed.

Parameters
textModel
at
Returns
interface pointer to text frame that displays the given TextIndex or nil if the TextIndex is not displayed.

InterfacePtr<IFrameList> frameList(textModel->QueryFrameList());

ErrorCode SnpManipulateTextFrame::SelectFrameDisplayingTextIndex (const UIDRefgraphicFrameUIDRef,
ISelectionManagerselectionManager 
)

Prompt for a TextIndex then select the frame displaying the character at that position.

Parameters
graphicFrameUIDRefreference to the text frame's kSplineItemBoss object.
selectionManager
Returns
kSuccess on success, other ErrorCode otherwise.
ErrorCode SnpManipulateTextFrame::SelectTextAtTextIndex (const UIDRefgraphicFrameUIDRef,
ISelectionManagerselectionManager 
)

Prompt for a TextIndex then select the character at that position.

Parameters
graphicFrameUIDRefreference to the text frame's kSplineItemBoss object.
selectionManager
Returns
kSuccess on success, other ErrorCode otherwise.
ErrorCode SnpManipulateTextFrame::SelectTextInFrame (const UIDRefgraphicFrameUIDRef,
ISelectionManagerselectionManager 
)

Select all of the text displayed by the given frame.

Parameters
graphicFrameUIDRefreference to the text frame's kSplineItemBoss object.
selectionManager
Returns
kSuccess on success, other ErrorCode otherwise.
ErrorCode SnpManipulateTextFrame::ThreadTextFrames (IDataBasedatabase,
const UIDfromGraphicFrameUID,
const UIDtoGraphicFrameUID 
)

Connects text flow between text frames using kTextLinkCmdBoss. The out-port of the frame given by parameter fromGraphicFrameUID is linked to the in-port of the frame given by parameter toGraphicFrameUID.

Parameters
databasecontaining objects to be linked.
fromGraphicFrameUIDreference to source text frame.
toGraphicFrameUIDreference to destination text frame.
Returns
kSuccess on success, other ErrorCode otherwise.
ErrorCode SnpManipulateTextFrame::UnthreadTextFrame (const UIDRefgraphicFrameUIDRef)

Disconnect text flow between text frames using kTextUnlinkCmdBoss.

Parameters
graphicFrameUIDRefreference to the text frame's kSplineItemBoss object.
Returns
kSuccess on success, other ErrorCode otherwise.