Show.Comment
Show.Comment은 Presentation 모듈(Office.show(iframe))의 객체 타입입니다. 메서드 14개.
비고
- 모듈: Presentation ·
Office.show(iframe)· 네임스페이스Show - 얻는 방법:
Document.findComments(slides, filter),Slide.findComments(filter),Slide.getComments(),Slide.getNextComment(commentProxy),Slide.getPrevComment(commentProxy),Slide.insertComment(text),Slide.replyComment(commentProxy, text) - 모든 메서드는
Promise를 반환하며, 시그니처는 TypeScript 표기입니다.
메서드
| 메서드 | 설명 |
|---|---|
appendText(text) | 댓글 텍스트 끝에 이어 붙인다. |
getAuthorName() | 댓글 작성자 이름을 반환한다. |
getDateTime() | 댓글 작성 일시를 반환한다. |
getParent() | 해당 댓글의 부모 댓글을 반환한다. |
getPosition() | 댓글 메모 아이콘의 슬라이드 기준 위치를 반환한다. |
getReplies() | 이 댓글의 답글 목록을 반환한다. |
getStyle() | 댓글 메모 스타일을 반환한다. |
getText() | 댓글 텍스트를 반환한다. |
hasReplies() | 답글이 하나라도 있는지 여부를 반환한다. |
isReply() | 이 댓글이 답글인지 여부를 반환한다. |
moveBy(distance) | 댓글 메모를 x, y 만큼 상대 이동시킨다. |
setPosition(position) | 댓글 메모를 슬라이드 기준 절대 위치로 이동시킨다. |
setStyle(style) | 댓글 메모 스타일을 변경한다. |
setText(text) | 댓글 텍스트를 설정한다. |
메서드 상세
appendText(text)
댓글 텍스트 끝에 이어 붙인다.
appendText(text: string): Promise<void>;
매개변수
| 이름 | 타입 | 설명 |
|---|---|---|
text | string | 추가할 텍스트 |
반환값
none
getAuthorName()
댓글 작성자 이름을 반환한다.
getAuthorName(): Promise<string | null>;
반환값
Promise<string | null> - 작성자 이름 (작성자 정보가 없으면 빈 문자열). 대상 댓글이 없으면 null
getDateTime()
댓글 작성 일시를 반환한다.
getDateTime(): Promise<string | null>;
반환값
Promise<string | null> - 작성 일시 'YYYY-MM-DDTHH:mm:ss.SSS'. 대상 댓글이 없으면 null
getParent()
해당 댓글의 부모 댓글을 반환한다.
getParent(): Promise<Comment>;
반환값
Promise<Comment> - 부모 댓글. 답글이 아니거나 대상 댓글이 없으면 null
getPosition()
댓글 메모 아이콘의 슬라이드 기준 위치를 반환한다.
getPosition(): Promise<CommentPosition | null>;
반환값
Promise<CommentPosition | null> - 댓글 메모 아이콘의 위치 (px 단위). 대상 댓글이 없으면 null
getReplies()
이 댓글의 답글 목록을 반환한다.
getReplies(): Promise<Comment[]>;
반환값
Promise<Comment[]> - 답글 목록. 대상 댓글이 없으면 빈 배열
getStyle()
댓글 메모 스타일을 반환한다. (setStyle 대칭) 스타일을 지정한 적 없는 댓글도 작성자별 기본 스타일로 반환된다.
getStyle(): Promise<CommentStyle | null>;
반환값
Promise<CommentStyle | null> - 메모 스타일. 대상 댓글이 없거나 프리셋 밖 스타일이면 null
getText()
댓글 텍스트를 반환한다.
getText(): Promise<string | null>;
반환값
Promise<string | null> - 댓글 텍스트. 대상 댓글이 없으면 null
hasReplies()
답글이 하나라도 있는지 여부를 반환한다.
hasReplies(): Promise<boolean | null>;
반환값
Promise<boolean | null> - 답글이 있으면 true. 대상 댓글이 없으면 null
isReply()
이 댓글이 답글인지 여부를 반환한다.
isReply(): Promise<boolean | null>;
반환값
Promise<boolean | null> - 답글이면 true. 대상 댓글이 없으면 null
moveBy(distance)
댓글 메모를 x, y 만큼 상대 이동시킨다.
moveBy(distance: { x: number; y: number }): Promise<void>;
매개변수
| 이름 | 타입 | 설명 |
|---|---|---|
distance | { x: number; y: number } | 이동량 (px 단위). 양수 = 오른쪽/아래 |
반환값
none
setPosition(position)
댓글 메모를 슬라이드 기준 절대 위치로 이동시킨다. (상대 이동은 moveBy)
setPosition(position: Partial<CommentPosition>): Promise<void>;
매개변수
| 이름 | 타입 | 설명 |
|---|---|---|
position | Partial<CommentPosition> | { x, y } (px 단위 절대 좌표). 생략한 축은 현재값 유지 |
반환값
none
setStyle(style)
댓글 메모 스타일을 변경한다. (getStyle 대칭)
setStyle(style: CommentStyle): Promise<void>;
매개변수
| 이름 | 타입 | 설명 |
|---|---|---|
style | CommentStyle | 메모 스타일 |
반환값
none
setText(text)
댓글 텍스트를 설정한다. (기존 내용은 대체됨)
setText(text: string): Promise<void>;
매개변수
| 이름 | 타입 | 설명 |
|---|---|---|
text | string | 댓글 텍스트 |
반환값
none