LibreOffice Module sc (master)  1
chgviset.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 #ifndef INCLUDED_SC_INC_CHGVISET_HXX
20 #define INCLUDED_SC_INC_CHGVISET_HXX
21 
22 #include <memory>
23 #include <tools/datetime.hxx>
24 #include <tools/solar.h>
25 #include <unotools/textsearch.hxx>
26 #include <svx/ctredlin.hxx>
27 #include "rangelst.hxx"
28 #include "scdllapi.h"
29 
30 class ScDocument;
31 
33 {
34 private:
35 
36  std::unique_ptr<utl::TextSearch>
40  OUString aAuthorToShow;
41  OUString aComment;
44  bool bShowIt;
45  bool bIsDate;
46  bool bIsAuthor;
47  bool bIsComment;
48  bool bIsRange;
54 
55 public:
56 
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)
71  {
72  }
73 
75 
77 
78  bool ShowChanges() const {return bShowIt;}
79  void SetShowChanges(bool bFlag) {bShowIt=bFlag;}
80 
81  bool HasDate() const {return bIsDate;}
82  void SetHasDate(bool bFlag) {bIsDate=bFlag;}
83 
84  void SetTheDateMode(SvxRedlinDateMode eDatMod){ eDateMode=eDatMod; }
85  SvxRedlinDateMode GetTheDateMode() const { return eDateMode; }
86 
87  void SetTheFirstDateTime(const DateTime& aDateTime) {aFirstDateTime=aDateTime;}
88  const DateTime& GetTheFirstDateTime()const {return aFirstDateTime;}
89 
90  void SetTheLastDateTime(const DateTime& aDateTime) {aLastDateTime=aDateTime;}
91  const DateTime& GetTheLastDateTime()const {return aLastDateTime;}
92 
93  bool HasAuthor() const {return bIsAuthor;}
94  void SetHasAuthor(bool bFlag) {bIsAuthor=bFlag;}
95 
96  const OUString& GetTheAuthorToShow()const {return aAuthorToShow;}
97  void SetTheAuthorToShow(const OUString& aString){aAuthorToShow=aString;}
98 
99  bool HasComment() const {return bIsComment;}
100  void SetHasComment(bool bFlag) {bIsComment=bFlag;}
101 
102  const OUString& GetTheComment()const {return aComment;}
103  void SetTheComment(const OUString& aString);
104 
105  bool IsValidComment(const OUString* pCommentStr) const;
106 
107  bool HasRange() const {return bIsRange;}
108  void SetHasRange(bool bFlag) {bIsRange=bFlag;}
109 
110  const ScRangeList& GetTheRangeList()const {return aRangeList;}
111  void SetTheRangeList(const ScRangeList& aRl){aRangeList=aRl;}
112 
113  bool IsShowAccepted() const { return bShowAccepted; }
114  void SetShowAccepted( bool bVal ) { bShowAccepted = bVal; }
115 
116  bool IsShowRejected() const { return bShowRejected; }
117  void SetShowRejected( bool bVal ) { bShowRejected = bVal; }
118 
119  ScChangeViewSettings& operator= ( const ScChangeViewSettings& r );
120 
122  void AdjustDateMode( const ScDocument& rDoc );
123 
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; }
128 };
129 
130 #endif
131 
132 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_uLong mnFirstAction
Definition: chgviset.hxx:52
ScRangeList aRangeList
Definition: chgviset.hxx:42
bool HasComment() const
Definition: chgviset.hxx:99
void SetTheFirstDateTime(const DateTime &aDateTime)
Definition: chgviset.hxx:87
void SetShowRejected(bool bVal)
Definition: chgviset.hxx:117
void GetTheActionRange(sal_uLong &nFirst, sal_uLong &nLast) const
Definition: chgviset.hxx:126
sal_uIntPtr sal_uLong
bool IsShowRejected() const
Definition: chgviset.hxx:116
void SetTheAuthorToShow(const OUString &aString)
Definition: chgviset.hxx:97
DateTime aLastDateTime
Definition: chgviset.hxx:39
bool ShowChanges() const
Definition: chgviset.hxx:78
SvxRedlinDateMode GetTheDateMode() const
Definition: chgviset.hxx:85
void SetTheDateMode(SvxRedlinDateMode eDatMod)
Definition: chgviset.hxx:84
OUString aAuthorToShow
Definition: chgviset.hxx:40
void SetHasDate(bool bFlag)
Definition: chgviset.hxx:82
void SetTheActionRange(sal_uLong nFirst, sal_uLong nLast)
Definition: chgviset.hxx:127
sal_uLong mnLastAction
Definition: chgviset.hxx:53
void SetTheRangeList(const ScRangeList &aRl)
Definition: chgviset.hxx:111
const ScRangeList & GetTheRangeList() const
Definition: chgviset.hxx:110
bool HasDate() const
Definition: chgviset.hxx:81
bool HasRange() const
Definition: chgviset.hxx:107
const OUString & GetTheAuthorToShow() const
Definition: chgviset.hxx:96
void SetHasComment(bool bFlag)
Definition: chgviset.hxx:100
bool HasActionRange() const
Definition: chgviset.hxx:124
void SetShowAccepted(bool bVal)
Definition: chgviset.hxx:114
SvxRedlinDateMode
const DateTime & GetTheLastDateTime() const
Definition: chgviset.hxx:91
void SetHasRange(bool bFlag)
Definition: chgviset.hxx:108
bool HasAuthor() const
Definition: chgviset.hxx:93
const OUString & GetTheComment() const
Definition: chgviset.hxx:102
std::unique_ptr< utl::TextSearch > pCommentSearcher
Definition: chgviset.hxx:37
const DateTime & GetTheFirstDateTime() const
Definition: chgviset.hxx:88
DateTime aFirstDateTime
Definition: chgviset.hxx:38
void SetHasAuthor(bool bFlag)
Definition: chgviset.hxx:94
void SetTheLastDateTime(const DateTime &aDateTime)
Definition: chgviset.hxx:90
SvxRedlinDateMode eDateMode
Definition: chgviset.hxx:43
#define SC_DLLPUBLIC
Definition: scdllapi.h:28
bool IsShowAccepted() const
Definition: chgviset.hxx:113
void SetShowChanges(bool bFlag)
Definition: chgviset.hxx:79