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 #ifndef SD_SIDEBAR_NAVIGATOR_WRAPPER_HXX 23 #define SD_SIDEBAR_NAVIGATOR_WRAPPER_HXX 24 25 #include <sfx2/sidebar/ILayoutableWindow.hxx> 26 #include <vcl/ctrl.hxx> 27 #include "navigatr.hxx" 28 29 30 class SfxBindings; 31 namespace sd { class ViewShellBase; } 32 33 namespace css = ::com::sun::star; 34 35 namespace sd { namespace sidebar { 36 37 /** Present the navigator as control that can be displayed inside the 38 sidebar. 39 This wrapper has two main responsibilities: 40 - Watch for document changes and update the navigator when one 41 happens. 42 - Forward size changes from sidebar to navigator. 43 */ 44 class NavigatorWrapper 45 : public Control, 46 public sfx2::sidebar::ILayoutableWindow 47 { 48 public: 49 NavigatorWrapper ( 50 ::Window* pParent, 51 sd::ViewShellBase& rViewShellBase, 52 SfxBindings* pBindings); 53 54 virtual ~NavigatorWrapper (void); 55 56 // Control 57 virtual void Resize (void); 58 59 // From ILayoutableWindow 60 virtual css::ui::LayoutSize GetHeightForWidth (const sal_Int32 nWidth); 61 62 private: 63 ViewShellBase& mrViewShellBase; 64 SdNavigatorWin maNavigator; 65 66 void UpdateNavigator (void); 67 }; 68 69 70 } } // end of namespace sd::sidebar 71 72 #endif 73