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 __com_sun_star_sdb_XDatabaseRegistrations_idl__ 25#define __com_sun_star_sdb_XDatabaseRegistrations_idl__ 26 27#include <com/sun/star/container/NoSuchElementException.idl> 28#include <com/sun/star/container/ElementExistException.idl> 29#include <com/sun/star/lang/IllegalArgumentException.idl> 30#include <com/sun/star/lang/IllegalAccessException.idl> 31 32//============================================================================= 33 34module com { module sun { module star { module sdb { 35 36interface XDatabaseRegistrationsListener; 37 38//============================================================================= 39 40/** provides access to the application-wide registered databases. 41 42 <p>This interface provides a mere wrapper around the respective configuration data, 43 this way hiding the concrete configuration structure from its clients. You should, 44 if possible at all, use this interface, instead of modifying or querying the configuration 45 data directly.</p> 46 47 @since OOo 3.3 48 */ 49interface XDatabaseRegistrations 50{ 51 /** determines whether a database is registered under the given name. 52 53 @throws ::com::sun::star::lang::IllegalArgumentException 54 if the given name is empty 55 */ 56 boolean hasRegisteredDatabase( [in] string Name ) 57 raises ( ::com::sun::star::lang::IllegalArgumentException 58 ); 59 60 /** returns the names of all registered databases 61 */ 62 sequence< string > 63 getRegistrationNames(); 64 65 /** returns the location of the database registered under the given name 66 67 @throws ::com::sun::star::lang::IllegalArgumentException 68 if the given name is empty 69 70 @throws ::com::sun::star::container::NoSuchElementException 71 if there is no database registered under this name 72 */ 73 string getDatabaseLocation( [in] string Name ) 74 raises ( ::com::sun::star::lang::IllegalArgumentException 75 , ::com::sun::star::container::NoSuchElementException 76 ); 77 78 /** registers a database, given by location, under a given name 79 80 @throws ::com::sun::star::lang::IllegalArgumentException 81 if the given name is empty, or the given location is invalid. 82 83 @throws ::com::sun::star::container::ElementExistException 84 if there already is a databases registered under the given name. 85 */ 86 void registerDatabaseLocation( [in] string Name, [in] string Location ) 87 raises ( ::com::sun::star::lang::IllegalArgumentException 88 , ::com::sun::star::container::ElementExistException 89 ); 90 91 /** revokes the registration of a database, given by name 92 93 @throws ::com::sun::star::lang::IllegalArgumentException 94 if the given name is empty 95 96 @throws ::com::sun::star::container::NoSuchElementException 97 if there is no database registered under this name 98 99 @throws ::com::sun::star::lang::IllegalAccessException 100 if the registration data for this database is read-only 101 */ 102 void revokeDatabaseLocation( [in] string Name ) 103 raises ( ::com::sun::star::lang::IllegalArgumentException 104 , ::com::sun::star::container::NoSuchElementException 105 , ::com::sun::star::lang::IllegalAccessException 106 ); 107 108 /** changes the location of a given database registration 109 110 @throws ::com::sun::star::lang::IllegalArgumentException 111 if the given name is empty, or the given location is invalid. 112 113 @throws ::com::sun::star::container::NoSuchElementException 114 if there is no database registered under this name 115 116 @throws ::com::sun::star::lang::IllegalAccessException 117 if the registration data for this database is read-only 118 */ 119 void changeDatabaseLocation( [in] string Name, [in] string NewLocation ) 120 raises ( ::com::sun::star::lang::IllegalArgumentException 121 , ::com::sun::star::container::NoSuchElementException 122 , ::com::sun::star::lang::IllegalAccessException 123 ); 124 125 /** determines whether the registration data for a database given by name is 126 read-only. 127 128 <p>In this case, attempts to revoke this registration will fail.</p> 129 130 @throws ::com::sun::star::lang::IllegalArgumentException 131 if the given name is empty 132 133 @throws ::com::sun::star::container::NoSuchElementException 134 if there is no database registered under this name 135 */ 136 boolean isDatabaseRegistrationReadOnly( [in] string Name ) 137 raises ( ::com::sun::star::lang::IllegalArgumentException 138 , ::com::sun::star::container::NoSuchElementException 139 ); 140 141 /** registers a listener which is notified of changes in the registered databases 142 */ 143 void addDatabaseRegistrationsListener( [in] XDatabaseRegistrationsListener Listener ); 144 145 /** revokes a previously registered listener 146 */ 147 void removeDatabaseRegistrationsListener( [in] XDatabaseRegistrationsListener Listener ); 148}; 149 150//============================================================================= 151 152}; }; }; }; 153 154//============================================================================= 155 156#endif 157