1/*************************************************************************
2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3 *
4 * Copyright 2000, 2010 Oracle and/or its affiliates.
5 *
6 * OpenOffice.org - a multi-platform office productivity suite
7 *
8 * This file is part of OpenOffice.org.
9 *
10 * OpenOffice.org is free software: you can redistribute it and/or modify
11 * it under the terms of the GNU Lesser General Public License version 3
12 * only, as published by the Free Software Foundation.
13 *
14 * OpenOffice.org is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 * GNU Lesser General Public License version 3 for more details
18 * (a copy is included in the LICENSE file that accompanied this code).
19 *
20 * You should have received a copy of the GNU Lesser General Public License
21 * version 3 along with OpenOffice.org.  If not, see
22 * <http://www.openoffice.org/license.html>
23 * for a copy of the LGPLv3 License.
24 *
25************************************************************************/
26
27#ifndef __com_sun_star_sdb_XDatabaseRegistrations_idl__
28#define __com_sun_star_sdb_XDatabaseRegistrations_idl__
29
30#include <com/sun/star/container/NoSuchElementException.idl>
31#include <com/sun/star/container/ElementExistException.idl>
32#include <com/sun/star/lang/IllegalArgumentException.idl>
33#include <com/sun/star/lang/IllegalAccessException.idl>
34
35//=============================================================================
36
37module com { module sun { module star { module sdb {
38
39interface XDatabaseRegistrationsListener;
40
41//=============================================================================
42
43/** provides access to the application-wide registered databases.
44
45    <p>This interface provides a mere wrapper around the respective configuration data,
46    this way hiding the concrete configuration structure from its clients. You should,
47    if possible at all, use this interface, instead of modifying or querying the configuration
48    data directly.</p>
49
50    @since OOo 3.3
51 */
52interface XDatabaseRegistrations
53{
54    /** determines whether a database is registered under the given name.
55
56        @throws ::com::sun::star::lang::IllegalArgumentException
57            if the given name is empty
58    */
59    boolean hasRegisteredDatabase( [in] string Name )
60        raises  (   ::com::sun::star::lang::IllegalArgumentException
61                );
62
63    /** returns the names of all registered databases
64    */
65    sequence< string >
66            getRegistrationNames();
67
68    /** returns the location of the database registered under the given name
69
70        @throws ::com::sun::star::lang::IllegalArgumentException
71            if the given name is empty
72
73        @throws ::com::sun::star::container::NoSuchElementException
74            if there is no database registered under this name
75    */
76    string  getDatabaseLocation( [in] string Name )
77        raises  (   ::com::sun::star::lang::IllegalArgumentException
78                ,   ::com::sun::star::container::NoSuchElementException
79                );
80
81    /** registers a database, given by location, under a given name
82
83        @throws ::com::sun::star::lang::IllegalArgumentException
84            if the given name is empty, or the given location is invalid.
85
86        @throws ::com::sun::star::container::ElementExistException
87            if there already is a databases registered under the given name.
88    */
89    void    registerDatabaseLocation( [in] string Name, [in] string Location )
90        raises  (   ::com::sun::star::lang::IllegalArgumentException
91                ,   ::com::sun::star::container::ElementExistException
92                );
93
94    /** revokes the registration of a database, given by name
95
96        @throws ::com::sun::star::lang::IllegalArgumentException
97            if the given name is empty
98
99        @throws ::com::sun::star::container::NoSuchElementException
100            if there is no database registered under this name
101
102        @throws ::com::sun::star::lang::IllegalAccessException
103            if the registration data for this database is read-only
104    */
105    void    revokeDatabaseLocation( [in] string Name )
106        raises  (   ::com::sun::star::lang::IllegalArgumentException
107                ,   ::com::sun::star::container::NoSuchElementException
108                ,   ::com::sun::star::lang::IllegalAccessException
109                );
110
111    /** changes the location of a given database registration
112
113        @throws ::com::sun::star::lang::IllegalArgumentException
114            if the given name is empty, or the given location is invalid.
115
116        @throws ::com::sun::star::container::NoSuchElementException
117            if there is no database registered under this name
118
119        @throws ::com::sun::star::lang::IllegalAccessException
120            if the registration data for this database is read-only
121    */
122    void    changeDatabaseLocation( [in] string Name, [in] string NewLocation )
123        raises  (   ::com::sun::star::lang::IllegalArgumentException
124                ,   ::com::sun::star::container::NoSuchElementException
125                ,   ::com::sun::star::lang::IllegalAccessException
126                );
127
128    /** determines whether the registration data for a database given by name is
129        read-only.
130
131        <p>In this case, attempts to revoke this registration will fail.</p>
132
133        @throws ::com::sun::star::lang::IllegalArgumentException
134            if the given name is empty
135
136        @throws ::com::sun::star::container::NoSuchElementException
137            if there is no database registered under this name
138    */
139    boolean isDatabaseRegistrationReadOnly( [in] string Name )
140        raises  (   ::com::sun::star::lang::IllegalArgumentException
141                ,   ::com::sun::star::container::NoSuchElementException
142                );
143
144    /** registers a listener which is notified of changes in the registered databases
145    */
146    void    addDatabaseRegistrationsListener( [in] XDatabaseRegistrationsListener Listener );
147
148    /** revokes a previously registered listener
149    */
150    void    removeDatabaseRegistrationsListener( [in] XDatabaseRegistrationsListener Listener );
151};
152
153//=============================================================================
154
155}; }; }; };
156
157//=============================================================================
158
159#endif
160