merged tag ooo/OOO330_m14
[LibreOffice.git] / sc / inc / chgviset.hxx
blobddc0dcc1424330cfab0991cd1a000948beceb87d
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
27 #ifndef SC_CHGVISET_HXX
28 #define SC_CHGVISET_HXX
30 #include <tools/datetime.hxx>
31 #include <tools/string.hxx>
32 #include "rangelst.hxx"
33 #include "scdllapi.h"
35 enum ScChgsDateMode{ SCDM_DATE_BEFORE=0,SCDM_DATE_SINCE=1,SCDM_DATE_EQUAL=2,
36 SCDM_DATE_NOTEQUAL=3,SCDM_DATE_BETWEEN=4, SCDM_DATE_SAVE=5,
37 SCDM_NO_DATEMODE=6};
39 namespace utl {
40 class TextSearch;
43 class ScDocument;
45 class SC_DLLPUBLIC ScChangeViewSettings
47 private:
49 utl::TextSearch* pCommentSearcher;
50 DateTime aFirstDateTime;
51 DateTime aLastDateTime;
52 String aAuthorToShow;
53 String aComment;
54 ScRangeList aRangeList;
55 ScChgsDateMode eDateMode;
56 BOOL bShowIt;
57 BOOL bIsDate;
58 BOOL bIsAuthor;
59 BOOL bIsComment;
60 BOOL bIsRange;
61 BOOL bEveryoneButMe;
62 BOOL bShowAccepted;
63 BOOL bShowRejected;
64 bool mbIsActionRange;
65 ULONG mnFirstAction;
66 ULONG mnLastAction;
68 public:
70 ScChangeViewSettings()
72 pCommentSearcher=NULL;
73 bIsDate=FALSE;
74 bIsAuthor=FALSE;
75 bIsRange=FALSE;
76 bIsComment=FALSE;
77 bShowIt=FALSE;
78 eDateMode=SCDM_DATE_BEFORE;
79 bEveryoneButMe=FALSE;
80 bShowAccepted=FALSE;
81 bShowRejected=FALSE;
82 mbIsActionRange = false;
85 ScChangeViewSettings( const ScChangeViewSettings& r );
87 ~ScChangeViewSettings();
89 BOOL ShowChanges() const {return bShowIt;}
90 void SetShowChanges(BOOL nFlag=TRUE){bShowIt=nFlag;}
92 BOOL HasDate() const {return bIsDate;}
93 void SetHasDate(BOOL nFlag=TRUE) {bIsDate=nFlag;}
95 void SetTheDateMode(ScChgsDateMode eDatMod){ eDateMode=eDatMod; }
96 ScChgsDateMode GetTheDateMode() const { return eDateMode; }
98 void SetTheFirstDateTime(const DateTime& aDateTime) {aFirstDateTime=aDateTime;}
99 const DateTime& GetTheFirstDateTime()const {return aFirstDateTime;}
101 void SetTheLastDateTime(const DateTime& aDateTime) {aLastDateTime=aDateTime;}
102 const DateTime& GetTheLastDateTime()const {return aLastDateTime;}
105 BOOL HasAuthor() const {return bIsAuthor;}
106 void SetHasAuthor(BOOL nFlag=TRUE) {bIsAuthor=nFlag;}
108 String GetTheAuthorToShow()const {return aAuthorToShow;}
109 void SetTheAuthorToShow(const String& aString){aAuthorToShow=aString;}
111 BOOL HasComment() const {return bIsComment;}
112 void SetHasComment(BOOL nFlag=TRUE) {bIsComment=nFlag;}
114 String GetTheComment()const {return aComment;}
115 void SetTheComment(const String& aString);
117 BOOL IsValidComment(const String* pCommentStr) const;
119 BOOL IsEveryoneButMe() const {return bEveryoneButMe;}
120 void SetEveryoneButMe(BOOL nFlag=TRUE) {bEveryoneButMe=nFlag;}
123 BOOL HasRange() const {return bIsRange;}
124 void SetHasRange(BOOL nFlag=TRUE) {bIsRange=nFlag;}
126 const ScRangeList& GetTheRangeList()const {return aRangeList;}
127 void SetTheRangeList(const ScRangeList& aRl){aRangeList=aRl;}
129 BOOL IsShowAccepted() const { return bShowAccepted; }
130 void SetShowAccepted( BOOL bVal ) { bShowAccepted = bVal; }
132 BOOL IsShowRejected() const { return bShowRejected; }
133 void SetShowRejected( BOOL bVal ) { bShowRejected = bVal; }
135 ScChangeViewSettings& operator= ( const ScChangeViewSettings& r );
137 /// Adjust dates according to selected DateMode
138 void AdjustDateMode( const ScDocument& rDoc );
140 bool HasActionRange() const { return mbIsActionRange; }
141 void SetHasActionRange( bool nFlag = true ) { mbIsActionRange = nFlag; }
142 void GetTheActionRange( ULONG& nFirst, ULONG& nLast ) const { nFirst = mnFirstAction; nLast = mnLastAction; }
143 void SetTheActionRange( ULONG nFirst, ULONG nLast ) { mnFirstAction = nFirst; mnLastAction = nLast; }
148 #endif