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 ScRange maRange
; /// Position of the comment in the worksheet.
33 RichStringRef mxText
; /// Formatted text of the comment (not used in BIFF8).
34 sal_Int32 mnAuthorId
; /// Identifier of the comment's author (OOXML and BIFF12 only).
35 bool mbAutoFill
; /// Auto Selection of comment object's fill style
36 bool mbAutoScale
; /// Auto Scale comment text
37 bool mbColHidden
; /// Comment cell's Column is Hidden
38 bool mbLocked
; /// Comment changes Locked
39 bool mbRowHidden
; /// Comment cell's Row is Hidden
40 sal_Int32 mnTHA
; /// Horizontal Alignment
41 sal_Int32 mnTVA
; /// Vertical Alignment
42 css::awt::Rectangle
const maAnchor
; /// Anchor parameters
44 explicit CommentModel();
47 class Comment
: public WorksheetHelper
50 explicit Comment( const WorksheetHelper
& rHelper
);
52 /** Imports a cell comment from the passed attributes of the comment element. */
53 void importComment( const AttributeList
& rAttribs
);
54 /** Imports a cell comment Properties from the passed attributes of the comment element. */
55 void importCommentPr( const AttributeList
& rAttribs
);
56 /** Imports a cell comment from the passed stream of a COMMENT record. */
57 void importComment( SequenceInputStream
& rStrm
);
59 /** Creates and returns a new rich-string object for the comment text. */
60 RichStringRef
const & createText();
62 /** Finalizes the formatted string of the comment. */
63 void finalizeImport();
69 typedef std::shared_ptr
< Comment
> CommentRef
;
71 class CommentsBuffer
: public WorksheetHelper
74 explicit CommentsBuffer( const WorksheetHelper
& rHelper
);
76 /** Appends a new author to the list of comment authors. */
77 void appendAuthor( const OUString
& rAuthor
);
78 /** Creates and returns a new comment. */
79 CommentRef
createComment();
81 /** Finalizes the formatted string of all comments. */
82 void finalizeImport();
85 typedef RefVector
< Comment
> CommentVector
;
87 std::vector
< OUString
> maAuthors
;
88 CommentVector maComments
;
96 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */