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/IContextChangeReceiver.hxx> 22 #include <sfx2/sidebar/SidebarModelUpdate.hxx> 23 #include <sfx2/sidebar/PanelLayout.hxx> 24 #include <vcl/EnumContext.hxx> 25 #include "ChartSidebarModifyListener.hxx" 26 #include <TitleHelper.hxx> 27 28 namespace com::sun::star::util { class XModifyListener; } 29 30 namespace chart { 31 32 class ChartController; 33 34 namespace sidebar { 35 36 class ChartElementsPanel : public PanelLayout, 37 public ::sfx2::sidebar::IContextChangeReceiver, 38 public sfx2::sidebar::SidebarModelUpdate, 39 public ChartSidebarModifyListenerParent 40 { 41 public: 42 static std::unique_ptr<PanelLayout> Create( 43 weld::Widget* pParent, 44 ChartController* pController); 45 46 virtual void DataChanged( 47 const DataChangedEvent& rEvent) override; 48 49 virtual void HandleContextChange( 50 const vcl::EnumContext& rContext) override; 51 52 // constructor/destructor 53 ChartElementsPanel( 54 weld::Widget* pParent, 55 ChartController* pController); 56 57 virtual ~ChartElementsPanel() override; 58 59 virtual void updateData() override; 60 virtual void modelInvalid() override; 61 62 virtual void updateModel(css::uno::Reference<css::frame::XModel> xModel) override; 63 64 private: 65 //ui controls 66 std::unique_ptr<weld::CheckButton> mxCBTitle; 67 std::unique_ptr<weld::Entry> mxEditTitle; 68 std::unique_ptr<weld::CheckButton> mxCBSubtitle; 69 std::unique_ptr<weld::Entry> mxEditSubtitle; 70 std::unique_ptr<weld::CheckButton> mxCBXAxis; 71 std::unique_ptr<weld::CheckButton> mxCBXAxisTitle; 72 std::unique_ptr<weld::CheckButton> mxCBYAxis; 73 std::unique_ptr<weld::CheckButton> mxCBYAxisTitle; 74 std::unique_ptr<weld::CheckButton> mxCBZAxis; 75 std::unique_ptr<weld::CheckButton> mxCBZAxisTitle; 76 std::unique_ptr<weld::CheckButton> mxCB2ndXAxis; 77 std::unique_ptr<weld::CheckButton> mxCB2ndXAxisTitle; 78 std::unique_ptr<weld::CheckButton> mxCB2ndYAxis; 79 std::unique_ptr<weld::CheckButton> mxCB2ndYAxisTitle; 80 std::unique_ptr<weld::CheckButton> mxCBLegend; 81 std::unique_ptr<weld::CheckButton> mxCBLegendNoOverlay; 82 std::unique_ptr<weld::CheckButton> mxCBGridVerticalMajor; 83 std::unique_ptr<weld::CheckButton> mxCBGridHorizontalMajor; 84 std::unique_ptr<weld::CheckButton> mxCBGridVerticalMinor; 85 std::unique_ptr<weld::CheckButton> mxCBGridHorizontalMinor; 86 std::unique_ptr<weld::Label> mxTextTitle; 87 std::unique_ptr<weld::Label> mxTextSubTitle; 88 std::unique_ptr<weld::Label> mxLBAxis; 89 std::unique_ptr<weld::Label> mxLBGrid; 90 91 std::unique_ptr<weld::ComboBox> mxLBLegendPosition; 92 std::unique_ptr<weld::Widget> mxBoxLegend; 93 94 vcl::EnumContext maContext; 95 96 css::uno::Reference<css::frame::XModel> mxModel; 97 css::uno::Reference<css::util::XModifyListener> mxListener; 98 99 bool mbModelValid; 100 101 OUString maTextTitle; 102 OUString maTextSubTitle; 103 104 void Initialize(); 105 void doUpdateModel(css::uno::Reference<css::frame::XModel> xModel); 106 107 void setTitleVisible(TitleHelper::eTitleType eTitle, bool bVisible); 108 109 DECL_LINK(CheckBoxHdl, weld::Toggleable&, void); 110 DECL_LINK(EditHdl, weld::Entry&, void); 111 DECL_LINK(LegendPosHdl, weld::ComboBox&, void); 112 }; 113 114 } } // end of namespace ::chart::sidebar 115 116 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 117