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 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 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 23 24 #include "precompiled_sd.hxx" 25 26 #include "NavigatorWrapper.hxx" 27 #include "navigatr.hrc" 28 #include "ViewShellBase.hxx" 29 30 #include <sfx2/sidebar/Theme.hxx> 31 32 #include <boost/bind.hpp> 33 34 35 namespace sd { namespace sidebar { 36 37 NavigatorWrapper::NavigatorWrapper ( 38 ::Window* pParent, 39 sd::ViewShellBase& rViewShellBase, 40 SfxBindings* pBindings) 41 : Control(pParent, 0), 42 mrViewShellBase(rViewShellBase), 43 maNavigator( 44 this, 45 NULL, 46 SdResId(FLT_NAVIGATOR), 47 pBindings, 48 ::boost::bind(&NavigatorWrapper::UpdateNavigator, this)) 49 { 50 maNavigator.SetPosSizePixel( 51 Point(0,0), 52 GetSizePixel()); 53 maNavigator.SetBackground(sfx2::sidebar::Theme::GetWallpaper(sfx2::sidebar::Theme::Paint_PanelBackground)); 54 maNavigator.Show(); 55 } 56 57 58 NavigatorWrapper::~NavigatorWrapper (void) 59 { 60 } 61 62 63 void NavigatorWrapper::Resize (void) 64 { 65 maNavigator.SetSizePixel(GetSizePixel()); 66 } 67 68 69 css::ui::LayoutSize NavigatorWrapper::GetHeightForWidth (const sal_Int32 nWidth) 70 { 71 (void)nWidth; 72 73 return css::ui::LayoutSize(-1,-1,-1); 74 } 75 76 77 void NavigatorWrapper::UpdateNavigator (void) 78 { 79 maNavigator.InitTreeLB(mrViewShellBase.GetDocument()); 80 } 81 82 83 void NavigatorWrapper::GetFocus (void) 84 { 85 maNavigator.GrabFocus(); 86 } 87 88 } } // end of namespace sd::sidebar 89 90 /* vim: set noet sw=4 ts=4: */ 91