1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 /* 3 * This file is part of the LibreOffice project. 4 * 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/. 8 * 9 * This file incorporates work covered by the following license notice: 10 * 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 . 18 */ 19 #pragma once 20 21 #include <sfx2/sidebar/ILayoutableWindow.hxx> 22 #include <sfx2/sidebar/PanelLayout.hxx> 23 #include <navigatr.hxx> 24 25 class SfxBindings; 26 namespace sd { class ViewShellBase; } 27 28 namespace sd::sidebar { 29 30 /** Present the navigator as control that can be displayed inside the 31 sidebar. 32 This wrapper has two main responsibilities: 33 - Watch for document changes and update the navigator when one 34 happens. 35 - Forward size changes from sidebar to navigator. 36 */ 37 class NavigatorWrapper 38 : public SdNavigatorWin, 39 public sfx2::sidebar::ILayoutableWindow 40 { 41 public: 42 NavigatorWrapper ( 43 weld::Widget* pParent, 44 sd::ViewShellBase& rViewShellBase, 45 SfxBindings* pBindings); 46 47 // From ILayoutableWindow 48 virtual css::ui::LayoutSize GetHeightForWidth (const sal_Int32 nWidth) override; 49 50 private: 51 ViewShellBase& mrViewShellBase; 52 53 void UpdateNavigator(); 54 }; 55 56 } // end of namespace sd::sidebar 57 58 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 59