| 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/ControllerItem.hxx> |
| 22 |
#include <sfx2/sidebar/IContextChangeReceiver.hxx> |
| 23 |
#include <sfx2/sidebar/SidebarModelUpdate.hxx> |
| 24 |
#include <sfx2/sidebar/PanelLayout.hxx> |
| 25 |
|
| 26 |
#include "ChartSidebarModifyListener.hxx" |
| 27 |
#include "ChartSidebarSelectionListener.hxx" |
| 28 |
|
| 29 |
namespace com::sun::star::util { class XModifyListener; } |
| 30 |
namespace com::sun::star::view { class XSelectionChangeListener; } |
| 31 |
|
| 32 |
namespace chart { |
| 33 |
|
| 34 |
class ChartController; |
| 35 |
|
| 36 |
namespace sidebar { |
| 37 |
|
| 38 |
class ChartSeriesPanel : public PanelLayout, |
| 39 |
public ::sfx2::sidebar::IContextChangeReceiver, |
| 40 |
public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface, |
| 41 |
public sfx2::sidebar::SidebarModelUpdate, |
| 42 |
public ChartSidebarModifyListenerParent, |
| 43 |
public ChartSidebarSelectionListenerParent |
| 44 |
{ |
| 45 |
public: |
| 46 |
static std::unique_ptr<PanelLayout> Create( |
| 47 |
weld::Widget* pParent, |
| 48 |
ChartController* pController); |
| 49 |
|
| 50 |
virtual void DataChanged( |
| 51 |
const DataChangedEvent& rEvent) override; |
| 52 |
|
| 53 |
virtual void HandleContextChange( |
| 54 |
const vcl::EnumContext& rContext) override; |
| 55 |
|
| 56 |
virtual void NotifyItemUpdate( |
| 57 |
const sal_uInt16 nSId, |
| 58 |
const SfxItemState eState, |
| 59 |
const SfxPoolItem* pState) override; |
| 60 |
|
| 61 |
virtual void GetControlState( |
| 62 |
const sal_uInt16 /*nSId*/, |
| 63 |
boost::property_tree::ptree& /*rState*/) override {}; |
| 64 |
|
| 65 |
// constructor/destructor |
| 66 |
ChartSeriesPanel( |
| 67 |
weld::Widget* pParent, |
| 68 |
ChartController* pController); |
| 69 |
virtual ~ChartSeriesPanel() override; |
| 70 |
|
| 71 |
virtual void updateData() override; |
| 72 |
virtual void modelInvalid() override; |
| 73 |
|
| 74 |
virtual void selectionChanged(bool bCorrectType) override; |
| 75 |
|
| 76 |
virtual void updateModel(css::uno::Reference<css::frame::XModel> xModel) override; |
| 77 |
|
| 78 |
private: |
| 79 |
//ui controls |
| 80 |
std::unique_ptr<weld::CheckButton> mxCBLabel; |
| 81 |
std::unique_ptr<weld::CheckButton> mxCBTrendline; |
| 82 |
std::unique_ptr<weld::CheckButton> mxCBXError; |
| 83 |
std::unique_ptr<weld::CheckButton> mxCBYError; |
| 84 |
|
| 85 |
std::unique_ptr<weld::RadioButton> mxRBPrimaryAxis; |
| 86 |
std::unique_ptr<weld::RadioButton> mxRBSecondaryAxis; |
| 87 |
|
| 88 |
std::unique_ptr<weld::Widget> mxBoxLabelPlacement; |
| 89 |
std::unique_ptr<weld::ComboBox> mxLBLabelPlacement; |
| 90 |
|
| 91 |
std::unique_ptr<weld::Label> mxFTSeriesName; |
| 92 |
std::unique_ptr<weld::Label> mxFTSeriesTemplate; |
| 93 |
|
| 94 |
rtl::Reference<::chart::ChartModel> mxModel; |
| 95 |
css::uno::Reference<css::util::XModifyListener> mxListener; |
| 96 |
css::uno::Reference<css::view::XSelectionChangeListener> mxSelectionListener; |
| 97 |
|
| 98 |
bool mbModelValid; |
| 99 |
|
| 100 |
void Initialize(); |
| 101 |
void doUpdateModel(const rtl::Reference<::chart::ChartModel>& xModel); |
| 102 |
|
| 103 |
DECL_LINK(CheckBoxHdl, weld::Toggleable&, void); |
| 104 |
DECL_LINK(RadioBtnHdl, weld::Toggleable&, void); |
| 105 |
DECL_LINK(ListBoxHdl, weld::ComboBox&, void); |
| 106 |
}; |
| 107 |
|
| 108 |
} } // end of namespace ::chart::sidebar |
| 109 |
|
| 110 |
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |