LOK: tilebench improvements
[LibreOffice.git] / sc / inc / chgviset.hxx
blob2cd86278231df6c4cf2677c5d8df800ada85f1d3
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 INCLUDED_SC_INC_CHGVISET_HXX
20 #define INCLUDED_SC_INC_CHGVISET_HXX
22 #include <memory>
23 #include <tools/datetime.hxx>
24 #include <unotools/textsearch.hxx>
25 #include <svx/ctredlin.hxx>
26 #include "rangelst.hxx"
27 #include "scdllapi.h"
29 class ScDocument;
31 class SC_DLLPUBLIC ScChangeViewSettings
33 private:
35 std::unique_ptr<utl::TextSearch>
36 pCommentSearcher;
37 DateTime aFirstDateTime;
38 DateTime aLastDateTime;
39 OUString aAuthorToShow;
40 OUString aComment;
41 ScRangeList aRangeList;
42 SvxRedlinDateMode eDateMode;
43 bool bShowIt;
44 bool bIsDate;
45 bool bIsAuthor;
46 bool bIsComment;
47 bool bIsRange;
48 bool bShowAccepted;
49 bool bShowRejected;
50 bool mbIsActionRange;
51 sal_uLong mnFirstAction;
52 sal_uLong mnLastAction;
54 public:
56 ScChangeViewSettings()
57 : pCommentSearcher(nullptr)
58 , aFirstDateTime(DateTime::EMPTY)
59 , aLastDateTime(DateTime::EMPTY)
60 , eDateMode(SvxRedlinDateMode::BEFORE)
61 , bShowIt(false)
62 , bIsDate(false)
63 , bIsAuthor(false)
64 , bIsComment(false)
65 , bIsRange(false)
66 , bShowAccepted(false)
67 , bShowRejected(false)
68 , mbIsActionRange(false)
69 , mnFirstAction(0)
70 , mnLastAction(0)
74 ScChangeViewSettings( const ScChangeViewSettings& r );
76 ~ScChangeViewSettings();
78 bool ShowChanges() const {return bShowIt;}
79 void SetShowChanges(bool bFlag) {bShowIt=bFlag;}
81 bool HasDate() const {return bIsDate;}
82 void SetHasDate(bool bFlag) {bIsDate=bFlag;}
84 void SetTheDateMode(SvxRedlinDateMode eDatMod){ eDateMode=eDatMod; }
85 SvxRedlinDateMode GetTheDateMode() const { return eDateMode; }
87 void SetTheFirstDateTime(const DateTime& aDateTime) {aFirstDateTime=aDateTime;}
88 const DateTime& GetTheFirstDateTime()const {return aFirstDateTime;}
90 void SetTheLastDateTime(const DateTime& aDateTime) {aLastDateTime=aDateTime;}
91 const DateTime& GetTheLastDateTime()const {return aLastDateTime;}
93 bool HasAuthor() const {return bIsAuthor;}
94 void SetHasAuthor(bool bFlag) {bIsAuthor=bFlag;}
96 const OUString& GetTheAuthorToShow()const {return aAuthorToShow;}
97 void SetTheAuthorToShow(const OUString& aString){aAuthorToShow=aString;}
99 bool HasComment() const {return bIsComment;}
100 void SetHasComment(bool bFlag) {bIsComment=bFlag;}
102 const OUString& GetTheComment()const {return aComment;}
103 void SetTheComment(const OUString& aString);
105 bool IsValidComment(const OUString* pCommentStr) const;
107 bool HasRange() const {return bIsRange;}
108 void SetHasRange(bool bFlag) {bIsRange=bFlag;}
110 const ScRangeList& GetTheRangeList()const {return aRangeList;}
111 void SetTheRangeList(const ScRangeList& aRl){aRangeList=aRl;}
113 bool IsShowAccepted() const { return bShowAccepted; }
114 void SetShowAccepted( bool bVal ) { bShowAccepted = bVal; }
116 bool IsShowRejected() const { return bShowRejected; }
117 void SetShowRejected( bool bVal ) { bShowRejected = bVal; }
119 ScChangeViewSettings& operator= ( const ScChangeViewSettings& r );
121 /// Adjust dates according to selected DateMode
122 void AdjustDateMode( const ScDocument& rDoc );
124 bool HasActionRange() const { return mbIsActionRange; }
125 void SetHasActionRange() { mbIsActionRange = true; }
126 void GetTheActionRange( sal_uLong& nFirst, sal_uLong& nLast ) const { nFirst = mnFirstAction; nLast = mnLastAction; }
127 void SetTheActionRange( sal_uLong nFirst, sal_uLong nLast ) { mnFirstAction = nFirst; mnLastAction = nLast; }
130 #endif
132 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */