1*3334a7e6SAndrew Rist /************************************************************** 2*3334a7e6SAndrew Rist * 3*3334a7e6SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*3334a7e6SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*3334a7e6SAndrew Rist * distributed with this work for additional information 6*3334a7e6SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*3334a7e6SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*3334a7e6SAndrew Rist * "License"); you may not use this file except in compliance 9*3334a7e6SAndrew Rist * with the License. You may obtain a copy of the License at 10*3334a7e6SAndrew Rist * 11*3334a7e6SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*3334a7e6SAndrew Rist * 13*3334a7e6SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*3334a7e6SAndrew Rist * software distributed under the License is distributed on an 15*3334a7e6SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*3334a7e6SAndrew Rist * KIND, either express or implied. See the License for the 17*3334a7e6SAndrew Rist * specific language governing permissions and limitations 18*3334a7e6SAndrew Rist * under the License. 19*3334a7e6SAndrew Rist * 20*3334a7e6SAndrew Rist *************************************************************/ 21cdf0e10cSrcweir 22*3334a7e6SAndrew Rist 23*3334a7e6SAndrew Rist 24cdf0e10cSrcweir 25cdf0e10cSrcweir #ifndef SVX_FORMCONTROLMANAGER_HXX 26cdf0e10cSrcweir #define SVX_FORMCONTROLMANAGER_HXX 27cdf0e10cSrcweir 28cdf0e10cSrcweir #include "fmdocumentclassification.hxx" 29cdf0e10cSrcweir 30cdf0e10cSrcweir /** === begin UNO includes === **/ 31cdf0e10cSrcweir #include <com/sun/star/beans/XPropertySet.hpp> 32cdf0e10cSrcweir #include <com/sun/star/lang/XMultiServiceFactory.hpp> 33cdf0e10cSrcweir #include <com/sun/star/util/XNumberFormats.hpp> 34cdf0e10cSrcweir #include <com/sun/star/lang/XServiceInfo.hpp> 35cdf0e10cSrcweir #include <com/sun/star/container/XNameAccess.hpp> 36cdf0e10cSrcweir /** === end UNO includes === **/ 37cdf0e10cSrcweir 38cdf0e10cSrcweir #include <memory> 39cdf0e10cSrcweir 40cdf0e10cSrcweir class SdrUnoObj; 41cdf0e10cSrcweir class Rectangle; 42cdf0e10cSrcweir 43cdf0e10cSrcweir namespace comphelper { 44cdf0e10cSrcweir class ComponentContext; 45cdf0e10cSrcweir } 46cdf0e10cSrcweir 47cdf0e10cSrcweir //........................................................................ 48cdf0e10cSrcweir namespace svxform 49cdf0e10cSrcweir { 50cdf0e10cSrcweir //........................................................................ 51cdf0e10cSrcweir 52cdf0e10cSrcweir //==================================================================== 53cdf0e10cSrcweir //= FormControlFactory 54cdf0e10cSrcweir //==================================================================== 55cdf0e10cSrcweir struct FormControlFactory_Data; 56cdf0e10cSrcweir 57cdf0e10cSrcweir class FormControlFactory 58cdf0e10cSrcweir { 59cdf0e10cSrcweir public: 60cdf0e10cSrcweir FormControlFactory( const ::comphelper::ComponentContext& _rContext ); 61cdf0e10cSrcweir ~FormControlFactory(); 62cdf0e10cSrcweir 63cdf0e10cSrcweir /** initializes the given control model which is to be newly inserted into a document 64cdf0e10cSrcweir 65cdf0e10cSrcweir @param _eDocType 66cdf0e10cSrcweir the type of the document which the control is to be inserted into 67cdf0e10cSrcweir @param _rxControlModel 68cdf0e10cSrcweir the control model to be inserted 69cdf0e10cSrcweir @param _rControlBoundRect 70cdf0e10cSrcweir the bound rect of the control, if applicable 71cdf0e10cSrcweir @return 72cdf0e10cSrcweir the class ID of the control 73cdf0e10cSrcweir */ 74cdf0e10cSrcweir sal_Int16 initializeControlModel( 75cdf0e10cSrcweir const DocumentType _eDocType, 76cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxControlModel, 77cdf0e10cSrcweir const Rectangle& _rControlBoundRect 78cdf0e10cSrcweir ); 79cdf0e10cSrcweir 80cdf0e10cSrcweir sal_Int16 initializeControlModel( const DocumentType _eDocType, const SdrUnoObj& _rObject ); 81cdf0e10cSrcweir sal_Int16 initializeControlModel( const DocumentType _eDocType, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxControlModel ); 82cdf0e10cSrcweir 83cdf0e10cSrcweir void initializeTextFieldLineEnds( 84cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxModel 85cdf0e10cSrcweir ); 86cdf0e10cSrcweir 87cdf0e10cSrcweir void initializeFieldDependentProperties( 88cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxDatabaseField, 89cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxControlModel, 90cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormats >& _rxNumberFormats 91cdf0e10cSrcweir ); 92cdf0e10cSrcweir 93cdf0e10cSrcweir static ::rtl::OUString getDefaultName( 94cdf0e10cSrcweir const sal_Int16 nClassId, 95cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XServiceInfo >& _rxObject 96cdf0e10cSrcweir ); 97cdf0e10cSrcweir 98cdf0e10cSrcweir static ::rtl::OUString getDefaultUniqueName_ByComponentType( 99cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& _rxContainer, 100cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxObject 101cdf0e10cSrcweir ); 102cdf0e10cSrcweir 103cdf0e10cSrcweir static ::rtl::OUString getUniqueName( 104cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& _rxContainer, 105cdf0e10cSrcweir const ::rtl::OUString& _rBaseName 106cdf0e10cSrcweir ); 107cdf0e10cSrcweir 108cdf0e10cSrcweir private: 109cdf0e10cSrcweir ::std::auto_ptr< FormControlFactory_Data > m_pData; 110cdf0e10cSrcweir }; 111cdf0e10cSrcweir 112cdf0e10cSrcweir //........................................................................ 113cdf0e10cSrcweir } // namespace svxform 114cdf0e10cSrcweir //........................................................................ 115cdf0e10cSrcweir 116cdf0e10cSrcweir #endif // SVX_FORMCONTROLMANAGER_HXX 117