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