1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: chgviset.hxx,v $
10 * $Revision: 1.6.32.2 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef SC_CHGVISET_HXX
31 #define SC_CHGVISET_HXX
33 #include <tools/datetime.hxx>
34 #include <tools/string.hxx>
35 #include "rangelst.hxx"
38 enum ScChgsDateMode
{ SCDM_DATE_BEFORE
=0,SCDM_DATE_SINCE
=1,SCDM_DATE_EQUAL
=2,
39 SCDM_DATE_NOTEQUAL
=3,SCDM_DATE_BETWEEN
=4, SCDM_DATE_SAVE
=5,
48 class SC_DLLPUBLIC ScChangeViewSettings
52 utl::TextSearch
* pCommentSearcher
;
53 DateTime aFirstDateTime
;
54 DateTime aLastDateTime
;
57 ScRangeList aRangeList
;
58 ScChgsDateMode eDateMode
;
73 ScChangeViewSettings()
75 pCommentSearcher
=NULL
;
81 eDateMode
=SCDM_DATE_BEFORE
;
85 mbIsActionRange
= false;
88 ScChangeViewSettings( const ScChangeViewSettings
& r
);
90 ~ScChangeViewSettings();
92 BOOL
ShowChanges() const {return bShowIt
;}
93 void SetShowChanges(BOOL nFlag
=TRUE
){bShowIt
=nFlag
;}
95 BOOL
HasDate() const {return bIsDate
;}
96 void SetHasDate(BOOL nFlag
=TRUE
) {bIsDate
=nFlag
;}
98 void SetTheDateMode(ScChgsDateMode eDatMod
){ eDateMode
=eDatMod
; }
99 ScChgsDateMode
GetTheDateMode() const { return eDateMode
; }
101 void SetTheFirstDateTime(const DateTime
& aDateTime
) {aFirstDateTime
=aDateTime
;}
102 const DateTime
& GetTheFirstDateTime()const {return aFirstDateTime
;}
104 void SetTheLastDateTime(const DateTime
& aDateTime
) {aLastDateTime
=aDateTime
;}
105 const DateTime
& GetTheLastDateTime()const {return aLastDateTime
;}
108 BOOL
HasAuthor() const {return bIsAuthor
;}
109 void SetHasAuthor(BOOL nFlag
=TRUE
) {bIsAuthor
=nFlag
;}
111 String
GetTheAuthorToShow()const {return aAuthorToShow
;}
112 void SetTheAuthorToShow(const String
& aString
){aAuthorToShow
=aString
;}
114 BOOL
HasComment() const {return bIsComment
;}
115 void SetHasComment(BOOL nFlag
=TRUE
) {bIsComment
=nFlag
;}
117 String
GetTheComment()const {return aComment
;}
118 void SetTheComment(const String
& aString
);
120 BOOL
IsValidComment(const String
* pCommentStr
) const;
122 BOOL
IsEveryoneButMe() const {return bEveryoneButMe
;}
123 void SetEveryoneButMe(BOOL nFlag
=TRUE
) {bEveryoneButMe
=nFlag
;}
126 BOOL
HasRange() const {return bIsRange
;}
127 void SetHasRange(BOOL nFlag
=TRUE
) {bIsRange
=nFlag
;}
129 const ScRangeList
& GetTheRangeList()const {return aRangeList
;}
130 void SetTheRangeList(const ScRangeList
& aRl
){aRangeList
=aRl
;}
132 BOOL
IsShowAccepted() const { return bShowAccepted
; }
133 void SetShowAccepted( BOOL bVal
) { bShowAccepted
= bVal
; }
135 BOOL
IsShowRejected() const { return bShowRejected
; }
136 void SetShowRejected( BOOL bVal
) { bShowRejected
= bVal
; }
138 ScChangeViewSettings
& operator= ( const ScChangeViewSettings
& r
);
140 /// Adjust dates according to selected DateMode
141 void AdjustDateMode( const ScDocument
& rDoc
);
143 bool HasActionRange() const { return mbIsActionRange
; }
144 void SetHasActionRange( bool nFlag
= true ) { mbIsActionRange
= nFlag
; }
145 void GetTheActionRange( ULONG
& nFirst
, ULONG
& nLast
) const { nFirst
= mnFirstAction
; nLast
= mnLastAction
; }
146 void SetTheActionRange( ULONG nFirst
, ULONG nLast
) { mnFirstAction
= nFirst
; mnLastAction
= nLast
; }