1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef EXTENSIONS_ABP_FIELDMAPPINGIMPL_HXX
25 #define EXTENSIONS_ABP_FIELDMAPPINGIMPL_HXX
26 
27 #include <rtl/ustring.hxx>
28 #include "abptypes.hxx"
29 #include <com/sun/star/uno/Reference.hxx>
30 #include "addresssettings.hxx"
31 
32 namespace com { namespace sun { namespace star {
33 	namespace lang {
34 		class XMultiServiceFactory;
35 	}
36     namespace beans {
37         class XPropertySet;
38     }
39 } } }
40 class Window;
41 
42 //.........................................................................
43 namespace abp
44 {
45 //.........................................................................
46 
47 	//.....................................................................
48 	namespace fieldmapping
49 	{
50 	//.....................................................................
51 
52 		//-----------------------------------------------------------------
53 		/** invokes the field mapping dialog
54 			@param _rxORB
55 				service factory to use for creating UNO services
56 			@param _pParent
57 				window to use as parent for the dialog and error messages
58 			@param _rSettings
59 				current settings. Upon return, the field mapping member of this
60                 structure will be filled with the settings the user did in the
61                 field mapping dialog.
62 		*/
63 		sal_Bool invokeDialog(
64 			const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB,
65 			class Window* _pParent,
66             const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxDataSource,
67 			AddressSettings& _rSettings
68 		) SAL_THROW ( ( ) );
69 
70 		//-----------------------------------------------------------------
71 		/** creates a default field mapping for usage with the address book SDBC driver
72 			<p>The column names as used by the SDBC driver for address books is stored in the configuration,
73 			and this function creates a mapping which uses this configuration information.</p>
74 		*/
75 		void defaultMapping(
76 			const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB,
77 			MapString2String& /* [out] */ _rFieldAssignment
78 		) SAL_THROW ( ( ) );
79 
80 		//-----------------------------------------------------------------
81 		/** writes a field mapping for the template document address source
82 		*/
83 		void writeTemplateAddressFieldMapping(
84 			const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB,
85 			const MapString2String& _rFieldAssignment
86 		) SAL_THROW ( ( ) );
87 
88 	//.....................................................................
89 	}	// namespace fieldmapping
90 	//.....................................................................
91 
92 	//.....................................................................
93 	namespace addressconfig
94 	{
95 	//.....................................................................
96 
97 		//-----------------------------------------------------------------
98 		/** writes the data source / table name given into the configuration, to where the template documents
99 			expect it.
100 		*/
101 		void writeTemplateAddressSource(
102 			const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB,
103 			const ::rtl::OUString& _rDataSourceName,
104 			const ::rtl::OUString& _rTableName
105 		) SAL_THROW ( ( ) );
106 
107 		/** writes the configuration entry which states the pilot has been completed successfully
108 		*/
109 		void markPilotSuccess(
110 			const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB
111 		) SAL_THROW ( ( ) );
112 
113 	//.....................................................................
114 	}	// namespace addressconfig
115 	//.....................................................................
116 
117 //.........................................................................
118 }	// namespace abp
119 //.........................................................................
120 
121 #endif // EXTENSIONS_ABP_FIELDMAPPINGIMPL_HXX
122 
123