Line data Source code
1 : /*
2 : * This file is part of the LibreOffice project.
3 : *
4 : * This Source Code Form is subject to the terms of the Mozilla Public
5 : * License, v. 2.0. If a copy of the MPL was not distributed with this
6 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 : *
8 : * This file incorporates work covered by the following license notice:
9 : *
10 : * Licensed to the Apache Software Foundation (ASF) under one or more
11 : * contributor license agreements. See the NOTICE file distributed
12 : * with this work for additional information regarding copyright
13 : * ownership. The ASF licenses this file to you under the Apache
14 : * License, Version 2.0 (the "License"); you may not use this file
15 : * except in compliance with the License. You may obtain a copy of
16 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
17 : */
18 :
19 : #include "NavigatorWrapper.hxx"
20 : #include "navigatr.hrc"
21 : #include "ViewShellBase.hxx"
22 :
23 : #include <sfx2/sidebar/Theme.hxx>
24 :
25 : #include <boost/bind.hpp>
26 :
27 :
28 : namespace sd { namespace sidebar {
29 :
30 0 : NavigatorWrapper::NavigatorWrapper (
31 : ::Window* pParent,
32 : sd::ViewShellBase& rViewShellBase,
33 : SfxBindings* pBindings)
34 : : Control(pParent, 0),
35 : mrViewShellBase(rViewShellBase),
36 : maNavigator(
37 : this,
38 : NULL,
39 : SdResId(FLT_NAVIGATOR),
40 : pBindings,
41 0 : ::boost::bind(&NavigatorWrapper::UpdateNavigator, this))
42 : {
43 : maNavigator.SetPosSizePixel(
44 : Point(0,0),
45 0 : GetSizePixel());
46 0 : maNavigator.SetBackground(sfx2::sidebar::Theme::GetWallpaper(sfx2::sidebar::Theme::Paint_PanelBackground));
47 0 : maNavigator.Show();
48 0 : }
49 :
50 :
51 :
52 :
53 0 : NavigatorWrapper::~NavigatorWrapper (void)
54 : {
55 0 : }
56 :
57 :
58 :
59 :
60 0 : void NavigatorWrapper::Resize (void)
61 : {
62 0 : maNavigator.SetSizePixel(GetSizePixel());
63 0 : }
64 :
65 :
66 :
67 :
68 0 : css::ui::LayoutSize NavigatorWrapper::GetHeightForWidth (const sal_Int32 nWidth)
69 : {
70 : (void)nWidth;
71 :
72 0 : return css::ui::LayoutSize(-1,-1,-1);
73 : }
74 :
75 :
76 :
77 :
78 0 : void NavigatorWrapper::UpdateNavigator (void)
79 : {
80 0 : maNavigator.InitTreeLB(mrViewShellBase.GetDocument());
81 0 : }
82 :
83 :
84 :
85 :
86 0 : void NavigatorWrapper::GetFocus (void)
87 : {
88 0 : maNavigator.GrabFocus();
89 0 : }
90 :
91 :
92 :
93 33 : } } // end of namespace sd::sidebar
|