LCOV - code coverage report
Current view: top level - libreoffice/sd/source/ui/slidesorter/model - SlsVisualState.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 33 0.0 %
Date: 2012-12-27 Functions: 0 7 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             : #include "model/SlsVisualState.hxx"
      21             : #include "model/SlsPageDescriptor.hxx"
      22             : #include "controller/SlsAnimator.hxx"
      23             : 
      24             : namespace sd { namespace slidesorter { namespace model {
      25             : 
      26           0 : VisualState::VisualState (const sal_Int32 nPageId)
      27             :     : mnPageId(nPageId),
      28             :       meCurrentVisualState(VS_None),
      29             :       meOldVisualState(VS_None),
      30             :       mnStateAnimationId(controller::Animator::NotAnAnimationId),
      31             :       maLocationOffset(0,0),
      32           0 :       mnLocationAnimationId(controller::Animator::NotAnAnimationId)
      33             : {
      34           0 : }
      35             : 
      36           0 : VisualState::~VisualState (void)
      37             : {
      38           0 :     if (mnStateAnimationId != controller::Animator::NotAnAnimationId
      39             :          || mnLocationAnimationId != controller::Animator::NotAnAnimationId)
      40             :     {
      41             :         OSL_ASSERT(mnStateAnimationId == controller::Animator::NotAnAnimationId);
      42             :         OSL_ASSERT(mnLocationAnimationId == controller::Animator::NotAnAnimationId);
      43             :     }
      44           0 : }
      45             : 
      46           0 : void VisualState::SetVisualState (const State eState)
      47             : {
      48           0 :     meOldVisualState = meCurrentVisualState;
      49           0 :     meCurrentVisualState = eState;
      50           0 : }
      51             : 
      52             : 
      53           0 : void VisualState::UpdateVisualState (const PageDescriptor& rDescriptor)
      54             : {
      55           0 :     if (rDescriptor.HasState(PageDescriptor::ST_Excluded))
      56           0 :         SetVisualState(VS_Excluded);
      57           0 :     else if (rDescriptor.HasState(PageDescriptor::ST_Current))
      58           0 :         SetVisualState(VS_Current);
      59           0 :     else if (rDescriptor.HasState(PageDescriptor::ST_Focused))
      60           0 :         SetVisualState(VS_Focused);
      61           0 :     else if (rDescriptor.HasState(PageDescriptor::ST_Selected))
      62           0 :         SetVisualState(VS_Selected);
      63             :     else
      64           0 :         SetVisualState(VS_None);
      65             : 
      66           0 :     SetMouseOverState(rDescriptor.HasState(PageDescriptor::ST_MouseOver));
      67           0 : }
      68             : 
      69             : 
      70           0 : void VisualState::SetMouseOverState (const bool bIsMouseOver)
      71             : {
      72           0 :     mbOldMouseOverState = mbCurrentMouseOverState;
      73           0 :     mbCurrentMouseOverState = bIsMouseOver;
      74           0 : }
      75             : 
      76             : 
      77           0 : Point VisualState::GetLocationOffset (void) const
      78             : {
      79           0 :     return maLocationOffset;
      80             : }
      81             : 
      82             : 
      83           0 : bool VisualState::SetLocationOffset (const Point& rOffset)
      84             : {
      85           0 :     if (maLocationOffset != rOffset)
      86             :     {
      87           0 :         maLocationOffset = rOffset;
      88           0 :         return true;
      89             :     }
      90             :     else
      91           0 :         return false;
      92             : }
      93             : 
      94             : 
      95             : } } } // end of namespace ::sd::slidesorter::model
      96             : 
      97             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10