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_util_XAtomServer_idl__ 24#define __com_sun_star_util_XAtomServer_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_util_AtomDescription_idl__ 31#include <com/sun/star/util/AtomDescription.idl> 32#endif 33 34#ifndef __com_sun_star_util_AtomClassRequest_idl__ 35#include <com/sun/star/util/AtomClassRequest.idl> 36#endif 37 38 39module com 40{ 41module sun 42{ 43module star 44{ 45module util 46{ 47 48/** an interface to map between <i>string</i>s and <i>id</i>s 49 50 <p>a note on atoms:<br> 51 Atoms are abbreviations for strings. 52 When a string gets registered, it is assigned a numeric id 53 so that said string can always be referred to by this id. 54 This way strings have to be transported only once over remote connections. 55 Valid ids are (in this implementation) non zero, signed 32 bit values. 56 An atom of 0 means that the string in question is not registered</p> 57 58 <p>Additionally there is the abstraction of atom class:<br> 59 Atoms are grouped into classes, so that an id can be assigned 60 to multiple strings, depending on the class context. The main 61 advantage of this is that atoms in one class may be kept 62 to small numbers, so that bandwidth can be reduced by sending 63 the atoms only as 16 bit values. Note that it is up to the user in this 64 case to handle overflows.</p> 65*/ 66 67published interface XAtomServer : com::sun::star::uno::XInterface 68{ 69 /** returns a whole atom class 70 71 @param atomClass 72 which class to return 73 74 @returns 75 the descriptions for all atoms of class <code>atomClass</code> 76 */ 77 sequence< AtomDescription > getClass( [in] long atomClass ); 78 /** returns mutltiple atom classes 79 80 @param atomClasses 81 which classes to return 82 83 @returns 84 the descriptions for all atoms of the requested classes 85 */ 86 sequence< sequence< AtomDescription > > getClasses( [in] sequence< long > atomClasses ); 87 /** returns the strings for an arbitrary amount of atoms of multiple classes 88 89 @param atoms 90 describes which strings to return 91 92 @returns 93 the strings for the requested atoms 94 */ 95 sequence< string > getAtomDescriptions( [in] sequence< AtomClassRequest > atoms ); 96 97 //----------------------------------------------------------------------- 98 /** returns the atoms that have been registered to a class after an 99 already known atom 100 101 <p>Hint to implementor: using ascending atoms is the easiest way 102 to decide, which atoms are recent.</p> 103 104 @param atomClass 105 the class in question 106 107 @param atom 108 the last known atom 109 110 @returns 111 all atom description that have been added to class 112 <code>atomClass</code> after <code>atom</code> 113 */ 114 sequence< AtomDescription > getRecentAtoms( [in] long atomClass, [in] long atom ); 115 116 //----------------------------------------------------------------------- 117 /** registers or searches for a string 118 119 @param atomClass 120 the class of atoms in question 121 122 @param description 123 the string in question 124 125 @param create 126 if true a new atom will be created for an unknown string 127 else the invalid atom (0) will be returned for an unknown string 128 129 @returns 130 the atom for the string <code>description</code> 131 */ 132 long getAtom( [in] long atomClass, [in] string description, [in] boolean create ); 133}; 134 135 136}; // module util 137}; // module star 138}; // module sun 139}; // module com 140 141 142#endif 143