Update ooo320-m1
[ooovba.git] / binfilter / inc / bf_svx / unofield.hxx
blob3950d548abb873252d68d64ce77a066fa9de4f58
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: unofield.hxx,v $
10 * $Revision: 1.5 $
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 ************************************************************************/
31 #ifndef _SVX_UNOFIELD_HXX
32 #define _SVX_UNOFIELD_HXX
34 #ifndef _COM_SUN_STAR_LANG_XUNOTUNNEL_HPP_
35 #include <com/sun/star/lang/XUnoTunnel.hpp>
36 #endif
37 #ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
38 #include <com/sun/star/beans/XPropertySet.hpp>
39 #endif
40 #ifndef _COM_SUN_STAR_BEANS_XPROPERTYSETINFO_HPP_
41 #include <com/sun/star/beans/XPropertySetInfo.hpp>
42 #endif
43 #ifndef _COM_SUN_STAR_TEXT_XTEXTFIELD_HPP_
44 #include <com/sun/star/text/XTextField.hpp>
45 #endif
46 #ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
47 #include <com/sun/star/lang/XServiceInfo.hpp>
48 #endif
49 #ifndef _CPPUHELPER_COMPONENT_HXX_
50 #include <cppuhelper/component.hxx>
51 #endif
53 #include <comphelper/servicehelper.hxx>
55 #include <bf_svx/mutxhelp.hxx>
56 namespace binfilter {
57 class SfxItemPropertySet;
59 // ids usable for the constructor
60 #define ID_DATEFIELD 0
61 #define ID_URLFIELD 1
62 #define ID_PAGEFIELD 2
63 #define ID_PAGESFIELD 3
64 #define ID_TIMEFIELD 4
65 #define ID_FILEFIELD 5
66 #define ID_TABLEFIELD 6
67 #define ID_EXT_TIMEFIELD 7
68 #define ID_EXT_FILEFIELD 8
69 #define ID_AUTHORFIELD 9
70 #define ID_MEASUREFIELD 10
71 #define ID_EXT_DATEFIELD 11
72 #define ID_UNKNOWN 12 // this must be the last entry
74 class SvxUnoFieldData_Impl;
75 class SvxFieldData;
77 class SvxUnoTextField : public SvxMutexHelper,
78 public ::cppu::OComponentHelper,
79 public ::com::sun::star::text::XTextField,
80 public ::com::sun::star::beans::XPropertySet,
81 public ::com::sun::star::lang::XServiceInfo,
82 public ::com::sun::star::lang::XUnoTunnel
84 private:
85 ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > mxAnchor;
86 SfxItemPropertySet* mpPropSet;
87 sal_Int32 mnServiceId;
88 SvxUnoFieldData_Impl* mpImpl;
90 protected:
91 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > maTypeSequence;
93 public:
94 SvxUnoTextField( sal_Int32 nServiceId ) throw();
95 SvxUnoTextField( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > xAnchor, const ::rtl::OUString& rPresentation, const SvxFieldData* pFieldData ) throw();
96 virtual ~SvxUnoTextField() throw();
98 // Intern
99 virtual sal_Int32 GetFieldId( const SvxFieldData* pFieldData ) const throw();
100 SvxFieldData* CreateFieldData() const throw();
101 void SetAnchor( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > xAnchor ) { mxAnchor = xAnchor; }
103 UNO3_GETIMPLEMENTATION_DECL( SvxUnoTextField )
105 // ::com::sun::star::uno::XInterface
106 virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
107 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
108 virtual void SAL_CALL acquire() throw();
109 virtual void SAL_CALL release() throw();
111 // ::com::sun::star::lang::XTypeProvider
112 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
113 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException);
115 // XTextField
116 virtual ::rtl::OUString SAL_CALL getPresentation( sal_Bool bShowCommand ) throw(::com::sun::star::uno::RuntimeException);
118 // XTextContent
119 virtual void SAL_CALL attach( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xTextRange ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
120 virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getAnchor( ) throw(::com::sun::star::uno::RuntimeException);
122 // ::com::sun::star::lang::XComponent
123 virtual void SAL_CALL dispose() throw(::com::sun::star::uno::RuntimeException);
124 virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener ) throw(::com::sun::star::uno::RuntimeException);
125 virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener ) throw(::com::sun::star::uno::RuntimeException);
127 // XPropertySet
128 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
129 virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
130 virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
131 virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
132 virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
133 virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
134 virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
136 // OComponentHelper
137 virtual void SAL_CALL disposing();
139 // XServiceInfo
140 virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
141 virtual ::rtl::OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException);
142 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
145 }//end of namespace binfilter
146 #endif