Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / offapi / com / sun / star / util / XAtomServer.idl
blob6682dffb3f795ac5fe7b201dc2bd356399242cae
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_util_XAtomServer_idl__
20 #define __com_sun_star_util_XAtomServer_idl__
22 #include <com/sun/star/uno/XInterface.idl>
23 #include <com/sun/star/util/AtomDescription.idl>
24 #include <com/sun/star/util/AtomClassRequest.idl>
27 module com
29 module sun
31 module star
33 module util
36 /** an interface to map between <i>string</i>s and <i>id</i>s
38 <p>a note on atoms:<br>
39 Atoms are abbreviations for strings.
40 When a string gets registered, it is assigned a numeric id
41 so that said string can always be referred to by this id.
42 This way strings have to be transported only once over remote connections.
43 Valid ids are (in this implementation) non zero, signed 32 bit values.
44 An atom of 0 means that the string in question is not registered</p>
46 <p>Additionally there is the abstraction of atom class:<br>
47 Atoms are grouped into classes, so that an id can be assigned
48 to multiple strings, depending on the class context. The main
49 advantage of this is that atoms in one class may be kept
50 to small numbers, so that bandwidth can be reduced by sending
51 the atoms only as 16 bit values. Note that it is up to the user in this
52 case to handle overflows.</p>
55 published interface XAtomServer : com::sun::star::uno::XInterface
57 /** returns a whole atom class
59 @param atomClass
60 which class to return
62 @returns
63 the descriptions for all atoms of class <code>atomClass</code>
65 sequence< AtomDescription > getClass( [in] long atomClass );
66 /** returns multiple atom classes
68 @param atomClasses
69 which classes to return
71 @returns
72 the descriptions for all atoms of the requested classes
74 sequence< sequence< AtomDescription > > getClasses( [in] sequence< long > atomClasses );
75 /** returns the strings for an arbitrary amount of atoms of multiple classes
77 @param atoms
78 describes which strings to return
80 @returns
81 the strings for the requested atoms
83 sequence< string > getAtomDescriptions( [in] sequence< AtomClassRequest > atoms );
85 /** returns the atoms that have been registered to a class after an
86 already known atom
88 <p>Hint to implementor: using ascending atoms is the easiest way
89 to decide, which atoms are recent.</p>
91 @param atomClass
92 the class in question
94 @param atom
95 the last known atom
97 @returns
98 all atom description that have been added to class
99 <code>atomClass</code> after <code>atom</code>
101 sequence< AtomDescription > getRecentAtoms( [in] long atomClass, [in] long atom );
103 /** registers or searches for a string
105 @param atomClass
106 the class of atoms in question
108 @param description
109 the string in question
111 @param create
112 if true a new atom will be created for an unknown string
113 else the invalid atom (0) will be returned for an unknown string
115 @returns
116 the atom for the string <code>description</code>
118 long getAtom( [in] long atomClass, [in] string description, [in] boolean create );
122 }; // module util
123 }; // module star
124 }; // module sun
125 }; // module com
128 #endif
130 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */