merged tag ooo/OOO330_m14
[LibreOffice.git] / offapi / com / sun / star / util / XAtomServer.idl
blob610476a0d6c312c313381e3fc053cc55f6f564cf
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
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.
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).
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.
26 ************************************************************************/
27 #ifndef __com_sun_star_util_XAtomServer_idl__
28 #define __com_sun_star_util_XAtomServer_idl__
30 #ifndef __com_sun_star_uno_XInterface_idl__
31 #include <com/sun/star/uno/XInterface.idl>
32 #endif
34 #ifndef __com_sun_star_util_AtomDescription_idl__
35 #include <com/sun/star/util/AtomDescription.idl>
36 #endif
38 #ifndef __com_sun_star_util_AtomClassRequest_idl__
39 #include <com/sun/star/util/AtomClassRequest.idl>
40 #endif
43 module com
45 module sun
47 module star
49 module util
52 /** an interface to map between <i>string</i>s and <i>id</i>s
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>
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>
71 published interface XAtomServer : com::sun::star::uno::XInterface
73 /** returns a whole atom class
75 @param atomClass
76 which class to return
78 @returns
79 the descriptions for all atoms of class <code>atomClass</code>
81 sequence< AtomDescription > getClass( [in] long atomClass );
82 /** returns mutltiple atom classes
84 @param atomClasses
85 which classes to return
87 @returns
88 the descriptions for all atoms of the requested classes
90 sequence< sequence< AtomDescription > > getClasses( [in] sequence< long > atomClasses );
91 /** returns the strings for an arbitrary amount of atoms of multiple classes
93 @param atoms
94 describes which strings to return
96 @returns
97 the strings for the requested atoms
99 sequence< string > getAtomDescriptions( [in] sequence< AtomClassRequest > atoms );
101 //-----------------------------------------------------------------------
102 /** returns the atoms that have been registered to a class after an
103 already known atom
105 <p>Hint to implementor: using ascending atoms is the easiest way
106 to decide, which atoms are recent.</p>
108 @param atomClass
109 the class in question
111 @param atom
112 the last known atom
114 @returns
115 all atom description that have been added to class
116 <code>atomClass</code> after <code>atom</code>
118 sequence< AtomDescription > getRecentAtoms( [in] long atomClass, [in] long atom );
120 //-----------------------------------------------------------------------
121 /** registers or searches for a string
123 @param atomClass
124 the class of atoms in question
126 @param description
127 the string in question
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
133 @returns
134 the atom for the string <code>description</code>
136 long getAtom( [in] long atomClass, [in] string description, [in] boolean create );
140 }; // module util
141 }; // module star
142 }; // module sun
143 }; // module com
146 #endif