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