1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 3 /* 4 * This file is part of the LibreOffice project. 5 * 6 * This Source Code Form is subject to the terms of the Mozilla Public 7 * License, v. 2.0. If a copy of the MPL was not distributed with this 8 * file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 * 10 * This file incorporates work covered by the following license notice: 11 * 12 * Licensed to the Apache Software Foundation (ASF) under one or more 13 * contributor license agreements. See the NOTICE file distributed 14 * with this work for additional information regarding copyright 15 * ownership. The ASF licenses this file to you under the Apache 16 * License, Version 2.0 (the "License"); you may not use this file 17 * except in compliance with the License. You may obtain a copy of 18 * the License at http://www.apache.org/licenses/LICENSE-2.0 . 19 */ 20 21 #ifndef INCLUDED_SVX_SOURCE_INC_FORMCONTROLFACTORY_HXX 22 #define INCLUDED_SVX_SOURCE_INC_FORMCONTROLFACTORY_HXX 23 24 #include "fmdocumentclassification.hxx" 25 26 #include <com/sun/star/beans/XPropertySet.hpp> 27 #include <com/sun/star/lang/XMultiServiceFactory.hpp> 28 #include <com/sun/star/util/XNumberFormats.hpp> 29 #include <com/sun/star/lang/XServiceInfo.hpp> 30 #include <com/sun/star/uno/XComponentContext.hpp> 31 #include <com/sun/star/container/XNameAccess.hpp> 32 33 #include <memory> 34 35 class SdrUnoObj; 36 namespace tools { class Rectangle; } 37 38 namespace comphelper { 39 class ComponentContext; 40 } 41 42 43 namespace svxform 44 { 45 46 struct FormControlFactory_Data; 47 48 class FormControlFactory 49 { 50 public: 51 FormControlFactory( const css::uno::Reference<css::uno::XComponentContext>& _rContext ); 52 FormControlFactory(); 53 ~FormControlFactory(); 54 55 /** initializes the given control model which is to be newly inserted into a document 56 57 @param _eDocType 58 the type of the document which the control is to be inserted into 59 @param _rxControlModel 60 the control model to be inserted 61 @param _rControlBoundRect 62 the bound rect of the control, if applicable 63 @return 64 the class ID of the control 65 */ 66 sal_Int16 initializeControlModel( 67 const DocumentType _eDocType, 68 const css::uno::Reference< css::beans::XPropertySet >& _rxControlModel, 69 const tools::Rectangle& _rControlBoundRect 70 ); 71 72 sal_Int16 initializeControlModel( const DocumentType _eDocType, const SdrUnoObj& _rObject ); 73 void initializeControlModel( const DocumentType _eDocType, const css::uno::Reference< css::beans::XPropertySet >& _rxControlModel ); 74 75 void initializeTextFieldLineEnds( 76 const css::uno::Reference< css::beans::XPropertySet >& _rxModel 77 ); 78 79 static void initializeFieldDependentProperties( 80 const css::uno::Reference< css::beans::XPropertySet >& _rxDatabaseField, 81 const css::uno::Reference< css::beans::XPropertySet >& _rxControlModel, 82 const css::uno::Reference< css::util::XNumberFormats >& _rxNumberFormats 83 ); 84 85 static OUString getDefaultName( 86 const sal_Int16 nClassId, 87 const css::uno::Reference< css::lang::XServiceInfo >& _rxObject 88 ); 89 90 static OUString getDefaultUniqueName_ByComponentType( 91 const css::uno::Reference< css::container::XNameAccess >& _rxContainer, 92 const css::uno::Reference< css::beans::XPropertySet >& _rxObject 93 ); 94 95 static OUString getUniqueName( 96 const css::uno::Reference< css::container::XNameAccess >& _rxContainer, 97 const OUString& _rBaseName 98 ); 99 100 private: 101 ::std::unique_ptr< FormControlFactory_Data > m_pData; 102 }; 103 104 105 } 106 107 108 #endif // INCLUDED_SVX_SOURCE_INC_FORMCONTROLFACTORY_HXX 109 110 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 111