xref: /trunk/main/extensions/source/abpilot/fieldmappingimpl.hxx (revision 1ecadb572e7010ff3b3382ad9bf179dbc6efadbb)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef EXTENSIONS_ABP_FIELDMAPPINGIMPL_HXX
29 #define EXTENSIONS_ABP_FIELDMAPPINGIMPL_HXX
30 
31 #include <rtl/ustring.hxx>
32 #include "abptypes.hxx"
33 #include <com/sun/star/uno/Reference.hxx>
34 #include "addresssettings.hxx"
35 
36 namespace com { namespace sun { namespace star {
37     namespace lang {
38         class XMultiServiceFactory;
39     }
40     namespace beans {
41         class XPropertySet;
42     }
43 } } }
44 class Window;
45 
46 //.........................................................................
47 namespace abp
48 {
49 //.........................................................................
50 
51     //.....................................................................
52     namespace fieldmapping
53     {
54     //.....................................................................
55 
56         //-----------------------------------------------------------------
57         /** invokes the field mapping dialog
58             @param _rxORB
59                 service factory to use for creating UNO services
60             @param _pParent
61                 window to use as parent for the dialog and error messages
62             @param _rSettings
63                 current settings. Upon return, the field mapping member of this
64                 structure will be filled with the settings the user did in the
65                 field mapping dialog.
66         */
67         sal_Bool invokeDialog(
68             const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB,
69             class Window* _pParent,
70             const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxDataSource,
71             AddressSettings& _rSettings
72         ) SAL_THROW ( ( ) );
73 
74         //-----------------------------------------------------------------
75         /** creates a default field mapping for usage with the address book SDBC driver
76             <p>The column names as used by the SDBC driver for address books is stored in the configuration,
77             and this function creates a mapping which uses this configuration information.</p>
78         */
79         void defaultMapping(
80             const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB,
81             MapString2String& /* [out] */ _rFieldAssignment
82         ) SAL_THROW ( ( ) );
83 
84         //-----------------------------------------------------------------
85         /** writes a field mapping for the template document address source
86         */
87         void writeTemplateAddressFieldMapping(
88             const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB,
89             const MapString2String& _rFieldAssignment
90         ) SAL_THROW ( ( ) );
91 
92     //.....................................................................
93     }   // namespace fieldmapping
94     //.....................................................................
95 
96     //.....................................................................
97     namespace addressconfig
98     {
99     //.....................................................................
100 
101         //-----------------------------------------------------------------
102         /** writes the data source / table name given into the configuration, to where the template documents
103             expect it.
104         */
105         void writeTemplateAddressSource(
106             const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB,
107             const ::rtl::OUString& _rDataSourceName,
108             const ::rtl::OUString& _rTableName
109         ) SAL_THROW ( ( ) );
110 
111         /** writes the configuration entry which states the the pilot has been completed successfully
112         */
113         void markPilotSuccess(
114             const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB
115         ) SAL_THROW ( ( ) );
116 
117     //.....................................................................
118     }   // namespace addressconfig
119     //.....................................................................
120 
121 //.........................................................................
122 }   // namespace abp
123 //.........................................................................
124 
125 #endif // EXTENSIONS_ABP_FIELDMAPPINGIMPL_HXX
126 
127