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 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_svx.hxx"
26 
27 // === includes (declaration) ============================================
28 #include "svx/databaseregistrationui.hxx"
29 
30 // === includes (UNO) ====================================================
31 // === /includes (UNO) ===================================================
32 
33 // === includes (project) ================================================
34 #include <svx/svxdlg.hxx>
35 #ifndef _SVX_DIALOGS_HRC
36 #include <svx/dialogs.hrc>
37 #endif
38 //#include "connpooloptions.hxx"
39 // === /includes (project) ===============================================
40 
41 // === includes (global) =================================================
42 #include <sfx2/app.hxx>
43 #include <svl/itemset.hxx>
44 #include <vcl/msgbox.hxx>
45 // === /includes (global) ================================================
46 
47 namespace svx
48 {
administrateDatabaseRegistration(Window * _parentWindow)49     sal_uInt16 administrateDatabaseRegistration( Window* _parentWindow )
50     {
51         sal_uInt16 nResult = RET_CANCEL;
52 
53         SfxItemSet aRegistrationItems( SFX_APP()->GetPool(), SID_SB_DB_REGISTER, SID_SB_DB_REGISTER, 0 );
54 
55         SvxAbstractDialogFactory* pDialogFactory = SvxAbstractDialogFactory::Create();
56         ::std::auto_ptr< SfxAbstractDialog > pDialog;
57         if ( pDialogFactory )
58             pDialog.reset( pDialogFactory->CreateSfxDialog( _parentWindow, aRegistrationItems, NULL, RID_SFXPAGE_DBREGISTER ) );
59         if ( pDialog.get() )
60             nResult = pDialog->Execute();
61 
62         return nResult;
63     }
64 
65 }   // namespace svx
66