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

Generated by: LCOV version 1.10