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