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 .
19 #ifndef INCLUDED_SC_INC_CHGVISET_HXX
20 #define INCLUDED_SC_INC_CHGVISET_HXX
22 #include <tools/datetime.hxx>
23 #include "rangelst.hxx"
26 enum ScChgsDateMode
{ SCDM_DATE_BEFORE
=0,SCDM_DATE_SINCE
=1,SCDM_DATE_EQUAL
=2,
27 SCDM_DATE_NOTEQUAL
=3,SCDM_DATE_BETWEEN
=4, SCDM_DATE_SAVE
=5,
36 class SC_DLLPUBLIC ScChangeViewSettings
40 utl::TextSearch
* pCommentSearcher
;
41 DateTime aFirstDateTime
;
42 DateTime aLastDateTime
;
43 OUString aAuthorToShow
;
45 ScRangeList aRangeList
;
46 ScChgsDateMode eDateMode
;
56 sal_uLong mnFirstAction
;
57 sal_uLong mnLastAction
;
61 ScChangeViewSettings()
62 : pCommentSearcher(NULL
)
63 , aFirstDateTime(DateTime::EMPTY
)
64 , aLastDateTime(DateTime::EMPTY
)
65 , eDateMode(SCDM_DATE_BEFORE
)
71 , bEveryoneButMe(false)
72 , bShowAccepted(false)
73 , bShowRejected(false)
74 , mbIsActionRange(false)
80 ScChangeViewSettings( const ScChangeViewSettings
& r
);
82 ~ScChangeViewSettings();
84 bool ShowChanges() const {return bShowIt
;}
85 void SetShowChanges(bool nFlag
) {bShowIt
=nFlag
;}
87 bool HasDate() const {return bIsDate
;}
88 void SetHasDate(bool nFlag
) {bIsDate
=nFlag
;}
90 void SetTheDateMode(ScChgsDateMode eDatMod
){ eDateMode
=eDatMod
; }
91 ScChgsDateMode
GetTheDateMode() const { return eDateMode
; }
93 void SetTheFirstDateTime(const DateTime
& aDateTime
) {aFirstDateTime
=aDateTime
;}
94 const DateTime
& GetTheFirstDateTime()const {return aFirstDateTime
;}
96 void SetTheLastDateTime(const DateTime
& aDateTime
) {aLastDateTime
=aDateTime
;}
97 const DateTime
& GetTheLastDateTime()const {return aLastDateTime
;}
100 bool HasAuthor() const {return bIsAuthor
;}
101 void SetHasAuthor(bool nFlag
) {bIsAuthor
=nFlag
;}
103 OUString
GetTheAuthorToShow()const {return aAuthorToShow
;}
104 void SetTheAuthorToShow(const OUString
& aString
){aAuthorToShow
=aString
;}
106 bool HasComment() const {return bIsComment
;}
107 void SetHasComment(bool nFlag
) {bIsComment
=nFlag
;}
109 OUString
GetTheComment()const {return aComment
;}
110 void SetTheComment(const OUString
& aString
);
112 bool IsValidComment(const OUString
* pCommentStr
) const;
114 bool IsEveryoneButMe() const {return bEveryoneButMe
;}
115 void SetEveryoneButMe(bool nFlag
) {bEveryoneButMe
=nFlag
;}
118 bool HasRange() const {return bIsRange
;}
119 void SetHasRange(bool nFlag
) {bIsRange
=nFlag
;}
121 const ScRangeList
& GetTheRangeList()const {return aRangeList
;}
122 void SetTheRangeList(const ScRangeList
& aRl
){aRangeList
=aRl
;}
124 bool IsShowAccepted() const { return bShowAccepted
; }
125 void SetShowAccepted( bool bVal
) { bShowAccepted
= bVal
; }
127 bool IsShowRejected() const { return bShowRejected
; }
128 void SetShowRejected( bool bVal
) { bShowRejected
= bVal
; }
130 ScChangeViewSettings
& operator= ( const ScChangeViewSettings
& r
);
132 /// Adjust dates according to selected DateMode
133 void AdjustDateMode( const ScDocument
& rDoc
);
135 bool HasActionRange() const { return mbIsActionRange
; }
136 void SetHasActionRange( bool nFlag
= true ) { mbIsActionRange
= nFlag
; }
137 void GetTheActionRange( sal_uLong
& nFirst
, sal_uLong
& nLast
) const { nFirst
= mnFirstAction
; nLast
= mnLastAction
; }
138 void SetTheActionRange( sal_uLong nFirst
, sal_uLong nLast
) { mnFirstAction
= nFirst
; mnLastAction
= nLast
; }
143 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */