Update ooo320-m1
[ooovba.git] / sw / source / ui / vba / vbafield.hxx
blob20d049974a474953d0e883cc27a05e75ff259404
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: $
10 * $Revision: $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef SW_VBA_FIELD_HXX
31 #define SW_VBA_FIELD_HXX
32 #include <vbahelper/vbahelperinterface.hxx>
33 #include <com/sun/star/text/XTextDocument.hpp>
34 #include <com/sun/star/text/XTextField.hpp>
35 #include <ooo/vba/word/XField.hpp>
36 #include <ooo/vba/word/XFields.hpp>
37 #include <vbahelper/vbacollectionimpl.hxx>
39 typedef InheritedHelperInterfaceImpl1< ooo::vba::word::XField > SwVbaField_BASE;
41 class SwVbaField : public SwVbaField_BASE
43 css::uno::Reference< css::text::XTextDocument > mxTextDocument;
44 css::uno::Reference< css::text::XTextField > mxTextField;
45 public:
46 SwVbaField( const css::uno::Reference< ooo::vba::XHelperInterface >& rParent, const css::uno::Reference< css::uno::XComponentContext >& rContext, const css::uno::Reference< css::text::XTextDocument >& rDocument, const css::uno::Reference< css::text::XTextField >& xTextField) throw ( css::uno::RuntimeException);;
48 // XHelperInterface
49 virtual rtl::OUString& getServiceImplName();
50 virtual css::uno::Sequence<rtl::OUString> getServiceNames();
53 // *** SwVbaFields ***********************************************
55 typedef CollTestImplHelper< ov::word::XFields > SwVbaFields_BASE;
57 class SwVbaFields : public SwVbaFields_BASE
59 css::uno::Reference< css::frame::XModel > mxModel;
60 css::uno::Reference< css::lang::XMultiServiceFactory > mxMSF;
61 private:
62 css::uno::Reference< css::text::XTextField > Create_Field_FileName( const rtl::OUString _text ) throw (css::uno::RuntimeException);
64 public:
65 SwVbaFields( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > & xContext, const css::uno::Reference< css::frame::XModel >& xModel );
66 // XFields
67 virtual css::uno::Reference< ::ooo::vba::word::XField > SAL_CALL Add( const css::uno::Reference< ::ooo::vba::word::XRange >& Range, const css::uno::Any& Type, const css::uno::Any& Text, const css::uno::Any& PreserveFormatting ) throw (css::uno::RuntimeException);
68 virtual sal_Int32 SAL_CALL Update() throw (css::uno::RuntimeException);
69 // XEnumerationAccess
70 virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException);
71 virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException);
72 // ScVbaCollectionBaseImpl
73 virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource );
75 // XHelperInterface
76 virtual rtl::OUString& getServiceImplName();
77 virtual css::uno::Sequence<rtl::OUString> getServiceNames();
80 #endif