LCOV - code coverage report
Current view: top level - sd/source/ui/framework/module - ToolPanelModule.cxx (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 28 29 96.6 %
Date: 2014-04-11 Functions: 5 5 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             : 
      20             : 
      21             : #include "ToolPanelModule.hxx"
      22             : 
      23             : #include "framework/FrameworkHelper.hxx"
      24             : #include <com/sun/star/drawing/framework/XTabBar.hpp>
      25             : #include <com/sun/star/drawing/framework/TabBarButton.hpp>
      26             : 
      27             : #include "strings.hrc"
      28             : #include "sdresid.hxx"
      29             : #include "svtools/toolpanelopt.hxx"
      30             : 
      31             : using namespace ::com::sun::star;
      32             : using namespace ::com::sun::star::uno;
      33             : using namespace ::com::sun::star::drawing::framework;
      34             : 
      35             : using ::sd::framework::FrameworkHelper;
      36             : 
      37             : 
      38             : namespace sd { namespace framework {
      39             : 
      40             : 
      41             : //===== ToolPanelModule ==================================================
      42             : 
      43          21 : ToolPanelModule::ToolPanelModule (
      44             :     const Reference<frame::XController>& rxController,
      45             :     const OUString& rsSidebarPaneURL)
      46             :     : ResourceManager(rxController,
      47             :         FrameworkHelper::CreateResourceId(FrameworkHelper::msSidebarViewURL, rsSidebarPaneURL)),
      48          21 :       mxControllerManager(rxController,UNO_QUERY)
      49             : {
      50          21 :     if (mxConfigurationController.is())
      51             :     {
      52          21 :         if (SvtToolPanelOptions().GetVisibleImpressView())
      53          21 :             AddActiveMainView(FrameworkHelper::msImpressViewURL);
      54          21 :         if (SvtToolPanelOptions().GetVisibleOutlineView())
      55           0 :             AddActiveMainView(FrameworkHelper::msOutlineViewURL);
      56          21 :         if (SvtToolPanelOptions().GetVisibleNotesView())
      57          21 :             AddActiveMainView(FrameworkHelper::msNotesViewURL);
      58          21 :         if (SvtToolPanelOptions().GetVisibleHandoutView())
      59          21 :             AddActiveMainView(FrameworkHelper::msHandoutViewURL);
      60          21 :         if (SvtToolPanelOptions().GetVisibleSlideSorterView())
      61          21 :             AddActiveMainView(FrameworkHelper::msSlideSorterURL);
      62             : 
      63          21 :         mxConfigurationController->addConfigurationChangeListener(
      64             :             this,
      65             :             FrameworkHelper::msResourceActivationEvent,
      66          21 :             Any());
      67             :     }
      68          21 : }
      69             : 
      70          42 : ToolPanelModule::~ToolPanelModule (void)
      71             : {
      72          42 : }
      73             : 
      74          21 : void ToolPanelModule::SaveResourceState (void)
      75             : {
      76          21 :     SvtToolPanelOptions().SetVisibleImpressView(IsResourceActive(FrameworkHelper::msImpressViewURL));
      77          21 :     SvtToolPanelOptions().SetVisibleOutlineView(IsResourceActive(FrameworkHelper::msOutlineViewURL));
      78          21 :     SvtToolPanelOptions().SetVisibleNotesView(IsResourceActive(FrameworkHelper::msNotesViewURL));
      79          21 :     SvtToolPanelOptions().SetVisibleHandoutView(IsResourceActive(FrameworkHelper::msHandoutViewURL));
      80          21 :     SvtToolPanelOptions().SetVisibleSlideSorterView(IsResourceActive(FrameworkHelper::msSlideSorterURL));
      81          21 : }
      82             : 
      83         398 : void SAL_CALL ToolPanelModule::notifyConfigurationChange (
      84             :     const ConfigurationChangeEvent& rEvent)
      85             :     throw (RuntimeException, std::exception)
      86             : {
      87         398 :     if (!rEvent.Type.equals(FrameworkHelper::msResourceActivationEvent))
      88         294 :         ResourceManager::notifyConfigurationChange(rEvent);
      89         398 : }
      90             : 
      91             : } } // end of namespace sd::framework
      92             : 
      93             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10