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