xref: /AOO41X/main/offapi/com/sun/star/script/XLibraryContainerPassword.idl (revision d1766043198e81d0bcfc626e12893e7b4d7e31ca)
1*d1766043SAndrew Rist/**************************************************************
2cdf0e10cSrcweir *
3*d1766043SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4*d1766043SAndrew Rist * or more contributor license agreements.  See the NOTICE file
5*d1766043SAndrew Rist * distributed with this work for additional information
6*d1766043SAndrew Rist * regarding copyright ownership.  The ASF licenses this file
7*d1766043SAndrew Rist * to you under the Apache License, Version 2.0 (the
8*d1766043SAndrew Rist * "License"); you may not use this file except in compliance
9*d1766043SAndrew Rist * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir *
11*d1766043SAndrew Rist *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir *
13*d1766043SAndrew Rist * Unless required by applicable law or agreed to in writing,
14*d1766043SAndrew Rist * software distributed under the License is distributed on an
15*d1766043SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*d1766043SAndrew Rist * KIND, either express or implied.  See the License for the
17*d1766043SAndrew Rist * specific language governing permissions and limitations
18*d1766043SAndrew Rist * under the License.
19cdf0e10cSrcweir *
20*d1766043SAndrew Rist *************************************************************/
21*d1766043SAndrew Rist
22*d1766043SAndrew Rist
23cdf0e10cSrcweir#ifndef __com_sun_star_script_XLibraryContainerPassword_idl__
24cdf0e10cSrcweir#define __com_sun_star_script_XLibraryContainerPassword_idl__
25cdf0e10cSrcweir
26cdf0e10cSrcweir#ifndef __com_sun_star_uno_XInterface_idl__
27cdf0e10cSrcweir#include <com/sun/star/uno/XInterface.idl>
28cdf0e10cSrcweir#endif
29cdf0e10cSrcweir
30cdf0e10cSrcweir#ifndef __com_sun_star_lang_IllegalArgumentException_idl__
31cdf0e10cSrcweir#include <com/sun/star/lang/IllegalArgumentException.idl>
32cdf0e10cSrcweir#endif
33cdf0e10cSrcweir
34cdf0e10cSrcweir#ifndef __com_sun_star_container_NoSuchElementException_idl__
35cdf0e10cSrcweir#include <com/sun/star/container/NoSuchElementException.idl>
36cdf0e10cSrcweir#endif
37cdf0e10cSrcweir
38cdf0e10cSrcweir
39cdf0e10cSrcweir//=============================================================================
40cdf0e10cSrcweir
41cdf0e10cSrcweir module com {  module sun {  module star {  module script {
42cdf0e10cSrcweir
43cdf0e10cSrcweir//=============================================================================
44cdf0e10cSrcweir
45cdf0e10cSrcweir/**
46cdf0e10cSrcweir	Extension of XLibraryContainer to provide password functionality.
47cdf0e10cSrcweir	This interface should be implemented together with XLibraryContainer2
48cdf0e10cSrcweir	</p>
49cdf0e10cSrcweir */
50cdf0e10cSrcweirpublished interface XLibraryContainerPassword:  com::sun::star::uno::XInterface
51cdf0e10cSrcweir{
52cdf0e10cSrcweir	/**
53cdf0e10cSrcweir		Returns true if the accessed library item is protected
54cdf0e10cSrcweir		by a password.
55cdf0e10cSrcweir
56cdf0e10cSrcweir		If a library with the this name doesn't exist a
57cdf0e10cSrcweir		com::sun::star::container::NoSuchElementException is thrown.
58cdf0e10cSrcweir	 */
59cdf0e10cSrcweir	boolean isLibraryPasswordProtected( [in] string Name )
60cdf0e10cSrcweir			raises( com::sun::star::container::NoSuchElementException );
61cdf0e10cSrcweir
62cdf0e10cSrcweir	/**
63cdf0e10cSrcweir		Returns true if the accessed library item is protected by a
64cdf0e10cSrcweir		password (see isLibraryPasswordProtected) and the password
65cdf0e10cSrcweir		was already verified with verifyLibraryPassword or if an
66cdf0e10cSrcweir		initial password was set with changeLibraryPassword.
67cdf0e10cSrcweir
68cdf0e10cSrcweir		If a library with the this name doesn't exist a
69cdf0e10cSrcweir		com::sun::star::container::NoSuchElementException is thrown.
70cdf0e10cSrcweir
71cdf0e10cSrcweir		If the library exists but isn't password protected a
72cdf0e10cSrcweir		com::sun::star::lang::IllegalArgumentException is thrown.
73cdf0e10cSrcweir	 */
74cdf0e10cSrcweir	boolean isLibraryPasswordVerified( [in] string Name )
75cdf0e10cSrcweir			raises( com::sun::star::lang::IllegalArgumentException,
76cdf0e10cSrcweir					com::sun::star::container::NoSuchElementException );
77cdf0e10cSrcweir
78cdf0e10cSrcweir	/**
79cdf0e10cSrcweir		Verifies the library's password. If the correct password
80cdf0e10cSrcweir		was passed, the method returns true and further calls to
81cdf0e10cSrcweir		isLibraryPasswordVerified will also return true.
82cdf0e10cSrcweir
83cdf0e10cSrcweir		If a library with the this name doesn't exist a
84cdf0e10cSrcweir		com::sun::star::container::NoSuchElementException is thrown.
85cdf0e10cSrcweir
86cdf0e10cSrcweir		If the library exists but isn't password protected a
87cdf0e10cSrcweir		com::sun::star::lang::IllegalArgumentException is thrown.
88cdf0e10cSrcweir
89cdf0e10cSrcweir		If the library password is already verified a
90cdf0e10cSrcweir		com::sun::star::lang::IllegalArgumentException is thrown.
91cdf0e10cSrcweir	 */
92cdf0e10cSrcweir	boolean verifyLibraryPassword( [in] string Name, [in] string Password )
93cdf0e10cSrcweir			raises( com::sun::star::lang::IllegalArgumentException,
94cdf0e10cSrcweir					com::sun::star::container::NoSuchElementException );
95cdf0e10cSrcweir
96cdf0e10cSrcweir	/**
97cdf0e10cSrcweir		Changes the library's password.
98cdf0e10cSrcweir
99cdf0e10cSrcweir		If the library wasn't password protected before:
100cdf0e10cSrcweir		The OldPassword parameter has to be an empty string.
101cdf0e10cSrcweir		Afterwards calls to isLibraryPasswordProtected and
102cdf0e10cSrcweir		isLibraryPasswordVerified for this library will
103cdf0e10cSrcweir		return true.
104cdf0e10cSrcweir
105cdf0e10cSrcweir		If the library already was password protected:
106cdf0e10cSrcweir		The OldPassword parameter has to be set to the
107cdf0e10cSrcweir		previous defined password. If then the NewPassword
108cdf0e10cSrcweir		parameter is an empty string the library password
109cdf0e10cSrcweir		protection will be disabled afterwards (afterwards
110cdf0e10cSrcweir		calls to isLibraryPasswordProtected for this library
111cdf0e10cSrcweir		will return false). If the NewPassword parameter is
112cdf0e10cSrcweir		not an empty string it will accepted as the new
113cdf0e10cSrcweir		password for the library.
114cdf0e10cSrcweir
115cdf0e10cSrcweir		If a library with the this name doesn't exist but isn't
116cdf0e10cSrcweir		com::sun::star::container::NoSuchElementException is thrown.
117cdf0e10cSrcweir
118cdf0e10cSrcweir		If the library exists and is password protected and a
119cdf0e10cSrcweir		wrong OldPassword is passed to the method a
120cdf0e10cSrcweir		com::sun::star::lang::IllegalArgumentException is thrown.
121cdf0e10cSrcweir
122cdf0e10cSrcweir		If the library exists and isn't password protected and
123cdf0e10cSrcweir		the OldPassword isn't an empty string or the library is
124cdf0e10cSrcweir		read only a
125cdf0e10cSrcweir		com::sun::star::lang::IllegalArgumentException is thrown.
126cdf0e10cSrcweir	 */
127cdf0e10cSrcweir	void changeLibraryPassword( [in] string Name,
128cdf0e10cSrcweir		[in] string OldPassword, [in] string NewPassword )
129cdf0e10cSrcweir			raises( com::sun::star::lang::IllegalArgumentException,
130cdf0e10cSrcweir					com::sun::star::container::NoSuchElementException );
131cdf0e10cSrcweir
132cdf0e10cSrcweir};
133cdf0e10cSrcweir
134cdf0e10cSrcweir//=============================================================================
135cdf0e10cSrcweir
136cdf0e10cSrcweir
137cdf0e10cSrcweir}; }; }; };
138cdf0e10cSrcweir
139cdf0e10cSrcweir#endif
140