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 VBA_DOCUMENTBASE_HXX 24 #define VBA_DOCUMENTBASE_HXX 25 26 #include <com/sun/star/frame/XModel.hpp> 27 #include <ooo/vba/XDocumentBase.hpp> 28 #include <vbahelper/vbahelperinterface.hxx> 29 30 typedef InheritedHelperInterfaceImpl1< ooo::vba::XDocumentBase > VbaDocumentBase_BASE; 31 32 class VBAHELPER_DLLPUBLIC VbaDocumentBase : public VbaDocumentBase_BASE 33 { 34 protected: 35 css::uno::Reference< css::frame::XModel > mxModel; 36 css::uno::Reference< css::uno::XInterface > mxVBProject; 37 protected: getModel()38 virtual css::uno::Reference< css::frame::XModel > getModel() { return mxModel; } 39 VbaDocumentBase( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext); 40 public: 41 VbaDocumentBase( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, 42 css::uno::Reference< css::frame::XModel > xModel ); 43 VbaDocumentBase( css::uno::Sequence< css::uno::Any > const& aArgs, css::uno::Reference< css::uno::XComponentContext >const& xContext ); ~VbaDocumentBase()44 virtual ~VbaDocumentBase() {} 45 46 // Attributes 47 virtual ::rtl::OUString SAL_CALL getName() throw (css::uno::RuntimeException); 48 virtual ::rtl::OUString SAL_CALL getPath() throw (css::uno::RuntimeException); 49 virtual ::rtl::OUString SAL_CALL getFullName() throw (css::uno::RuntimeException); 50 virtual sal_Bool SAL_CALL getSaved() throw (css::uno::RuntimeException); 51 virtual void SAL_CALL setSaved( sal_Bool bSave ) throw (css::uno::RuntimeException); 52 virtual css::uno::Any SAL_CALL getVBProject() throw (css::uno::RuntimeException); 53 54 // Methods 55 virtual void SAL_CALL Close( const css::uno::Any &bSaveChanges, 56 const css::uno::Any &aFileName, 57 const css::uno::Any &bRouteWorkbook ) throw (css::uno::RuntimeException); 58 virtual void SAL_CALL Protect( const css::uno::Any & aPassword ) throw (css::uno::RuntimeException); 59 virtual void SAL_CALL Unprotect( const css::uno::Any &aPassword ) throw (css::uno::RuntimeException); 60 virtual void SAL_CALL Save() throw (css::uno::RuntimeException); 61 virtual void SAL_CALL Activate() throw (css::uno::RuntimeException); 62 63 // XHelperInterface 64 virtual rtl::OUString& getServiceImplName(); 65 virtual css::uno::Sequence<rtl::OUString> getServiceNames(); 66 }; 67 68 #endif /* VBA_DOCUMENTBASE_HXX */ 69