1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include "ToolPanelModule.hxx"
22 #include "framework/FrameworkHelper.hxx"
23 #include <com/sun/star/drawing/framework/XTabBar.hpp>
24 #include <com/sun/star/drawing/framework/TabBarButton.hpp>
26 #include "strings.hrc"
27 #include "sdresid.hxx"
28 #include "svtools/toolpanelopt.hxx"
30 using namespace ::com::sun::star
;
31 using namespace ::com::sun::star::uno
;
32 using namespace ::com::sun::star::drawing::framework
;
34 using ::sd::framework::FrameworkHelper
;
36 namespace sd
{ namespace framework
{
38 //===== ToolPanelModule ==================================================
40 ToolPanelModule::ToolPanelModule (
41 const Reference
<frame::XController
>& rxController
,
42 const OUString
& rsSidebarPaneURL
)
43 : ResourceManager(rxController
,
44 FrameworkHelper::CreateResourceId(FrameworkHelper::msSidebarViewURL
, rsSidebarPaneURL
)),
45 mxControllerManager(rxController
,UNO_QUERY
)
47 if (mxConfigurationController
.is())
49 if (SvtToolPanelOptions().GetVisibleImpressView())
50 AddActiveMainView(FrameworkHelper::msImpressViewURL
);
51 if (SvtToolPanelOptions().GetVisibleOutlineView())
52 AddActiveMainView(FrameworkHelper::msOutlineViewURL
);
53 if (SvtToolPanelOptions().GetVisibleNotesView())
54 AddActiveMainView(FrameworkHelper::msNotesViewURL
);
55 if (SvtToolPanelOptions().GetVisibleHandoutView())
56 AddActiveMainView(FrameworkHelper::msHandoutViewURL
);
57 if (SvtToolPanelOptions().GetVisibleSlideSorterView())
58 AddActiveMainView(FrameworkHelper::msSlideSorterURL
);
60 mxConfigurationController
->addConfigurationChangeListener(
62 FrameworkHelper::msResourceActivationEvent
,
67 ToolPanelModule::~ToolPanelModule()
71 void ToolPanelModule::SaveResourceState()
73 SvtToolPanelOptions().SetVisibleImpressView(IsResourceActive(FrameworkHelper::msImpressViewURL
));
74 SvtToolPanelOptions().SetVisibleOutlineView(IsResourceActive(FrameworkHelper::msOutlineViewURL
));
75 SvtToolPanelOptions().SetVisibleNotesView(IsResourceActive(FrameworkHelper::msNotesViewURL
));
76 SvtToolPanelOptions().SetVisibleHandoutView(IsResourceActive(FrameworkHelper::msHandoutViewURL
));
77 SvtToolPanelOptions().SetVisibleSlideSorterView(IsResourceActive(FrameworkHelper::msSlideSorterURL
));
80 void SAL_CALL
ToolPanelModule::notifyConfigurationChange (
81 const ConfigurationChangeEvent
& rEvent
)
82 throw (RuntimeException
, std::exception
)
84 if (!rEvent
.Type
.equals(FrameworkHelper::msResourceActivationEvent
))
85 ResourceManager::notifyConfigurationChange(rEvent
);
88 } } // end of namespace sd::framework
90 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */