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 #ifndef SC_VBA_WORKBOOK_HXX 24 #define SC_VBA_WORKBOOK_HXX 25 26 #include <com/sun/star/frame/XModel.hpp> 27 #include <ooo/vba/excel/XWorkbook.hpp> 28 #include <vbahelper/vbahelperinterface.hxx> 29 #include <vbahelper/vbadocumentbase.hxx> 30 31 class ScModelObj; 32 33 typedef cppu::ImplInheritanceHelper1< VbaDocumentBase, ov::excel::XWorkbook > ScVbaWorkbook_BASE; 34 35 class ScVbaWorkbook : public ScVbaWorkbook_BASE 36 { 37 static css::uno::Sequence< sal_Int32 > ColorData; 38 void initColorData( const css::uno::Sequence< sal_Int32 >& sColors ); 39 void init(); 40 protected: 41 42 ScVbaWorkbook( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext); 43 public: 44 ScVbaWorkbook( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, 45 css::uno::Reference< css::frame::XModel > xModel ); 46 ScVbaWorkbook( css::uno::Sequence< css::uno::Any > const& aArgs, css::uno::Reference< css::uno::XComponentContext >const& xContext ); ~ScVbaWorkbook()47 virtual ~ScVbaWorkbook() {} 48 49 // Attributes 50 virtual ::sal_Bool SAL_CALL getProtectStructure() throw (css::uno::RuntimeException); 51 virtual css::uno::Reference< ov::excel::XWorksheet > SAL_CALL getActiveSheet() throw (css::uno::RuntimeException); 52 virtual ::sal_Bool SAL_CALL getPrecisionAsDisplayed() throw (css::uno::RuntimeException); 53 virtual void SAL_CALL setPrecisionAsDisplayed( sal_Bool _precisionAsDisplayed ) throw (css::uno::RuntimeException); 54 55 // Methods 56 virtual css::uno::Any SAL_CALL Worksheets( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); 57 virtual css::uno::Any SAL_CALL Sheets( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); 58 virtual css::uno::Any SAL_CALL Windows( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); 59 virtual void SAL_CALL Activate() throw (css::uno::RuntimeException); 60 // Amelia Wang 61 virtual css::uno::Any SAL_CALL Names( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); 62 63 virtual css::uno::Any SAL_CALL Styles( const css::uno::Any& Item ) throw (css::uno::RuntimeException); 64 virtual void SAL_CALL ResetColors( ) throw (css::script::BasicErrorException, css::uno::RuntimeException); 65 virtual css::uno::Any SAL_CALL Colors( const css::uno::Any& Index ) throw (css::script::BasicErrorException, css::uno::RuntimeException); 66 virtual ::sal_Int32 SAL_CALL FileFormat( ) throw (css::script::BasicErrorException, css::uno::RuntimeException); 67 virtual void SAL_CALL SaveCopyAs( const rtl::OUString& Filename ) throw ( css::uno::RuntimeException); 68 // code name 69 virtual ::rtl::OUString SAL_CALL getCodeName() throw ( css::uno::RuntimeException); 70 71 // XHelperInterface 72 virtual rtl::OUString& getServiceImplName(); 73 virtual css::uno::Sequence<rtl::OUString> getServiceNames(); 74 }; 75 76 #endif /* SC_VBA_WORKBOOK_HXX */ 77