LCOV - code coverage report
Current view: top level - include/svx - ctredlin.hxx (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 0 11 0.0 %
Date: 2014-04-11 Functions: 0 12 0.0 %
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             : 
      20             : #ifndef INCLUDED_SVX_CTREDLIN_HXX
      21             : #define INCLUDED_SVX_CTREDLIN_HXX
      22             : 
      23             : #include <svtools/headbar.hxx>
      24             : #include <svtools/simptabl.hxx>
      25             : #include <svtools/svlbitm.hxx>
      26             : #include <svtools/svtabbx.hxx>
      27             : #include <svtools/treelistentry.hxx>
      28             : #include <tools/datetime.hxx>
      29             : #include <vcl/combobox.hxx>
      30             : #include <vcl/field.hxx>
      31             : #include <vcl/fixed.hxx>
      32             : #include <vcl/lstbox.hxx>
      33             : #include <vcl/tabpage.hxx>
      34             : #include <vcl/tabctrl.hxx>
      35             : #include <unotools/textsearch.hxx>
      36             : #include <svx/svxdllapi.h>
      37             : 
      38             : #define FLT_DATE_BEFORE     0
      39             : #define FLT_DATE_SINCE      1
      40             : #define FLT_DATE_EQUAL      2
      41             : #define FLT_DATE_NOTEQUAL   3
      42             : #define FLT_DATE_BETWEEN    4
      43             : #define FLT_DATE_SAVE       5
      44             : 
      45             : 
      46             : //  Struct for sorting data
      47             : 
      48             : class SVX_DLLPUBLIC RedlinData
      49             : {
      50             : public:
      51             :                     RedlinData();
      52             :     virtual         ~RedlinData();
      53             :     bool            bDisabled;
      54             :     DateTime        aDateTime;
      55             :     void*           pData;
      56             : };
      57             : 
      58             : class SvxRedlinEntry : public SvTreeListEntry
      59             : {
      60             : public:
      61             :                     SvxRedlinEntry();
      62             :         virtual     ~SvxRedlinEntry();
      63             : };
      64             : 
      65             : // Class for the representation of Strings depending on the font
      66             : class SvLBoxColorString : public SvLBoxString
      67             : {
      68             : private:
      69             : 
      70             :     Color           aPrivColor;
      71             : 
      72             : public:
      73             :                     SvLBoxColorString( SvTreeListEntry*, sal_uInt16 nFlags, const OUString& rStr,
      74             :                                     const Color& rCol);
      75             :                     SvLBoxColorString();
      76             :                     virtual ~SvLBoxColorString();
      77             : 
      78             :     virtual void Paint(
      79             :         const Point& rPos, SvTreeListBox& rOutDev, const SvViewDataEntry* pView, const SvTreeListEntry* pEntry) SAL_OVERRIDE;
      80             : 
      81             :     SvLBoxItem*     Create() const SAL_OVERRIDE;
      82             : };
      83             : 
      84             : class SVX_DLLPUBLIC SvxRedlinTable : public SvSimpleTable
      85             : {
      86             :     using SvTabListBox::InsertEntry;
      87             : 
      88             : private:
      89             : 
      90             :     bool            bIsCalc;
      91             :     sal_uInt16      nDatePos;
      92             :     bool            bAuthor;
      93             :     bool            bDate;
      94             :     bool            bComment;
      95             :     sal_uInt16      nDaTiMode;
      96             :     DateTime        aDaTiFirst;
      97             :     DateTime        aDaTiLast;
      98             :     DateTime        aDaTiFilterFirst;
      99             :     DateTime        aDaTiFilterLast;
     100             :     OUString        aAuthor;
     101             :     Color           aEntryColor;
     102             :     OUString        aCurEntry;
     103             :     utl::TextSearch* pCommentSearcher;
     104             :     Link            aColCompareLink;
     105             : 
     106             : protected:
     107             : 
     108             :     virtual sal_Int32       ColCompare(SvTreeListEntry*,SvTreeListEntry*) SAL_OVERRIDE;
     109             :     virtual void            InitEntry(SvTreeListEntry*, const OUString&, const Image&, const Image&, SvLBoxButtonKind) SAL_OVERRIDE;
     110             : 
     111             : 
     112             : 
     113             : public:
     114             : 
     115             :     SvxRedlinTable(SvSimpleTableContainer& rParent, WinBits nBits = WB_BORDER);
     116             :     virtual ~SvxRedlinTable();
     117             : 
     118             :     // For FilterPage only {
     119             :     void            SetFilterDate(bool bFlag=true);
     120             :     void            SetDateTimeMode(sal_uInt16 nMode);
     121             :     void            SetFirstDate(const Date&);
     122             :     void            SetLastDate(const Date&);
     123             :     void            SetFirstTime(const Time&);
     124             :     void            SetLastTime(const Time&);
     125             :     void            SetFilterAuthor(bool bFlag=true);
     126             :     void            SetAuthor(const OUString &);
     127             :     void            SetFilterComment(bool bFlag=true);
     128             :     void            SetCommentParams( const utl::SearchParam* pSearchPara );
     129             : 
     130             :     void            UpdateFilterTest();
     131             :     // } For FilterPage only
     132             : 
     133             :     void            SetCalcView(bool bFlag=true);
     134             : 
     135             :     bool            IsValidEntry(const OUString &rAuthor, const DateTime &rDateTime, const OUString &rComment);
     136             :     bool            IsValidEntry(const OUString &rAuthor, const DateTime &rDateTime);
     137             :     bool            IsValidComment(const OUString &rComment);
     138             : 
     139             :     SvTreeListEntry*    InsertEntry(const OUString& ,RedlinData *pUserData,
     140             :                                 SvTreeListEntry* pParent=NULL,sal_uIntPtr nPos=TREELIST_APPEND);
     141             : 
     142             :     SvTreeListEntry*    InsertEntry(const OUString& ,RedlinData *pUserData,const Color&,
     143             :                                 SvTreeListEntry* pParent=NULL,sal_uIntPtr nPos=TREELIST_APPEND);
     144             : 
     145             : 
     146             :     virtual SvTreeListEntry* CreateEntry() const SAL_OVERRIDE;
     147             : 
     148           0 :     void            SetColCompareHdl(const Link& rLink ) { aColCompareLink = rLink; }
     149             :     const Link&     GetColCompareHdl() const { return aColCompareLink; }
     150             : 
     151             : 
     152             : };
     153             : 
     154             : 
     155             : //  Filter- Tabpage
     156             : 
     157           0 : class SVX_DLLPUBLIC SvxTPFilter: public TabPage
     158             : {
     159             : private:
     160             : 
     161             :     Link            aReadyLink;
     162             :     Link            aModifyLink;
     163             :     Link            aModifyDateLink;
     164             :     Link            aModifyAuthorLink;
     165             :     Link            aModifyRefLink;
     166             :     Link            aRefLink;
     167             :     Link            aModifyComLink;
     168             : 
     169             :     SvxRedlinTable* pRedlinTable;
     170             :     CheckBox*       m_pCbDate;
     171             :     ListBox*        m_pLbDate;
     172             :     DateField*      m_pDfDate;
     173             :     TimeField*      m_pTfDate;
     174             :     PushButton*     m_pIbClock;
     175             :     FixedText*      m_pFtDate2;
     176             :     DateField*      m_pDfDate2;
     177             :     TimeField*      m_pTfDate2;
     178             :     PushButton*     m_pIbClock2;
     179             :     CheckBox*       m_pCbAuthor;
     180             :     ListBox*        m_pLbAuthor;
     181             :     CheckBox*       m_pCbRange;
     182             :     Edit*           m_pEdRange;
     183             :     PushButton*     m_pBtnRange;
     184             :     CheckBox*       m_pCbAction;
     185             :     ListBox*        m_pLbAction;
     186             :     CheckBox*       m_pCbComment;
     187             :     Edit*           m_pEdComment;
     188             :     bool            bModified;
     189             : 
     190             :     DECL_LINK( SelDateHdl, ListBox* );
     191             :     DECL_LINK( RowEnableHdl, CheckBox* );
     192             :     DECL_LINK( TimeHdl, ImageButton* );
     193             :     DECL_LINK( ModifyHdl, void* );
     194             :     DECL_LINK( ModifyDate, void* );
     195             :     DECL_LINK( RefHandle, PushButton* );
     196             : 
     197             : 
     198             : protected:
     199             : 
     200             :     void            ShowDateFields(sal_uInt16 nKind);
     201             :     void            EnableDateLine1(bool bFlag);
     202             :     void            EnableDateLine2(bool bFlag);
     203             : 
     204             : public:
     205             :                     SvxTPFilter( Window * pParent);
     206             : 
     207             :     virtual void    DeactivatePage() SAL_OVERRIDE;
     208             :     void            SetRedlinTable(SvxRedlinTable*);
     209             : 
     210             :     Date            GetFirstDate() const;
     211             :     void            SetFirstDate(const Date &aDate);
     212             :     Time            GetFirstTime() const;
     213             :     void            SetFirstTime(const Time &aTime);
     214             : 
     215             :     Date            GetLastDate() const;
     216             :     void            SetLastDate(const Date &aDate);
     217             :     Time            GetLastTime() const;
     218             :     void            SetLastTime(const Time &aTime);
     219             : 
     220             :     void            SetDateMode(sal_uInt16 nMode);
     221             :     sal_uInt16          GetDateMode();
     222             : 
     223             :     void            ClearAuthors();
     224             :     void            InsertAuthor( const OUString& rString, sal_Int32  nPos = LISTBOX_APPEND );
     225             :     OUString        GetSelectedAuthor()const;
     226             :     void            SelectedAuthorPos(sal_Int32  nPos);
     227             :     sal_Int32       SelectAuthor(const OUString& aString);
     228             :     void            SetComment(const OUString& rComment);
     229             :     OUString        GetComment()const;
     230             : 
     231             : 
     232             :     // Methods for Calc {
     233             :     void            SetRange(const OUString& rString);
     234             :     OUString        GetRange() const;
     235             :     void            HideRange(bool bHide=true);
     236             :     void            SetFocusToRange();
     237             :     // } Methods for Calc
     238             : 
     239             :     void            DisableRef(bool bFlag);
     240             : 
     241             :     bool            IsDate();
     242             :     bool            IsAuthor();
     243             :     bool            IsRange();
     244             :     bool            IsAction();
     245             :     bool            IsComment();
     246             : 
     247             :     void            ShowAction(bool bShow=true);
     248             : 
     249             :     void            CheckDate(bool bFlag=true);
     250             :     void            CheckAuthor(bool bFlag=true);
     251             :     void            CheckRange(bool bFlag=true);
     252             :     void            CheckAction(bool bFlag=true);
     253             :     void            CheckComment(bool bFlag=true);
     254             : 
     255             :     ListBox*        GetLbAction();
     256             : 
     257           0 :     void            SetReadyHdl( const Link& rLink ) { aReadyLink= rLink; }
     258             :     const Link&     GetReadyHdl() const { return aReadyLink; }
     259             : 
     260           0 :     void            SetModifyHdl( const Link& rLink ) { aModifyLink = rLink; }
     261             :     const Link&     GetModifyHdl() const { return aModifyLink; }
     262             : 
     263             :     void            SetModifyDateHdl( const Link& rLink ) { aModifyDateLink = rLink; }
     264             :     const Link&     GetModifyDateHdl() const { return aModifyDateLink; }
     265             : 
     266             :     void            SetModifyAuthorHdl( const Link& rLink ) { aModifyAuthorLink = rLink; }
     267             :     const Link&     GetModifyAuthorHdl() const { return aModifyAuthorLink; }
     268             : 
     269             :     void            SetModifyCommentHdl(const Link& rLink ) { aModifyComLink = rLink; }
     270             :     const Link&     GetModifyCommentHdl() const { return aModifyComLink; }
     271             : 
     272             : 
     273             :     // Methods for Calc {
     274             :     void            SetModifyRangeHdl( const Link& rLink ) { aModifyRefLink = rLink; }
     275             :     const Link&     GetModifyRangeHdl() const { return aModifyRefLink; }
     276             : 
     277           0 :     void            SetRefHdl( const Link& rLink ) { aRefLink = rLink; }
     278             :     const Link&     GetRefHdl() const { return aRefLink; }
     279             : 
     280             :     void            Enable( bool bEnable = true, bool bChild = true );
     281             :     void            Disable( bool bChild = true );
     282             : 
     283             :     // } Methods for Calc
     284             : };
     285             : 
     286             : 
     287             : 
     288             : //  View- Tabpage
     289             : 
     290             : 
     291             : class SVX_DLLPUBLIC SvxTPView: public TabPage
     292             : {
     293             : private:
     294             : 
     295             :     Link            AcceptClickLk;
     296             :     Link            AcceptAllClickLk;
     297             :     Link            RejectClickLk;
     298             :     Link            RejectAllClickLk;
     299             :     Link            UndoClickLk;
     300             : 
     301             :     SvxRedlinTable* m_pViewData;
     302             :     PushButton*     m_pAccept;
     303             :     PushButton*     m_pReject;
     304             :     PushButton*     m_pAcceptAll;
     305             :     PushButton*     m_pRejectAll;
     306             :     PushButton*     m_pUndo;
     307             : 
     308             :     bool bEnableAccept;
     309             :     bool bEnableAcceptAll;
     310             :     bool bEnableReject;
     311             :     bool bEnableRejectAll;
     312             :     bool bEnableUndo;
     313             : 
     314             :     DECL_LINK( PbClickHdl, PushButton* );
     315             : 
     316             : public:
     317             :     SvxTPView(Window * pParent);
     318             :     virtual ~SvxTPView();
     319             : 
     320             :     void            InsertWriterHeader();
     321             :     void            InsertCalcHeader();
     322             :     SvxRedlinTable* GetTableControl();
     323             : 
     324             :     void            EnableAccept(bool nFlag=true);
     325             :     void            EnableAcceptAll(bool nFlag=true);
     326             :     void            EnableReject(bool nFlag=true);
     327             :     void            EnableRejectAll(bool nFlag=true);
     328             :     void            EnableUndo(bool nFlag=true);
     329             : 
     330             :     void            DisableAccept()     {EnableAccept(false);}
     331             :     void            DisableAcceptAll()  {EnableAcceptAll(false);}
     332             :     void            DisableReject()     {EnableReject(false);}
     333             :     void            DisableRejectAll()  {EnableRejectAll(false);}
     334           0 :     void            DisableUndo()       {EnableUndo(false);}
     335             : 
     336             :     void            ShowUndo(bool nFlag=true);
     337             :     void            HideUndo()          {ShowUndo(false);}
     338             :     bool            IsUndoVisible();
     339             : 
     340           0 :     void            SetAcceptClickHdl( const Link& rLink ) { AcceptClickLk = rLink; }
     341             :     const Link&     GetAcceptClickHdl() const { return AcceptClickLk; }
     342             : 
     343           0 :     void            SetAcceptAllClickHdl( const Link& rLink ) { AcceptAllClickLk = rLink; }
     344             :     const Link&     GetAcceptAllClickHdl() const { return AcceptAllClickLk; }
     345             : 
     346           0 :     void            SetRejectClickHdl( const Link& rLink ) { RejectClickLk = rLink; }
     347             :     const Link&     GetRejectClickHdl() const { return RejectClickLk; }
     348             : 
     349           0 :     void            SetRejectAllClickHdl( const Link& rLink ) { RejectAllClickLk = rLink; }
     350             :     const Link&     GetRejectAllClickHdl() const { return RejectAllClickLk; }
     351             : 
     352           0 :     void            SetUndoClickHdl( const Link& rLink ) { UndoClickLk = rLink; }
     353             :     const Link&     GetUndoAllClickHdl() const { return UndoClickLk; }
     354             : 
     355             :     virtual void    ActivatePage() SAL_OVERRIDE;
     356             :     virtual void    DeactivatePage() SAL_OVERRIDE;
     357             : };
     358             : 
     359             : 
     360             : //  Redlining - Control (Accept- Changes)
     361             : 
     362             : 
     363             : class SVX_DLLPUBLIC SvxAcceptChgCtr
     364             :     : public TabControl
     365             :     , public VclBuilderContainer
     366             : {
     367             : private:
     368             : 
     369             :     SvxTPFilter*    pTPFilter;
     370             :     SvxTPView*      pTPView;
     371             : 
     372             :     sal_uInt16      m_nViewPageId;
     373             :     sal_uInt16      m_nFilterPageId;
     374             : 
     375             : public:
     376             :                     SvxAcceptChgCtr(Window* pParent);
     377             : 
     378             :                     virtual ~SvxAcceptChgCtr();
     379             : 
     380             :     void            ShowFilterPage();
     381             :     void            ShowViewPage();
     382             : 
     383             :     SvxTPFilter*    GetFilterPage();
     384             :     SvxTPView*      GetViewPage();
     385             :     SvxRedlinTable* GetViewTable();
     386             : };
     387             : 
     388             : 
     389             : #endif // INCLUDED_SVX_CTREDLIN_HXX
     390             : 
     391             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10