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