1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_SC_SOURCE_FILTER_INC_COMMENTSBUFFER_HXX
21 #define INCLUDED_SC_SOURCE_FILTER_INC_COMMENTSBUFFER_HXX
23 #include "richstring.hxx"
24 #include "worksheethelper.hxx"
25 #include <com/sun/star/awt/Rectangle.hpp>
32 ::com::sun::star::table::CellRangeAddress
33 maRange
; /// Position of the comment in the worksheet.
34 RichStringRef mxText
; /// Formatted text of the comment (not used in BIFF8).
35 OUString maAuthor
; /// Comment author (BIFF8 only).
36 sal_Int32 mnAuthorId
; /// Identifier of the comment's author (OOXML and BIFF12 only).
37 sal_uInt16 mnObjId
; /// Drawing object identifier (BIFF8 only).
38 bool mbAutoFill
; /// Auto Selection of comment object's fill style
39 bool mbAutoScale
; /// Auto Scale comment text
40 bool mbColHidden
; /// Comment cell's Column is Hidden
41 bool mbLocked
; /// Comment changes Locked
42 bool mbRowHidden
; /// Comment cell's Row is Hidden
43 sal_Int32 mnTHA
; /// Horizontal Alignment
44 sal_Int32 mnTVA
; /// Vertical Alignment
45 ::com::sun::star::awt::Rectangle
46 maAnchor
; /// Anchor parameters
47 bool mbVisible
; /// True = comment is always shown (BIFF2-BIFF8 only).
49 explicit CommentModel();
52 class Comment
: public WorksheetHelper
55 explicit Comment( const WorksheetHelper
& rHelper
);
57 /** Imports a cell comment from the passed attributes of the comment element. */
58 void importComment( const AttributeList
& rAttribs
);
59 /** Imports a cell comment Properties from the passed attributes of the comment element. */
60 void importCommentPr( const AttributeList
& rAttribs
);
61 /** Imports a cell comment from the passed stream of a COMMENT record. */
62 void importComment( SequenceInputStream
& rStrm
);
64 /** Creates and returns a new rich-string object for the comment text. */
65 RichStringRef
createText();
67 /** Finalizes the formatted string of the comment. */
68 void finalizeImport();
74 typedef std::shared_ptr
< Comment
> CommentRef
;
76 class CommentsBuffer
: public WorksheetHelper
79 explicit CommentsBuffer( const WorksheetHelper
& rHelper
);
81 /** Appends a new author to the list of comment authors. */
82 void appendAuthor( const OUString
& rAuthor
);
83 /** Creates and returns a new comment. */
84 CommentRef
createComment();
86 /** Finalizes the formatted string of all comments. */
87 void finalizeImport();
90 typedef ::std::vector
< OUString
> OUStringVector
;
91 typedef RefVector
< Comment
> CommentVector
;
93 OUStringVector maAuthors
;
94 CommentVector maComments
;
102 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */