Sidebar.cxx (ff12d537) Sidebar.cxx (3091fa8a)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 7 unchanged lines hidden (view full) ---

16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22#include "precompiled_sfx2.hxx"
23
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 7 unchanged lines hidden (view full) ---

16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22#include "precompiled_sfx2.hxx"
23
24#include "Sidebar.hxx"
24#include "sfx2/sidebar/Sidebar.hxx"
25#include "SidebarController.hxx"
25#include "ResourceManager.hxx"
26
27using namespace css;
28using namespace cssu;
29
30namespace sfx2 { namespace sidebar {
31
26#include "ResourceManager.hxx"
27
28using namespace css;
29using namespace cssu;
30
31namespace sfx2 { namespace sidebar {
32
32Sidebar::Sidebar(
33 Window& rParentWindow,
34 const Reference<frame::XFrame>& rxDocumentFrame)
35 : Window(&rParentWindow, WB_DIALOGCONTROL)
36{
37 ContentPanelManager::Instance();
38}
39
33
40
41
42
43Sidebar::~Sidebar (void)
34void Sidebar::ShowPanel (
35 const ::rtl::OUString& rsPanelId,
36 const Reference<frame::XFrame>& rxFrame)
44{
37{
38 SidebarController* pController = SidebarController::GetSidebarControllerForFrame(rxFrame);
39 const PanelDescriptor* pPanelDescriptor = ResourceManager::Instance().GetPanelDescriptor(rsPanelId);
40 if (pController!=NULL && pPanelDescriptor != NULL)
41 {
42 // This should be a lot more sophisticated:
43 // - Make the deck switching asynchronous
44 // - Make sure that the panel is visible and expanded after
45 // the switch.
46 // - Make sure to use a context that really shows the panel
47 //
48 // All that is not necessary for the current use cases so lets
49 // keep it simple for the time being.
50 pController->RequestSwitchToDeck(pPanelDescriptor->msDeckId);
51 }
45}
46
47
48
49
52}
53
54
55
56
50void Sidebar::Resize (void)
57void Sidebar::ShowDeck (
58 const ::rtl::OUString& rsDeckId,
59 const Reference<frame::XFrame>& rxFrame)
51{
60{
52 Window::Resize();
53 // m_pImpl->OnResize();
61 SidebarController* pController = SidebarController::GetSidebarControllerForFrame(rxFrame);
62 if (pController != NULL)
63 pController->RequestSwitchToDeck(rsDeckId);
54}
55
64}
65
56
57
58
59void Sidebar::GetFocus (void)
60{
61 Window::GetFocus();
62 // m_pImpl->OnGetFocus();
63}
64
65
66
67
68void Sidebar::DataChanged (const DataChangedEvent& rDataChangedEvent)
69{
70 if (rDataChangedEvent.GetType() == DATACHANGED_SETTINGS
71 && (rDataChangedEvent.GetFlags() & SETTINGS_STYLE)!= 0)
72 {
73 Invalidate();
74 }
75 else
76 Window::DataChanged(rDataChangedEvent);
77}
78
79
80
81} } // end of namespace sfx2::sidebar
66} } // end of namespace sfx2::sidebar