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_frame_XUntitledNumbers_idl__ 24#define __com_sun_star_frame_XUntitledNumbers_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//============================================================================= 35 36 module com { module sun { module star { module frame { 37 38//============================================================================= 39/** knows all currently used and all free numbers for using with untitled 40 but counted objects. 41 */ 42interface XUntitledNumbers : com::sun::star::uno::XInterface 43{ 44 //------------------------------------------------------------------------- 45 /** calli has to lease a number befor he can use it within in its own title. 46 47 Such number must be freed after using e.g. while the object was closed or 48 get's another title (e.g. by saving a document to a real location on disc). 49 50 @param xComponent 51 the component which has to be registered for the leased number. 52 53 @return the new number for these object or 0 if no further numbers are available. 54 55 @throws [IllegalArgumentException] 56 if an invalid object reference was provided to this method. 57 */ 58 long leaseNumber ( [in] com::sun::star::uno::XInterface xComponent ) 59 raises (com::sun::star::lang::IllegalArgumentException); 60 61 //------------------------------------------------------------------------- 62 /** has to be used to mark those number as "free for using". 63 64 If the reqistered component does not use such leased number any longer 65 it has to be released so it can be used for new components. 66 67 Note: calling this method with an unknown (but normally valid number) 68 has to be ignored. No exceptions - no errors. 69 70 @param nNumber 71 specify number for release. 72 73 @throws [IllegalArgumentException] 74 if the given number is the special value 0. 75 */ 76 void releaseNumber ( [in] long nNumber ) 77 raises (com::sun::star::lang::IllegalArgumentException); 78 79 //------------------------------------------------------------------------- 80 /** does the same then releaseNumber () but it searches the corresponding 81 number for the specified component and deregister it. 82 83 @param xComponent 84 the component for deregistration. 85 86 @throws [IllegalArgumentException] 87 if an invalid object reference was provided to this method. 88 */ 89 void releaseNumberForComponent ( [in] com::sun::star::uno::XInterface xComponent ) 90 raises (com::sun::star::lang::IllegalArgumentException); 91 92 //------------------------------------------------------------------------- 93 /** returns the localized string value to be used for untitles objects in 94 combination with the leased number. 95 96 Note: Such string already contains leading spaces/tabs etcpp. ! 97 The only thing which an outside code has todo then ... adding a leased number 98 to the string. 99 100 @return the localized string for untitled components. 101 */ 102 string getUntitledPrefix (); 103}; 104 105//============================================================================= 106 107}; }; }; }; 108 109#endif 110