LCOV - code coverage report
Current view: top level - sc/inc - chgviset.hxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 4 33 12.1 %
Date: 2014-11-03 Functions: 2 31 6.5 %
Legend: Lines: hit not hit

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

Generated by: LCOV version 1.10