Version 3.6.0.4, tag libreoffice-3.6.0.4
[LibreOffice.git] / svx / source / inc / formcontrolfactory.hxx
blob94668deba402cbf866dfb9a8c6a2982cca46567f
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
29 #ifndef SVX_FORMCONTROLMANAGER_HXX
30 #define SVX_FORMCONTROLMANAGER_HXX
32 #include "fmdocumentclassification.hxx"
34 /** === begin UNO includes === **/
35 #include <com/sun/star/beans/XPropertySet.hpp>
36 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
37 #include <com/sun/star/util/XNumberFormats.hpp>
38 #include <com/sun/star/lang/XServiceInfo.hpp>
39 #include <com/sun/star/container/XNameAccess.hpp>
40 /** === end UNO includes === **/
42 #include <memory>
44 class SdrUnoObj;
45 class Rectangle;
47 namespace comphelper {
48 class ComponentContext;
51 //........................................................................
52 namespace svxform
54 //........................................................................
56 //====================================================================
57 //= FormControlFactory
58 //====================================================================
59 struct FormControlFactory_Data;
61 class FormControlFactory
63 public:
64 FormControlFactory( const ::comphelper::ComponentContext& _rContext );
65 ~FormControlFactory();
67 /** initializes the given control model which is to be newly inserted into a document
69 @param _eDocType
70 the type of the document which the control is to be inserted into
71 @param _rxControlModel
72 the control model to be inserted
73 @param _rControlBoundRect
74 the bound rect of the control, if applicable
75 @return
76 the class ID of the control
78 sal_Int16 initializeControlModel(
79 const DocumentType _eDocType,
80 const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxControlModel,
81 const Rectangle& _rControlBoundRect
84 sal_Int16 initializeControlModel( const DocumentType _eDocType, const SdrUnoObj& _rObject );
85 sal_Int16 initializeControlModel( const DocumentType _eDocType, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxControlModel );
87 void initializeTextFieldLineEnds(
88 const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxModel
91 void initializeFieldDependentProperties(
92 const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxDatabaseField,
93 const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxControlModel,
94 const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormats >& _rxNumberFormats
97 static ::rtl::OUString getDefaultName(
98 const sal_Int16 nClassId,
99 const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XServiceInfo >& _rxObject
102 static ::rtl::OUString getDefaultUniqueName_ByComponentType(
103 const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& _rxContainer,
104 const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxObject
107 static ::rtl::OUString getUniqueName(
108 const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& _rxContainer,
109 const ::rtl::OUString& _rBaseName
112 private:
113 ::std::auto_ptr< FormControlFactory_Data > m_pData;
116 //........................................................................
117 } // namespace svxform
118 //........................................................................
120 #endif // SVX_FORMCONTROLMANAGER_HXX
122 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */