LCOV - code coverage report
Current view: top level - usr/local/src/libreoffice/sc/source/ui/inc - conflictsdlg.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 1 0.0 %
Date: 2013-07-09 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 SC_CONFLICTSDLG_HXX
      21             : #define SC_CONFLICTSDLG_HXX
      22             : 
      23             : #include <vcl/button.hxx>
      24             : #include <vcl/dialog.hxx>
      25             : #include <vcl/fixed.hxx>
      26             : #include <vcl/lstbox.hxx>
      27             : #include <svx/ctredlin.hxx>
      28             : 
      29             : #include "chgtrack.hxx"
      30             : #include "docsh.hxx"
      31             : 
      32             : class ScViewData;
      33             : 
      34             : 
      35             : //=============================================================================
      36             : 
      37             : enum ScConflictAction
      38             : {
      39             :     SC_CONFLICT_ACTION_NONE,
      40             :     SC_CONFLICT_ACTION_KEEP_MINE,
      41             :     SC_CONFLICT_ACTION_KEEP_OTHER
      42             : };
      43             : 
      44             : typedef ::std::vector< sal_uLong > ScChangeActionList;
      45             : 
      46             : 
      47             : //=============================================================================
      48             : // struct ScConflictsListEntry
      49             : //=============================================================================
      50             : 
      51           0 : struct ScConflictsListEntry
      52             : {
      53             :     ScConflictAction    meConflictAction;
      54             :     ScChangeActionList  maSharedActions;
      55             :     ScChangeActionList  maOwnActions;
      56             : 
      57             :     bool                HasSharedAction( sal_uLong nSharedAction ) const;
      58             :     bool                HasOwnAction( sal_uLong nOwnAction ) const;
      59             : };
      60             : 
      61             : 
      62             : //=============================================================================
      63             : 
      64             : typedef ::std::vector< ScConflictsListEntry > ScConflictsList;
      65             : 
      66             : 
      67             : //=============================================================================
      68             : // class ScConflictsListHelper
      69             : //=============================================================================
      70             : 
      71             : class ScConflictsListHelper
      72             : {
      73             : private:
      74             :     static void                     Transform_Impl( ScChangeActionList& rActionList, ScChangeActionMergeMap* pMergeMap );
      75             : 
      76             : public:
      77             :     static bool                     HasOwnAction( ScConflictsList& rConflictsList, sal_uLong nOwnAction );
      78             : 
      79             :     static ScConflictsListEntry*    GetSharedActionEntry( ScConflictsList& rConflictsList, sal_uLong nSharedAction );
      80             :     static ScConflictsListEntry*    GetOwnActionEntry( ScConflictsList& rConflictsList, sal_uLong nOwnAction );
      81             : 
      82             :     static void                     TransformConflictsList( ScConflictsList& rConflictsList,
      83             :                                         ScChangeActionMergeMap* pSharedMap, ScChangeActionMergeMap* pOwnMap );
      84             : };
      85             : 
      86             : 
      87             : //=============================================================================
      88             : // class ScConflictsFinder
      89             : //=============================================================================
      90             : 
      91             : class ScConflictsFinder
      92             : {
      93             : private:
      94             :     ScChangeTrack*          mpTrack;
      95             :     sal_uLong                   mnStartShared;
      96             :     sal_uLong                   mnEndShared;
      97             :     sal_uLong                   mnStartOwn;
      98             :     sal_uLong                   mnEndOwn;
      99             :     ScConflictsList&        mrConflictsList;
     100             : 
     101             :     static bool             DoActionsIntersect( const ScChangeAction* pAction1, const ScChangeAction* pAction2 );
     102             :     ScConflictsListEntry*   GetIntersectingEntry( const ScChangeAction* pAction ) const;
     103             :     ScConflictsListEntry*   GetEntry( sal_uLong nSharedAction, const ScChangeActionList& rOwnActions );
     104             : 
     105             : public:
     106             :                             ScConflictsFinder( ScChangeTrack* pTrack, sal_uLong nStartShared, sal_uLong nEndShared,
     107             :                                 sal_uLong nStartOwn, sal_uLong nEndOwn, ScConflictsList& rConflictsList );
     108             :     virtual                 ~ScConflictsFinder();
     109             : 
     110             :     bool                    Find();
     111             : };
     112             : 
     113             : 
     114             : //=============================================================================
     115             : // class ScConflictsResolver
     116             : //=============================================================================
     117             : 
     118             : class ScConflictsResolver
     119             : {
     120             : private:
     121             :     ScChangeTrack*      mpTrack;
     122             :     ScConflictsList&    mrConflictsList;
     123             : 
     124             : public:
     125             :                         ScConflictsResolver( ScChangeTrack* pTrack, ScConflictsList& rConflictsList );
     126             :     virtual             ~ScConflictsResolver();
     127             : 
     128             :     void                HandleAction( ScChangeAction* pAction, bool bIsSharedAction,
     129             :                             bool bHandleContentAction, bool bHandleNonContentAction );
     130             : };
     131             : 
     132             : 
     133             : //=============================================================================
     134             : // class ScConflictsDlg
     135             : //=============================================================================
     136             : 
     137             : class ScConflictsDlg : public ModalDialog
     138             : {
     139             : private:
     140             :     FixedText           maFtConflicts;
     141             :     SvxSimpleTableContainer m_aLbConflictsContainer;
     142             :     SvxRedlinTable      maLbConflicts;
     143             :     PushButton          maBtnKeepMine;
     144             :     PushButton          maBtnKeepOther;
     145             :     FixedLine           maFlConflicts;
     146             :     PushButton          maBtnKeepAllMine;
     147             :     PushButton          maBtnKeepAllOthers;
     148             :     CancelButton        maBtnCancel;
     149             :     HelpButton          maBtnHelp;
     150             : 
     151             :     String              maStrTitleConflict;
     152             :     String              maStrTitleAuthor;
     153             :     String              maStrTitleDate;
     154             :     String              maStrUnknownUser;
     155             : 
     156             :     ScViewData*         mpViewData;
     157             :     ScDocument*         mpOwnDoc;
     158             :     ScChangeTrack*      mpOwnTrack;
     159             :     ScDocument*         mpSharedDoc;
     160             :     ScChangeTrack*      mpSharedTrack;
     161             :     ScConflictsList&    mrConflictsList;
     162             :     Size                maDialogSize;
     163             : 
     164             :     Timer               maSelectionTimer;
     165             :     bool                mbInSelectHdl;
     166             :     bool                mbInDeselectHdl;
     167             : 
     168             :     String              GetConflictString( const ScConflictsListEntry& rConflictEntry );
     169             :     String              GetActionString( const ScChangeAction* pAction, ScDocument* pDoc );
     170             :     void                HandleListBoxSelection( bool bSelectHandle );
     171             : 
     172             :     void                SetConflictAction( SvTreeListEntry* pRootEntry, ScConflictAction eConflictAction );
     173             :     void                KeepHandler( bool bMine );
     174             :     void                KeepAllHandler( bool bMine );
     175             : 
     176             :     DECL_LINK( SelectHandle, void* );
     177             :     DECL_LINK( DeselectHandle, void* );
     178             :     DECL_LINK( UpdateSelectionHdl, void* );
     179             :     DECL_LINK( KeepMineHandle, void* );
     180             :     DECL_LINK( KeepOtherHandle, void* );
     181             :     DECL_LINK( KeepAllMineHandle, void* );
     182             :     DECL_LINK( KeepAllOthersHandle, void* );
     183             : 
     184             : public:
     185             :                         ScConflictsDlg( Window* pParent, ScViewData* pViewData, ScDocument* pSharedDoc, ScConflictsList& rConflictsList );
     186             :                         ~ScConflictsDlg();
     187             : 
     188             :     virtual void        Resize();
     189             :     void                UpdateView();
     190             : };
     191             : 
     192             : #endif
     193             : 
     194             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10