LCOV - code coverage report
Current view: top level - sfx2/source/inc - splitwin.hxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 5 5 100.0 %
Date: 2014-11-03 Functions: 2 2 100.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             : #ifndef INCLUDED_SFX2_SOURCE_INC_SPLITWIN_HXX
      20             : #define INCLUDED_SFX2_SOURCE_INC_SPLITWIN_HXX
      21             : 
      22             : #include <vcl/splitwin.hxx>
      23             : #include <sfx2/childwin.hxx>
      24             : 
      25             : class SfxWorkWindow;
      26             : class SfxDockingWindow;
      27             : class SfxEmptySplitWin_Impl;
      28             : 
      29             : struct SfxDock_Impl
      30             : {
      31             :     sal_uInt16        nType;
      32             :     SfxDockingWindow* pWin;      // SplitWindow has this window
      33             :     bool          bNewLine;
      34             :     bool          bHide;     // SplitWindow had this window
      35             :     long              nSize;
      36             : };
      37             : 
      38             : typedef boost::ptr_vector<SfxDock_Impl> SfxDockArr_Impl;
      39             : 
      40             : class SfxSplitWindow : public SplitWindow
      41             : {
      42             : friend class SfxEmptySplitWin_Impl;
      43             : 
      44             : private:
      45             :     SfxChildAlignment   eAlign;
      46             :     SfxWorkWindow*      pWorkWin;
      47             :     SfxDockArr_Impl*    pDockArr;
      48             :     bool                bLocked;
      49             :     bool                bPinned;
      50             :     SfxEmptySplitWin_Impl*  pEmptyWin;
      51             :     SfxDockingWindow*   pActive;
      52             : 
      53             :     void                InsertWindow_Impl( SfxDock_Impl* pDockWin,
      54             :                             const Size& rSize,
      55             :                             sal_uInt16 nLine,
      56             :                             sal_uInt16 nPos,
      57             :                             bool bNewLine=false );
      58             : 
      59             :     DECL_LINK(          TimerHdl, Timer* );
      60             :     bool                CursorIsOverRect( bool bForceAdding = false ) const;
      61             :     void                SetPinned_Impl( bool );
      62             :     void                SetFadeIn_Impl( bool );
      63             :     void                SaveConfig_Impl();
      64             :     void                FadeOut_Impl();
      65             : 
      66             : protected:
      67             : 
      68             :     virtual void        StartSplit() SAL_OVERRIDE;
      69             :     virtual void        SplitResize() SAL_OVERRIDE;
      70             :     virtual void        Split() SAL_OVERRIDE;
      71             :     virtual void        Command ( const CommandEvent& rCEvt ) SAL_OVERRIDE;
      72             :     virtual void        MouseButtonDown ( const MouseEvent& ) SAL_OVERRIDE;
      73             : 
      74             : public:
      75             :                         SfxSplitWindow( vcl::Window* pParent, SfxChildAlignment eAl,
      76             :                             SfxWorkWindow *pW, bool bWithButtons,
      77             :                             WinBits nBits = WB_BORDER | WB_SIZEABLE | WB_3DLOOK );
      78             : 
      79             :                         virtual ~SfxSplitWindow();
      80             : 
      81             :     void                ReleaseWindow_Impl(SfxDockingWindow *pWin, bool bSaveConfig=true);
      82             : 
      83             :     void                InsertWindow( SfxDockingWindow* pDockWin,
      84             :                             const Size& rSize);
      85             : 
      86             :     void                InsertWindow( SfxDockingWindow* pDockWin,
      87             :                             const Size& rSize,
      88             :                             sal_uInt16 nLine,
      89             :                             sal_uInt16 nPos,
      90             :                             bool bNewLine=false );
      91             : 
      92             :     void                MoveWindow( SfxDockingWindow* pDockWin,
      93             :                             const Size& rSize,
      94             :                             sal_uInt16 nLine,
      95             :                             sal_uInt16 nPos,
      96             :                             bool bNewLine=false );
      97             : 
      98             :     void                RemoveWindow( SfxDockingWindow* pDockWin, bool bHide=true);
      99             : 
     100       21118 :     void                Lock( bool bLock=true )
     101             :                         {
     102       21118 :                             bLocked = bLock;
     103       21118 :                             SetUpdateMode( !bLock );
     104       21118 :                         }
     105             :         using Window::IsLocked;
     106             :     bool                IsLocked() const { return bLocked; }
     107             :     bool                GetWindowPos( const SfxDockingWindow* pWindow,
     108             :                                       sal_uInt16& rLine, sal_uInt16& rPos ) const;
     109             :     bool                GetWindowPos( const Point& rTestPos,
     110             :                                       sal_uInt16& rLine, sal_uInt16& rPos ) const;
     111             :     sal_uInt16              GetLineCount() const;
     112             :     long                GetLineSize( sal_uInt16 ) const;
     113             :     sal_uInt16              GetWindowCount(sal_uInt16 nLine) const;
     114             :     sal_uInt16              GetWindowCount() const;
     115             : 
     116      124768 :     bool                IsPinned() const { return bPinned; }
     117             :     bool                IsFadeIn() const;
     118             :     bool                IsAutoHide( bool bSelf = false ) const;
     119             :     SplitWindow*        GetSplitWindow();
     120             : 
     121             :     virtual void        AutoHide() SAL_OVERRIDE;
     122             :     virtual void        FadeOut() SAL_OVERRIDE;
     123             :     virtual void        FadeIn() SAL_OVERRIDE;
     124             :     void                Show_Impl();
     125             :     void                Pin_Impl( bool bPinned );
     126             :     bool                ActivateNextChild_Impl( bool bForward = true );
     127             :     void                SetActiveWindow_Impl( SfxDockingWindow* pWin );
     128             : };
     129             : 
     130             : #endif // INCLUDED_SFX2_SOURCE_INC_SPLITWIN_HXX
     131             : 
     132             : 
     133             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10