InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
INoteUtils Class Referenceabstract

#include <INoteUtils.h>

Inheritance diagram for INoteUtils:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_INOTEUTILS }
 

Public Member Functions

virtual void ConvertNoteTipText (const uchar16 *inString, int32 &inBufLength, PMString &outBuffer)=0
 
virtual INoteDataQueryNoteData (const ITextModel *textModel, const TextIndex noteDataIndex)=0
 
virtual INoteDataQueryNoteData (const UIDRef &noteDataRef)=0
 
virtual INoteDataGetNoteData (ITextModel *textModel, TextIndex offset)=0
 
virtual SysPoint GlobalToLocal (IControlView *controlView, SysPoint globalPoint)=0
 
virtual IMultiColumnTextFrameQueryTextFrame (IControlView *controlView, PMPoint where, RangeData *caret, bool16 composeFirst=kTrue)=0
 
virtual void GetTime (PMString *time)=0
 
virtual IDocumentQueryDocument (ITextModel *model, IControlView *view)=0
 
virtual bool16 InGalley (IGalleySwitch *galleySwitch)=0
 
virtual PMPoint IndexToPMPoint (ITextModel *textModel, const RangeData &caret, int32 *thisFrameIndex)=0
 
virtual bool16 GetStoryLockState (ITextModel *textModel)=0
 
virtual bool16 GetStoryLockState (IDocument *document)=0
 
virtual const int32 GetDocAnchorCount (IDocument *document)=0
 
virtual const int32 GetAnchorCount (ITextModel *textModel)=0
 
virtual int32 ResetStoryAnchorCount (ITextModel *textModel)=0
 
virtual int32 ResetDocAnchorCount (IDocument *document)=0
 
virtual PMReal GetGalleyLeftIndent ()=0
 
virtual bool16 NoteInCurrentSpread (UID noteSpreadUID, UID curSpreadUID, IMasterSpreadList *masterSpreadList)=0
 
virtual bool16 PageItemInvisible (ITextModel *textModel, IHierarchy *hierItem)=0
 
virtual UID GetLastVisibleFrame (ITextModel *textModel, TextIndex startIndex)=0
 
virtual IDocumentPresentationGetDocWindow (IDataBase *dataBase)=0
 
virtual UID GetSpreadUID (ITextModel *textModel, TextIndex offset)=0
 
virtual UID GetSpreadUID (INoteData *noteData, ITextModel *textModel, TextIndex position)=0
 
virtual bool16 InvisibleText (ITextModel *textModel, TextIndex index)=0
 
virtual bool16 FindNoteStoryThread (ITextModel *textModel, UID noteDataUID, TextIndex *threadStart, int32 *threadSpan)=0
 
virtual WideString GetNoteContent (ITextModel *textModel, const UIDRef &noteRef)=0
 
virtual ErrorCode ToggleAllNoteCollapse (ITextModel *textModel, UID currentNoteUID, bool16 newCollapseState, bool16 collapseAllButOne)=0
 
virtual void ClearAllNotes (IDocument *document)=0
 
virtual void ClearAllNotes (ITextModel *textModel)=0
 
virtual void DoDragDropNoteModel (UIDRef srcStoryRef, UIDRef targetStoryRef, TextIndex srcTextIndex, TextIndex targetTextIndex, bool16 duplicateNote, bool16 startOfDeletedText)=0
 
- Public Member Functions inherited from IPMUnknown
virtual IPMUnknownQueryInterface (PMIID interfaceID) const =0
 
virtual void AddRef () const =0
 
virtual void Release () const =0
 

Detailed Description

Utility interface for Notes.

Member Function Documentation

virtual void INoteUtils::ClearAllNotes (IDocumentdocument)
pure virtual

Remove all Notes on the given document

Parameters
document
virtual void INoteUtils::ClearAllNotes (ITextModeltextModel)
pure virtual

Remove all Notes on the given story (param textModel)

Parameters
textModel
virtual void INoteUtils::ConvertNoteTipText (const uchar16 * inString,
int32 & inBufLength,
PMStringoutBuffer 
)
pure virtual

Convert tip content into meaningful display characters.

