Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / offapi / com / sun / star / frame / XUntitledNumbers.idl
blob231707b5e7b29b63c9ab361b07ed868658359b83
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef __com_sun_star_frame_XUntitledNumbers_idl__
20 #define __com_sun_star_frame_XUntitledNumbers_idl__
22 #include <com/sun/star/uno/XInterface.idl>
23 #include <com/sun/star/lang/IllegalArgumentException.idl>
26 module com { module sun { module star { module frame {
28 /** knows all currently used and all free numbers for using with untitled
29 but counted objects.
31 interface XUntitledNumbers : com::sun::star::uno::XInterface
33 /** callee has to lease a number before he can use it within in its own title.
35 Such number must be freed after using e.g. while the object was closed or
36 gets another title (e.g. by saving a document to a real location on disc).
38 @param xComponent
39 the component which has to be registered for the leased number.
41 @return the new number for these object or 0 if no further numbers are available.
43 @throws [IllegalArgumentException]
44 if an invalid object reference was provided to this method.
46 long leaseNumber ( [in] com::sun::star::uno::XInterface xComponent )
47 raises (com::sun::star::lang::IllegalArgumentException);
49 /** has to be used to mark those number as "free for using".
51 If the registered component does not use such leased number any longer
52 it has to be released so it can be used for new components.
54 Note: calling this method with an unknown (but normally valid number)
55 has to be ignored. No exceptions - no errors.
57 @param nNumber
58 specify number for release.
60 @throws [IllegalArgumentException]
61 if the given number is the special value 0.
63 void releaseNumber ( [in] long nNumber )
64 raises (com::sun::star::lang::IllegalArgumentException);
66 /** does the same then releaseNumber () but it searches the corresponding
67 number for the specified component and deregister it.
69 @param xComponent
70 the component for deregistration.
72 @throws [IllegalArgumentException]
73 if an invalid object reference was provided to this method.
75 void releaseNumberForComponent ( [in] com::sun::star::uno::XInterface xComponent )
76 raises (com::sun::star::lang::IllegalArgumentException);
78 /** returns the localized string value to be used for untitled objects in
79 combination with the leased number.
81 Note: Such string already contains leading spaces/tabs etc. !
82 The only thing which an outside code has todo then ... adding a leased number
83 to the string.
85 @return the localized string for untitled components.
87 string getUntitledPrefix ();
91 }; }; }; };
93 #endif
95 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */