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#ifndef __com_sun_star_script_XLibraryContainerPassword_idl__
24#define __com_sun_star_script_XLibraryContainerPassword_idl__
25
26#ifndef __com_sun_star_uno_XInterface_idl__
27#include <com/sun/star/uno/XInterface.idl>
28#endif
29
30#ifndef __com_sun_star_lang_IllegalArgumentException_idl__
31#include <com/sun/star/lang/IllegalArgumentException.idl>
32#endif
33
34#ifndef __com_sun_star_container_NoSuchElementException_idl__
35#include <com/sun/star/container/NoSuchElementException.idl>
36#endif
37
38
39//=============================================================================
40
41 module com {  module sun {  module star {  module script {
42
43//=============================================================================
44
45/**
46	Extension of XLibraryContainer to provide password functionality.
47	This interface should be implemented together with XLibraryContainer2
48	</p>
49 */
50published interface XLibraryContainerPassword:  com::sun::star::uno::XInterface
51{
52	/**
53		Returns true if the accessed library item is protected
54		by a password.
55
56		If a library with the this name doesn't exist a
57		com::sun::star::container::NoSuchElementException is thrown.
58	 */
59	boolean isLibraryPasswordProtected( [in] string Name )
60			raises( com::sun::star::container::NoSuchElementException );
61
62	/**
63		Returns true if the accessed library item is protected by a
64		password (see isLibraryPasswordProtected) and the password
65		was already verified with verifyLibraryPassword or if an
66		initial password was set with changeLibraryPassword.
67
68		If a library with the this name doesn't exist a
69		com::sun::star::container::NoSuchElementException is thrown.
70
71		If the library exists but isn't password protected a
72		com::sun::star::lang::IllegalArgumentException is thrown.
73	 */
74	boolean isLibraryPasswordVerified( [in] string Name )
75			raises( com::sun::star::lang::IllegalArgumentException,
76					com::sun::star::container::NoSuchElementException );
77
78	/**
79		Verifies the library's password. If the correct password
80		was passed, the method returns true and further calls to
81		isLibraryPasswordVerified will also return true.
82
83		If a library with the this name doesn't exist a
84		com::sun::star::container::NoSuchElementException is thrown.
85
86		If the library exists but isn't password protected a
87		com::sun::star::lang::IllegalArgumentException is thrown.
88
89		If the library password is already verified a
90		com::sun::star::lang::IllegalArgumentException is thrown.
91	 */
92	boolean verifyLibraryPassword( [in] string Name, [in] string Password )
93			raises( com::sun::star::lang::IllegalArgumentException,
94					com::sun::star::container::NoSuchElementException );
95
96	/**
97		Changes the library's password.
98
99		If the library wasn't password protected before:
100		The OldPassword parameter has to be an empty string.
101		Afterwards calls to isLibraryPasswordProtected and
102		isLibraryPasswordVerified for this library will
103		return true.
104
105		If the library already was password protected:
106		The OldPassword parameter has to be set to the
107		previous defined password. If then the NewPassword
108		parameter is an empty string the library password
109		protection will be disabled afterwards (afterwards
110		calls to isLibraryPasswordProtected for this library
111		will return false). If the NewPassword parameter is
112		not an empty string it will accepted as the new
113		password for the library.
114
115		If a library with the this name doesn't exist but isn't
116		com::sun::star::container::NoSuchElementException is thrown.
117
118		If the library exists and is password protected and a
119		wrong OldPassword is passed to the method a
120		com::sun::star::lang::IllegalArgumentException is thrown.
121
122		If the library exists and isn't password protected and
123		the OldPassword isn't an empty string or the library is
124		read only a
125		com::sun::star::lang::IllegalArgumentException is thrown.
126	 */
127	void changeLibraryPassword( [in] string Name,
128		[in] string OldPassword, [in] string NewPassword )
129			raises( com::sun::star::lang::IllegalArgumentException,
130					com::sun::star::container::NoSuchElementException );
131
132};
133
134//=============================================================================
135
136
137}; }; }; };
138
139#endif
140