Parameters
inString
inBufLength
outBuffer
virtual void INoteUtils::DoDragDropNoteModel (UIDRef srcStoryRef,
UIDRef targetStoryRef,
TextIndex srcTextIndex,
TextIndex targetTextIndex,
bool16 duplicateNote,
bool16 startOfDeletedText 
)
pure virtual

Internal Use Only

virtual bool16 INoteUtils::FindNoteStoryThread (ITextModeltextModel,
UID noteDataUID,
TextIndex * threadStart,
int32 * threadSpan 
)
pure virtual

Find the Note thread by given the param noteDataUID

Parameters
textModelThe story contains the Note
noteDataUIDThe Note Data UID
threadStartReturn the start text index of Note thread
threadSpanReturn the Note thread length
Returns
bool16 kTrue = Note thread exists, kFalse = Note thread not exists
virtual const int32 INoteUtils::GetAnchorCount (ITextModeltextModel)
pure virtual

Get the total Notes count by given the story (param textModel)

Parameters
textModel
Returns
const
virtual const int32 INoteUtils::GetDocAnchorCount (IDocumentdocument)
pure virtual

Get the total Notes count by the given document

Parameters
document
Returns
const
virtual IDocumentPresentation* INoteUtils::GetDocWindow (IDataBasedataBase)
pure virtual

Not used anymore in CS2.

Parameters
dataBase
Returns
IDocumentPresentation*
virtual PMReal INoteUtils::GetGalleyLeftIndent ()
pure virtual

Not used anymore in CS2.

Parameters
none
Returns
PMReal
virtual UID INoteUtils::GetLastVisibleFrame (ITextModeltextModel,
TextIndex startIndex 
)
pure virtual

Not used anymore in CS2.

Parameters
textModel
startIndex
Returns
UID
virtual WideString INoteUtils::GetNoteContent (ITextModeltextModel,
const UIDRefnoteRef 
)
pure virtual

Get the Note content by given param noteRef

Parameters
textModelThe story contains the Note
noteRefThe Note UIDRef
Returns
WideString The content of the Note
virtual INoteData* INoteUtils::GetNoteData (ITextModeltextModel,
TextIndex offset 
)
pure virtual

Get Note data by given offset

Parameters
textModel
offset
Returns
INoteData*
virtual UID INoteUtils::GetSpreadUID (ITextModeltextModel,
TextIndex offset 
)
pure virtual
Not used anymore in CS2.

Given the story and its text index offset, return the spread UID of the text frame containing this given index.

Parameters
textModel
offset
Returns
UID
virtual UID INoteUtils::GetSpreadUID (INoteDatanoteData,
ITextModeltextModel,
TextIndex position 
)
pure virtual
Not used anymore.

This method handles differently in InCopy and InDesign due to the way overset text is structured.

InCopy: This method first determine if a given text index lives in the overset text frame. There is actually no overset in InCopy, we create enough frames to hold the overset text and put them in the pasteboard.

  1. If the index is in overset frame, this method walks from the given index backward to find the last non-overset text frame and returns the spread UID of that frame.
  2. If the index is not in the overset frame, we simply use the given INoteTextAttribute to get the frame UID.

Usage: This is used for switching between layout and galley view where the page spread we're switching to will not be correct if we're in overset text in Galley view.

InDesign: Simply return the spread UID from the attribute. This is probably not used for InDesign with InCopy plugin since there is no note window UI there. Just add here for future use.

Parameters
noteData
textModel
position
Returns
UID
virtual bool16 INoteUtils::GetStoryLockState (ITextModeltextModel)
pure virtual

Report the current lock state by given story, use the insert lock to determine state, assume not locked if there is no valid model.

Parameters
textModel
Returns
bool16
virtual bool16 INoteUtils::GetStoryLockState (IDocumentdocument)
pure virtual

Report the lock state of all the stories with the given document. Return kTrue if at least one story is locked, otherwise, return kFalse.

Parameters
document
Returns
bool16
virtual void INoteUtils::GetTime (PMStringtime)
pure virtual

Return the current time which includes date and time

