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 SC_CHGVISET_HXX
20 #define SC_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
;
52 sal_Bool bEveryoneButMe
;
53 sal_Bool bShowAccepted
;
54 sal_Bool bShowRejected
;
56 sal_uLong mnFirstAction
;
57 sal_uLong mnLastAction
;
61 ScChangeViewSettings() :
62 aFirstDateTime( DateTime::EMPTY
),
63 aLastDateTime( DateTime::EMPTY
)
65 pCommentSearcher
=NULL
;
71 eDateMode
=SCDM_DATE_BEFORE
;
75 mbIsActionRange
= false;
78 ScChangeViewSettings( const ScChangeViewSettings
& r
);
80 ~ScChangeViewSettings();
82 sal_Bool
ShowChanges() const {return bShowIt
;}
83 void SetShowChanges(sal_Bool nFlag
=sal_True
){bShowIt
=nFlag
;}
85 sal_Bool
HasDate() const {return bIsDate
;}
86 void SetHasDate(sal_Bool nFlag
=sal_True
) {bIsDate
=nFlag
;}
88 void SetTheDateMode(ScChgsDateMode eDatMod
){ eDateMode
=eDatMod
; }
89 ScChgsDateMode
GetTheDateMode() const { return eDateMode
; }
91 void SetTheFirstDateTime(const DateTime
& aDateTime
) {aFirstDateTime
=aDateTime
;}
92 const DateTime
& GetTheFirstDateTime()const {return aFirstDateTime
;}
94 void SetTheLastDateTime(const DateTime
& aDateTime
) {aLastDateTime
=aDateTime
;}
95 const DateTime
& GetTheLastDateTime()const {return aLastDateTime
;}
98 sal_Bool
HasAuthor() const {return bIsAuthor
;}
99 void SetHasAuthor(sal_Bool nFlag
=sal_True
) {bIsAuthor
=nFlag
;}
101 OUString
GetTheAuthorToShow()const {return aAuthorToShow
;}
102 void SetTheAuthorToShow(const OUString
& aString
){aAuthorToShow
=aString
;}
104 sal_Bool
HasComment() const {return bIsComment
;}
105 void SetHasComment(sal_Bool nFlag
=sal_True
) {bIsComment
=nFlag
;}
107 OUString
GetTheComment()const {return aComment
;}
108 void SetTheComment(const OUString
& aString
);
110 sal_Bool
IsValidComment(const OUString
* pCommentStr
) const;
112 sal_Bool
IsEveryoneButMe() const {return bEveryoneButMe
;}
113 void SetEveryoneButMe(sal_Bool nFlag
=sal_True
) {bEveryoneButMe
=nFlag
;}
116 sal_Bool
HasRange() const {return bIsRange
;}
117 void SetHasRange(sal_Bool nFlag
=sal_True
) {bIsRange
=nFlag
;}
119 const ScRangeList
& GetTheRangeList()const {return aRangeList
;}
120 void SetTheRangeList(const ScRangeList
& aRl
){aRangeList
=aRl
;}
122 sal_Bool
IsShowAccepted() const { return bShowAccepted
; }
123 void SetShowAccepted( sal_Bool bVal
) { bShowAccepted
= bVal
; }
125 sal_Bool
IsShowRejected() const { return bShowRejected
; }
126 void SetShowRejected( sal_Bool bVal
) { bShowRejected
= bVal
; }
128 ScChangeViewSettings
& operator= ( const ScChangeViewSettings
& r
);
130 /// Adjust dates according to selected DateMode
131 void AdjustDateMode( const ScDocument
& rDoc
);
133 bool HasActionRange() const { return mbIsActionRange
; }
134 void SetHasActionRange( bool nFlag
= true ) { mbIsActionRange
= nFlag
; }
135 void GetTheActionRange( sal_uLong
& nFirst
, sal_uLong
& nLast
) const { nFirst
= mnFirstAction
; nLast
= mnLastAction
; }
136 void SetTheActionRange( sal_uLong nFirst
, sal_uLong nLast
) { mnFirstAction
= nFirst
; mnLastAction
= nLast
; }
143 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */