1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 #ifndef _SDR_COMMENT_HXX 25 #define _SDR_COMMENT_HXX 26 27 #include <sal/types.h> 28 #include <tools/date.hxx> 29 #include <rtl/ustring.hxx> 30 #include <basegfx/point/b2dpoint.hxx> 31 32 #include <vector> 33 34 ////////////////////////////////////////////////////////////////////////////// 35 // predeclarations 36 37 ////////////////////////////////////////////////////////////////////////////// 38 39 namespace sdr 40 { 41 class Comment 42 { 43 // counting ID 44 sal_uInt32 mnID; 45 46 // creation date 47 Date maCreationDate; 48 49 // name of creator 50 ::rtl::OUString maUserName; 51 52 // text content 53 ::rtl::OUString maText; 54 55 // position 56 basegfx::B2DPoint maPosition; 57 58 public: 59 Comment( 60 sal_uInt32 nID, 61 Date aCreationDate, 62 const ::rtl::OUString& rUserName, 63 const ::rtl::OUString& rText, 64 const basegfx::B2DPoint& rPosition); 65 ~Comment(); 66 67 // operator for sorting the vector by mnID operator <(const Comment & rCandidate) const68 sal_Bool operator<(const Comment& rCandidate) const { return (mnID < rCandidate.mnID); } 69 70 // comparison operators 71 sal_Bool operator==(const Comment& rCandidate) const; operator !=(const Comment & rCandidate) const72 sal_Bool operator!=(const Comment& rCandidate) const { return !(operator==(rCandidate)); } 73 74 // access to ID, read only GetID() const75 sal_uInt32 GetID() const { return mnID; } 76 77 // access to CreationDate GetCreationDate() const78 Date GetCreationDate() const { return maCreationDate; } 79 void SetCreationDate(Date aNewDate); 80 81 // access to UserName GetUserName() const82 const ::rtl::OUString& GetUserName() const { return maUserName; } 83 void SetUserName(const ::rtl::OUString& rNewName); 84 85 // access to text GetText() const86 const ::rtl::OUString& GetText() const { return maText; } 87 void SetText(const ::rtl::OUString& rNewText); 88 89 // access to position GetPosition() const90 const basegfx::B2DPoint& GetPosition() const { return maPosition; } 91 void SetPosition(const basegfx::B2DPoint& rNewPos); 92 }; 93 94 // typedef for list of sdr::Comment 95 typedef ::std::vector< Comment > CommentVector; 96 } // end of namespace sdr 97 98 ////////////////////////////////////////////////////////////////////////////// 99 100 #endif //_SDR_COMMENT_HXX 101 // eof 102