xref: /trunk/main/sc/inc/chgviset.hxx (revision 914d351e5f5b84e4342a86d6ab8d4aca7308b9bd)
1*38d50f7bSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*38d50f7bSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*38d50f7bSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*38d50f7bSAndrew Rist  * distributed with this work for additional information
6*38d50f7bSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*38d50f7bSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*38d50f7bSAndrew Rist  * "License"); you may not use this file except in compliance
9*38d50f7bSAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11*38d50f7bSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13*38d50f7bSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*38d50f7bSAndrew Rist  * software distributed under the License is distributed on an
15*38d50f7bSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*38d50f7bSAndrew Rist  * KIND, either express or implied.  See the License for the
17*38d50f7bSAndrew Rist  * specific language governing permissions and limitations
18*38d50f7bSAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20*38d50f7bSAndrew Rist  *************************************************************/
21*38d50f7bSAndrew Rist 
22*38d50f7bSAndrew Rist 
23cdf0e10cSrcweir #ifndef SC_CHGVISET_HXX
24cdf0e10cSrcweir #define SC_CHGVISET_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include <tools/datetime.hxx>
27cdf0e10cSrcweir #include <tools/string.hxx>
28cdf0e10cSrcweir #include "rangelst.hxx"
29cdf0e10cSrcweir #include "scdllapi.h"
30cdf0e10cSrcweir 
31cdf0e10cSrcweir enum ScChgsDateMode{    SCDM_DATE_BEFORE=0,SCDM_DATE_SINCE=1,SCDM_DATE_EQUAL=2,
32cdf0e10cSrcweir                         SCDM_DATE_NOTEQUAL=3,SCDM_DATE_BETWEEN=4, SCDM_DATE_SAVE=5,
33cdf0e10cSrcweir                         SCDM_NO_DATEMODE=6};
34cdf0e10cSrcweir 
35cdf0e10cSrcweir namespace utl {
36cdf0e10cSrcweir     class TextSearch;
37cdf0e10cSrcweir }
38cdf0e10cSrcweir 
39cdf0e10cSrcweir class ScDocument;
40cdf0e10cSrcweir 
41cdf0e10cSrcweir class SC_DLLPUBLIC ScChangeViewSettings
42cdf0e10cSrcweir {
43cdf0e10cSrcweir private:
44cdf0e10cSrcweir 
45cdf0e10cSrcweir     utl::TextSearch*    pCommentSearcher;
46cdf0e10cSrcweir     DateTime            aFirstDateTime;
47cdf0e10cSrcweir     DateTime            aLastDateTime;
48cdf0e10cSrcweir     String              aAuthorToShow;
49cdf0e10cSrcweir     String              aComment;
50cdf0e10cSrcweir     ScRangeList         aRangeList;
51cdf0e10cSrcweir     ScChgsDateMode      eDateMode;
52cdf0e10cSrcweir     sal_Bool                bShowIt;
53cdf0e10cSrcweir     sal_Bool                bIsDate;
54cdf0e10cSrcweir     sal_Bool                bIsAuthor;
55cdf0e10cSrcweir     sal_Bool                bIsComment;
56cdf0e10cSrcweir     sal_Bool                bIsRange;
57cdf0e10cSrcweir     sal_Bool                bEveryoneButMe;
58cdf0e10cSrcweir     sal_Bool                bShowAccepted;
59cdf0e10cSrcweir     sal_Bool                bShowRejected;
60cdf0e10cSrcweir     bool                mbIsActionRange;
61cdf0e10cSrcweir     sal_uLong               mnFirstAction;
62cdf0e10cSrcweir     sal_uLong               mnLastAction;
63cdf0e10cSrcweir 
64cdf0e10cSrcweir public:
65cdf0e10cSrcweir 
ScChangeViewSettings()66cdf0e10cSrcweir                         ScChangeViewSettings()
67cdf0e10cSrcweir                         {
68cdf0e10cSrcweir                             pCommentSearcher=NULL;
69cdf0e10cSrcweir                             bIsDate=sal_False;
70cdf0e10cSrcweir                             bIsAuthor=sal_False;
71cdf0e10cSrcweir                             bIsRange=sal_False;
72cdf0e10cSrcweir                             bIsComment=sal_False;
73cdf0e10cSrcweir                             bShowIt=sal_False;
74cdf0e10cSrcweir                             eDateMode=SCDM_DATE_BEFORE;
75cdf0e10cSrcweir                             bEveryoneButMe=sal_False;
76cdf0e10cSrcweir                             bShowAccepted=sal_False;
77cdf0e10cSrcweir                             bShowRejected=sal_False;
78cdf0e10cSrcweir                             mbIsActionRange = false;
79cdf0e10cSrcweir                         }
80cdf0e10cSrcweir 
81cdf0e10cSrcweir                         ScChangeViewSettings( const ScChangeViewSettings& r );
82cdf0e10cSrcweir 
83cdf0e10cSrcweir                         ~ScChangeViewSettings();
84cdf0e10cSrcweir 
ShowChanges() const85cdf0e10cSrcweir     sal_Bool                ShowChanges() const {return bShowIt;}
SetShowChanges(sal_Bool nFlag=sal_True)86cdf0e10cSrcweir     void                SetShowChanges(sal_Bool nFlag=sal_True){bShowIt=nFlag;}
87cdf0e10cSrcweir 
HasDate() const88cdf0e10cSrcweir     sal_Bool                HasDate() const {return bIsDate;}
SetHasDate(sal_Bool nFlag=sal_True)89cdf0e10cSrcweir     void                SetHasDate(sal_Bool nFlag=sal_True) {bIsDate=nFlag;}
90cdf0e10cSrcweir 
SetTheDateMode(ScChgsDateMode eDatMod)91cdf0e10cSrcweir     void                SetTheDateMode(ScChgsDateMode eDatMod){ eDateMode=eDatMod; }
GetTheDateMode() const92cdf0e10cSrcweir     ScChgsDateMode      GetTheDateMode() const { return eDateMode; }
93cdf0e10cSrcweir 
SetTheFirstDateTime(const DateTime & aDateTime)94cdf0e10cSrcweir     void                SetTheFirstDateTime(const DateTime& aDateTime) {aFirstDateTime=aDateTime;}
GetTheFirstDateTime() const95cdf0e10cSrcweir     const DateTime&     GetTheFirstDateTime()const {return aFirstDateTime;}
96cdf0e10cSrcweir 
SetTheLastDateTime(const DateTime & aDateTime)97cdf0e10cSrcweir     void                SetTheLastDateTime(const DateTime& aDateTime) {aLastDateTime=aDateTime;}
GetTheLastDateTime() const98cdf0e10cSrcweir     const DateTime&     GetTheLastDateTime()const {return aLastDateTime;}
99cdf0e10cSrcweir 
100cdf0e10cSrcweir 
HasAuthor() const101cdf0e10cSrcweir     sal_Bool                HasAuthor() const {return bIsAuthor;}
SetHasAuthor(sal_Bool nFlag=sal_True)102cdf0e10cSrcweir     void                SetHasAuthor(sal_Bool nFlag=sal_True) {bIsAuthor=nFlag;}
103cdf0e10cSrcweir 
GetTheAuthorToShow() const104cdf0e10cSrcweir     String              GetTheAuthorToShow()const {return aAuthorToShow;}
SetTheAuthorToShow(const String & aString)105cdf0e10cSrcweir     void                SetTheAuthorToShow(const String& aString){aAuthorToShow=aString;}
106cdf0e10cSrcweir 
HasComment() const107cdf0e10cSrcweir     sal_Bool                HasComment() const {return bIsComment;}
SetHasComment(sal_Bool nFlag=sal_True)108cdf0e10cSrcweir     void                SetHasComment(sal_Bool nFlag=sal_True) {bIsComment=nFlag;}
109cdf0e10cSrcweir 
GetTheComment() const110cdf0e10cSrcweir     String              GetTheComment()const {return aComment;}
111cdf0e10cSrcweir     void                SetTheComment(const String& aString);
112cdf0e10cSrcweir 
113cdf0e10cSrcweir     sal_Bool                IsValidComment(const String* pCommentStr) const;
114cdf0e10cSrcweir 
IsEveryoneButMe() const115cdf0e10cSrcweir     sal_Bool                IsEveryoneButMe() const {return bEveryoneButMe;}
SetEveryoneButMe(sal_Bool nFlag=sal_True)116cdf0e10cSrcweir     void                SetEveryoneButMe(sal_Bool nFlag=sal_True) {bEveryoneButMe=nFlag;}
117cdf0e10cSrcweir 
118cdf0e10cSrcweir 
HasRange() const119cdf0e10cSrcweir     sal_Bool                HasRange() const {return bIsRange;}
SetHasRange(sal_Bool nFlag=sal_True)120cdf0e10cSrcweir     void                SetHasRange(sal_Bool nFlag=sal_True) {bIsRange=nFlag;}
121cdf0e10cSrcweir 
GetTheRangeList() const122cdf0e10cSrcweir     const ScRangeList&  GetTheRangeList()const {return aRangeList;}
SetTheRangeList(const ScRangeList & aRl)123cdf0e10cSrcweir     void                SetTheRangeList(const ScRangeList& aRl){aRangeList=aRl;}
124cdf0e10cSrcweir 
IsShowAccepted() const125cdf0e10cSrcweir     sal_Bool                IsShowAccepted() const { return bShowAccepted; }
SetShowAccepted(sal_Bool bVal)126cdf0e10cSrcweir     void                SetShowAccepted( sal_Bool bVal ) { bShowAccepted = bVal; }
127cdf0e10cSrcweir 
IsShowRejected() const128cdf0e10cSrcweir     sal_Bool                IsShowRejected() const { return bShowRejected; }
SetShowRejected(sal_Bool bVal)129cdf0e10cSrcweir     void                SetShowRejected( sal_Bool bVal ) { bShowRejected = bVal; }
130cdf0e10cSrcweir 
131cdf0e10cSrcweir     ScChangeViewSettings&   operator=   ( const ScChangeViewSettings& r );
132cdf0e10cSrcweir 
133cdf0e10cSrcweir                         /// Adjust dates according to selected DateMode
134cdf0e10cSrcweir     void                AdjustDateMode( const ScDocument& rDoc );
135cdf0e10cSrcweir 
HasActionRange() const136cdf0e10cSrcweir     bool                HasActionRange() const { return mbIsActionRange; }
SetHasActionRange(bool nFlag=true)137cdf0e10cSrcweir     void                SetHasActionRange( bool nFlag = true ) { mbIsActionRange = nFlag; }
GetTheActionRange(sal_uLong & nFirst,sal_uLong & nLast) const138cdf0e10cSrcweir     void                GetTheActionRange( sal_uLong& nFirst, sal_uLong& nLast ) const { nFirst = mnFirstAction; nLast = mnLastAction; }
SetTheActionRange(sal_uLong nFirst,sal_uLong nLast)139cdf0e10cSrcweir     void                SetTheActionRange( sal_uLong nFirst, sal_uLong nLast ) { mnFirstAction = nFirst; mnLastAction = nLast; }
140cdf0e10cSrcweir };
141cdf0e10cSrcweir 
142cdf0e10cSrcweir 
143cdf0e10cSrcweir 
144cdf0e10cSrcweir #endif
145