Line data Source code
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 <tools/datetime.hxx>
23 : #include <svx/ctredlin.hxx>
24 : #include "rangelst.hxx"
25 : #include "scdllapi.h"
26 :
27 : namespace utl {
28 : class TextSearch;
29 : }
30 :
31 : class ScDocument;
32 :
33 : class SC_DLLPUBLIC ScChangeViewSettings
34 : {
35 : private:
36 :
37 : utl::TextSearch* pCommentSearcher;
38 : DateTime aFirstDateTime;
39 : DateTime aLastDateTime;
40 : OUString aAuthorToShow;
41 : OUString aComment;
42 : ScRangeList aRangeList;
43 : SvxRedlinDateMode eDateMode;
44 : bool bShowIt;
45 : bool bIsDate;
46 : bool bIsAuthor;
47 : bool bIsComment;
48 : bool bIsRange;
49 : bool bEveryoneButMe;
50 : bool bShowAccepted;
51 : bool bShowRejected;
52 : bool mbIsActionRange;
53 : sal_uLong mnFirstAction;
54 : sal_uLong mnLastAction;
55 :
56 : public:
57 :
58 16 : ScChangeViewSettings()
59 : : pCommentSearcher(NULL)
60 : , aFirstDateTime(DateTime::EMPTY)
61 : , aLastDateTime(DateTime::EMPTY)
62 : , eDateMode(SvxRedlinDateMode::BEFORE)
63 : , bShowIt(false)
64 : , bIsDate(false)
65 : , bIsAuthor(false)
66 : , bIsComment(false)
67 : , bIsRange(false)
68 : , bEveryoneButMe(false)
69 : , bShowAccepted(false)
70 : , bShowRejected(false)
71 : , mbIsActionRange(false)
72 : , mnFirstAction(0)
73 16 : , mnLastAction(0)
74 : {
75 16 : }
76 :
77 : ScChangeViewSettings( const ScChangeViewSettings& r );
78 :
79 : ~ScChangeViewSettings();
80 :
81 0 : bool ShowChanges() const {return bShowIt;}
82 8 : void SetShowChanges(bool nFlag) {bShowIt=nFlag;}
83 :
84 0 : bool HasDate() const {return bIsDate;}
85 1 : void SetHasDate(bool nFlag) {bIsDate=nFlag;}
86 :
87 1 : void SetTheDateMode(SvxRedlinDateMode eDatMod){ eDateMode=eDatMod; }
88 0 : SvxRedlinDateMode GetTheDateMode() const { return eDateMode; }
89 :
90 1 : void SetTheFirstDateTime(const DateTime& aDateTime) {aFirstDateTime=aDateTime;}
91 0 : const DateTime& GetTheFirstDateTime()const {return aFirstDateTime;}
92 :
93 1 : void SetTheLastDateTime(const DateTime& aDateTime) {aLastDateTime=aDateTime;}
94 0 : const DateTime& GetTheLastDateTime()const {return aLastDateTime;}
95 :
96 0 : bool HasAuthor() const {return bIsAuthor;}
97 1 : void SetHasAuthor(bool nFlag) {bIsAuthor=nFlag;}
98 :
99 0 : OUString GetTheAuthorToShow()const {return aAuthorToShow;}
100 1 : void SetTheAuthorToShow(const OUString& aString){aAuthorToShow=aString;}
101 :
102 0 : bool HasComment() const {return bIsComment;}
103 1 : void SetHasComment(bool nFlag) {bIsComment=nFlag;}
104 :
105 0 : OUString GetTheComment()const {return aComment;}
106 : void SetTheComment(const OUString& aString);
107 :
108 : bool IsValidComment(const OUString* pCommentStr) const;
109 :
110 0 : bool IsEveryoneButMe() const {return bEveryoneButMe;}
111 : void SetEveryoneButMe(bool nFlag) {bEveryoneButMe=nFlag;}
112 :
113 0 : bool HasRange() const {return bIsRange;}
114 1 : void SetHasRange(bool nFlag) {bIsRange=nFlag;}
115 :
116 0 : const ScRangeList& GetTheRangeList()const {return aRangeList;}
117 0 : void SetTheRangeList(const ScRangeList& aRl){aRangeList=aRl;}
118 :
119 0 : bool IsShowAccepted() const { return bShowAccepted; }
120 1 : void SetShowAccepted( bool bVal ) { bShowAccepted = bVal; }
121 :
122 0 : bool IsShowRejected() const { return bShowRejected; }
123 1 : void SetShowRejected( bool bVal ) { bShowRejected = bVal; }
124 :
125 : ScChangeViewSettings& operator= ( const ScChangeViewSettings& r );
126 :
127 : /// Adjust dates according to selected DateMode
128 : void AdjustDateMode( const ScDocument& rDoc );
129 :
130 0 : bool HasActionRange() const { return mbIsActionRange; }
131 0 : void SetHasActionRange( bool nFlag = true ) { mbIsActionRange = nFlag; }
132 0 : void GetTheActionRange( sal_uLong& nFirst, sal_uLong& nLast ) const { nFirst = mnFirstAction; nLast = mnLastAction; }
133 0 : void SetTheActionRange( sal_uLong nFirst, sal_uLong nLast ) { mnFirstAction = nFirst; mnLastAction = nLast; }
134 : };
135 :
136 : #endif
137 :
138 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|