Parameters
time
virtual SysPoint INoteUtils::GlobalToLocal (IControlViewcontrolView,
SysPoint globalPoint 
)
pure virtual

Convert a SysPoint from global coordinate to a local coordinate in the controlView context.

Parameters
controlView
globalPoint
Returns
virtual PMPoint INoteUtils::IndexToPMPoint (ITextModeltextModel,
const RangeDatacaret,
int32 * thisFrameIndex 
)
pure virtual

Given a text index range, return the local coordinate on the page. It also returns the frame index of the given text range. For instance, if try to find out the Note Anchor coordinate on the page, could use RangeData(noteAnchorIndex, RangeData::kLeanForward)

Parameters
textModel
caretThe text index
thisFrameIndexReturn the start text index of the frame contains the Note
Returns
PMPoint
virtual bool16 INoteUtils::InGalley (IGalleySwitchgalleySwitch)
pure virtual

Check if the active view is galley/story editor Return kTrue if the current mode is in the Galley mode in InCopy Return kFalse if the current mode is in the layout mode in InCopy

Parameters
galleySwitchnil = return kFalse
Returns
bool16
virtual bool16 INoteUtils::InvisibleText (ITextModeltextModel,
TextIndex index 
)
pure virtual

Not used anymore. Given the story and its text index offset, this routine determines if the given text position is in the 'invisible' layer. This special layer is created to hold the text frames big enough to hold the overset text. Therefore, in InCopy, there will never be an overset situation because we always expand to hold the last character in the story. This will go away in InDesign 2.0.

Parameters
textModel
index
Returns
bool16
virtual bool16 INoteUtils::NoteInCurrentSpread (UID noteSpreadUID,
UID curSpreadUID,
IMasterSpreadListmasterSpreadList 
)
pure virtual

Not used anymore in CS2.

Parameters
noteSpreadUID
curSpreadUID
masterSpreadList
Returns
bool16
virtual bool16 INoteUtils::PageItemInvisible (ITextModeltextModel,
IHierarchyhierItem 
)
pure virtual

Not used anymore in CS2.

Parameters
textModel
hierItem
Returns
bool16
virtual IDocument* INoteUtils::QueryDocument (ITextModelmodel,
IControlViewview 
)
pure virtual

Not used anymore in CS2.

Parameters
model
view
Returns
IDocument*
virtual INoteData* INoteUtils::QueryNoteData (const ITextModeltextModel,
const TextIndex noteDataIndex 
)
pure virtual

Query Note data by given the text index

Parameters
textModel
noteDataIndex
Returns
INoteData*
virtual INoteData* INoteUtils::QueryNoteData (const UIDRefnoteDataRef)
pure virtual

Query Note data by given noteDataRef

Parameters
noteDataRef
Returns
INoteData*
virtual IMultiColumnTextFrame* INoteUtils::QueryTextFrame (IControlViewcontrolView,
PMPoint where,
RangeDatacaret,
bool16 composeFirst = kTrue 
)
pure virtual

With the given locaiton in "where", this method performs a hittest RangeData over the controlView. If found, it returns the hittest text range and the resulting text frame If not found, it returns a nil text frame. "ComposeFirst" allows the text system to force recompose the story in order to get accurate information.

Parameters
controlView
where
caret
composeFirst
Returns
IMultiColumnTextFrame*
virtual int32 INoteUtils::ResetDocAnchorCount (IDocumentdocument)
pure virtual

Not used anymore in CS2.

Parameters
document
Returns
int32
virtual int32 INoteUtils::ResetStoryAnchorCount (ITextModeltextModel)
pure virtual

Not used anymore in CS2.

Parameters
textModel
Returns
int32
virtual ErrorCode INoteUtils::ToggleAllNoteCollapse (ITextModeltextModel,
UID currentNoteUID,
bool16 newCollapseState,
bool16 collapseAllButOne 
)
pure virtual

Toggle to collapse/expand all Notes on teh given story (param textModel)

Parameters
textModelThe story
currentNoteUIDThe current Note
newCollapseStatekTrue = Collapsed All Notes, kFalse = Expand All Notes
collapseAllButOnekTrue = affect only current Note, kFalse = affect all Notes
Returns
ErrorCode