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 #ifndef SC_CHARTHELPER_HXX 25 #define SC_CHARTHELPER_HXX 26 27 #include <tools/solar.h> 28 #include "address.hxx" 29 #include "global.hxx" 30 #include "rangelst.hxx" 31 32 #include <com/sun/star/chart2/XChartDocument.hpp> 33 34 class SdrObject; 35 class SdrPage; 36 class ScModelObj; 37 38 typedef ::std::vector< ScRangeList > ScRangeListVector; 39 40 /** Use this to handle charts in a calc document 41 */ 42 class ScChartHelper 43 { 44 public: 45 static sal_uInt16 DoUpdateAllCharts( ScDocument* pDoc ); 46 static sal_uInt16 DoUpdateCharts( const ScAddress& rPos, ScDocument* pDoc ); //use this to replace ScDBFunc::DoUpdateCharts in future 47 static void AdjustRangesOfChartsOnDestinationPage( ScDocument* pSrcDoc, ScDocument* pDestDoc, const SCTAB nSrcTab, const SCTAB nDestTab ); 48 static void UpdateChartsOnDestinationPage( ScDocument* pDestDoc, const SCTAB nDestTab ); 49 static ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument > GetChartFromSdrObject( SdrObject* pObject ); 50 static void GetChartRanges( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument >& xChartDoc, 51 ::com::sun::star::uno::Sequence< rtl::OUString >& rRanges ); 52 static void SetChartRanges( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument >& xChartDoc, 53 const ::com::sun::star::uno::Sequence< rtl::OUString >& rRanges ); 54 55 static void AddRangesIfProtectedChart( ScRangeListVector& rRangesVector, ScDocument* pDocument, SdrObject* pObject ); 56 static void FillProtectedChartRangesVector( ScRangeListVector& rRangesVector, ScDocument* pDocument, SdrPage* pPage ); 57 static void GetChartNames( ::std::vector< ::rtl::OUString >& rChartNames, SdrPage* pPage ); 58 static void CreateProtectedChartListenersAndNotify( ScDocument* pDoc, SdrPage* pPage, ScModelObj* pModelObj, SCTAB nTab, 59 const ScRangeListVector& rRangesVector, const ::std::vector< ::rtl::OUString >& rExcludedChartNames, bool bSameDoc = true ); 60 }; 61 62 #endif 63