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
23 #include <tools/datetime.hxx>
24 #include <unotools/textsearch.hxx>
25 #include <svx/ctredlin.hxx>
26 #include "rangelst.hxx"
31 class SC_DLLPUBLIC ScChangeViewSettings
35 std::unique_ptr
<utl::TextSearch
>
37 DateTime aFirstDateTime
;
38 DateTime aLastDateTime
;
39 OUString aAuthorToShow
;
41 ScRangeList aRangeList
;
42 SvxRedlinDateMode eDateMode
;
51 sal_uLong mnFirstAction
;
52 sal_uLong mnLastAction
;
56 ScChangeViewSettings()
57 : pCommentSearcher(nullptr)
58 , aFirstDateTime(DateTime::EMPTY
)
59 , aLastDateTime(DateTime::EMPTY
)
60 , eDateMode(SvxRedlinDateMode::BEFORE
)
66 , bShowAccepted(false)
67 , bShowRejected(false)
68 , mbIsActionRange(false)
74 ScChangeViewSettings( const ScChangeViewSettings
& r
);
76 ~ScChangeViewSettings();
78 bool ShowChanges() const {return bShowIt
;}
79 void SetShowChanges(bool bFlag
) {bShowIt
=bFlag
;}
81 bool HasDate() const {return bIsDate
;}
82 void SetHasDate(bool bFlag
) {bIsDate
=bFlag
;}
84 void SetTheDateMode(SvxRedlinDateMode eDatMod
){ eDateMode
=eDatMod
; }
85 SvxRedlinDateMode
GetTheDateMode() const { return eDateMode
; }
87 void SetTheFirstDateTime(const DateTime
& aDateTime
) {aFirstDateTime
=aDateTime
;}
88 const DateTime
& GetTheFirstDateTime()const {return aFirstDateTime
;}
90 void SetTheLastDateTime(const DateTime
& aDateTime
) {aLastDateTime
=aDateTime
;}
91 const DateTime
& GetTheLastDateTime()const {return aLastDateTime
;}
93 bool HasAuthor() const {return bIsAuthor
;}
94 void SetHasAuthor(bool bFlag
) {bIsAuthor
=bFlag
;}
96 const OUString
& GetTheAuthorToShow()const {return aAuthorToShow
;}
97 void SetTheAuthorToShow(const OUString
& aString
){aAuthorToShow
=aString
;}
99 bool HasComment() const {return bIsComment
;}
100 void SetHasComment(bool bFlag
) {bIsComment
=bFlag
;}
102 const OUString
& GetTheComment()const {return aComment
;}
103 void SetTheComment(const OUString
& aString
);
105 bool IsValidComment(const OUString
* pCommentStr
) const;
107 bool HasRange() const {return bIsRange
;}
108 void SetHasRange(bool bFlag
) {bIsRange
=bFlag
;}
110 const ScRangeList
& GetTheRangeList()const {return aRangeList
;}
111 void SetTheRangeList(const ScRangeList
& aRl
){aRangeList
=aRl
;}
113 bool IsShowAccepted() const { return bShowAccepted
; }
114 void SetShowAccepted( bool bVal
) { bShowAccepted
= bVal
; }
116 bool IsShowRejected() const { return bShowRejected
; }
117 void SetShowRejected( bool bVal
) { bShowRejected
= bVal
; }
119 ScChangeViewSettings
& operator= ( const ScChangeViewSettings
& r
);
121 /// Adjust dates according to selected DateMode
122 void AdjustDateMode( const ScDocument
& rDoc
);
124 bool HasActionRange() const { return mbIsActionRange
; }
125 void SetHasActionRange() { mbIsActionRange
= true; }
126 void GetTheActionRange( sal_uLong
& nFirst
, sal_uLong
& nLast
) const { nFirst
= mnFirstAction
; nLast
= mnLastAction
; }
127 void SetTheActionRange( sal_uLong nFirst
, sal_uLong nLast
) { mnFirstAction
= nFirst
; mnLastAction
= nLast
; }
132 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */