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 SC_VBA_QUERYTABLE_HXX 23 #define SC_VBA_QUERYTABLE_HXX 24 25 #include <ooo/vba/excel/XQueryTable.hpp> 26 #include <vbahelper/vbahelperinterface.hxx> 27 28 namespace css = ::com::sun::star; 29 30 // MS Excel VBA: Represents a worksheet table built from data returned from an external data source. 31 // Status: partial - only Refresh and Delete implemented; CommandText, Connection, Destination, etc. missing 32 typedef InheritedHelperInterfaceImpl1< ooo::vba::excel::XQueryTable > ScVbaQueryTableImpl_BASE; 33 34 class ScDocument; 35 #include <com/sun/star/uno/Sequence.hxx> 36 class ScVbaRange; 37 38 class ScVbaQueryTable : public ScVbaQueryTableImpl_BASE 39 { 40 private: 41 ScDocument* m_pDocument; 42 ScVbaRange* m_pParent; 43 public: 44 // MS Excel VBA: Constructs QueryTable with parent, context, document, and range. 45 // Status: implemented 46 ScVbaQueryTable( const css::uno::Reference< ov::XHelperInterface >& xParent, 47 const css::uno::Reference< css::uno::XComponentContext >& xContext, 48 ScDocument* pDocument = NULL, 49 ScVbaRange* pParent = NULL ); 50 // MS Excel VBA: Factory constructor for service instantiation. 51 // Status: implemented 52 ScVbaQueryTable( const css::uno::Sequence< css::uno::Any >& /*args*/, 53 const css::uno::Reference< css::uno::XComponentContext >& xContext ); 54 // MS Excel VBA: Destructor. 55 // Status: implemented 56 virtual ~ScVbaQueryTable(); 57 58 // MS Excel VBA: Methods - QueryTable actions 59 // MS Excel VBA: Reloads the query table from the external data source. 60 // Status: implemented - delegates to area link update 61 virtual sal_Bool SAL_CALL Refresh( const css::uno::Any& aBackgroundQuery ) 62 throw ( css::uno::RuntimeException ); 63 // MS Excel VBA: Deletes the query table and removes it from the worksheet. 64 // Status: implemented - calls LinkManager::Remove() 65 virtual void SAL_CALL Delete() throw ( css::uno::RuntimeException ); 66 67 // Missing properties (per MS Excel VBA reference): 68 // CommandText, CommandType, Connection, Destination, RefreshOnFileOpen, 69 // RefreshPeriod, RefreshStyle, SaveData, SavePassword, TextFile*, Web* 70 71 // XHelperInterface 72 // MS Excel VBA: Returns the implementation name for UNO service identification. 73 // Status: implemented - returns "ScVbaQueryTable" 74 virtual rtl::OUString& getServiceImplName(); 75 // MS Excel VBA: Returns the service names this implementation supports. 76 // Status: implemented - returns "ooo.vba.excel.QueryTable" 77 virtual css::uno::Sequence< rtl::OUString > getServiceNames(); 78 }; 79 80 #endif 81