merge the formfield patch from ooo-build
[ooovba.git] / svx / source / inc / formcontrolfactory.hxx
blobc157a5db4ef5fa6d8b44a2f5f87ab086910e3c57
2 /*************************************************************************
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: formcontrolfactory.hxx,v $
11 * $Revision: 1.1.2.1 $
13 * This file is part of OpenOffice.org.
15 * OpenOffice.org is free software: you can redistribute it and/or modify
16 * it under the terms of the GNU Lesser General Public License version 3
17 * only, as published by the Free Software Foundation.
19 * OpenOffice.org is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU Lesser General Public License version 3 for more details
23 * (a copy is included in the LICENSE file that accompanied this code).
25 * You should have received a copy of the GNU Lesser General Public License
26 * version 3 along with OpenOffice.org. If not, see
27 * <http://www.openoffice.org/license.html>
28 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef SVX_FORMCONTROLMANAGER_HXX
32 #define SVX_FORMCONTROLMANAGER_HXX
34 #include "fmdocumentclassification.hxx"
36 /** === begin UNO includes === **/
37 #include <com/sun/star/beans/XPropertySet.hpp>
38 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
39 #include <com/sun/star/util/XNumberFormats.hpp>
40 #include <com/sun/star/lang/XServiceInfo.hpp>
41 #include <com/sun/star/container/XNameAccess.hpp>
42 /** === end UNO includes === **/
44 #include <memory>
46 class SdrUnoObj;
47 class Rectangle;
49 namespace comphelper {
50 class ComponentContext;
53 //........................................................................
54 namespace svxform
56 //........................................................................
58 //====================================================================
59 //= FormControlFactory
60 //====================================================================
61 struct FormControlFactory_Data;
63 class FormControlFactory
65 public:
66 FormControlFactory( const ::comphelper::ComponentContext& _rContext );
67 ~FormControlFactory();
69 /** initializes the given control model which is to be newly inserted into a document
71 @param _eDocType
72 the type of the document which the control is to be inserted into
73 @param _rxControlModel
74 the control model to be inserted
75 @param _rControlBoundRect
76 the bound rect of the control, if applicable
77 @return
78 the class ID of the control
80 sal_Int16 initializeControlModel(
81 const DocumentType _eDocType,
82 const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxControlModel,
83 const Rectangle& _rControlBoundRect
86 sal_Int16 initializeControlModel( const DocumentType _eDocType, const SdrUnoObj& _rObject );
87 sal_Int16 initializeControlModel( const DocumentType _eDocType, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxControlModel );
89 void initializeTextFieldLineEnds(
90 const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxModel
93 void initializeFieldDependentProperties(
94 const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxDatabaseField,
95 const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxControlModel,
96 const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormats >& _rxNumberFormats
99 static ::rtl::OUString getDefaultName(
100 const sal_Int16 nClassId,
101 const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XServiceInfo >& _rxObject
104 static ::rtl::OUString getDefaultUniqueName_ByComponentType(
105 const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& _rxContainer,
106 const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxObject
109 static ::rtl::OUString getUniqueName(
110 const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& _rxContainer,
111 const ::rtl::OUString& _rBaseName
114 private:
115 ::std::auto_ptr< FormControlFactory_Data > m_pData;
118 //........................................................................
119 } // namespace svxform
120 //........................................................................
122 #endif // SVX_FORMCONTROLMANAGER_HXX