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
>
34 #ifndef __com_sun_star_util_AtomDescription_idl__
35 #include
<com
/sun
/star
/util
/AtomDescription.idl
>
38 #ifndef __com_sun_star_util_AtomClassRequest_idl__
39 #include
<com
/sun
/star
/util
/AtomClassRequest.idl
>
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
79 the descriptions for all atoms of class <code>atomClass</code>
81 sequence
< AtomDescription
> getClass
( [in] long atomClass
);
82 /** returns mutltiple atom classes
85 which classes to return
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
94 describes which strings to return
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
105 <p>Hint to implementor: using ascending atoms is the easiest way
106 to decide, which atoms are recent.</p>
109 the class in question
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
124 the class of atoms in question
127 the string in question
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
134 the atom for the string <code>description</code>
136 long getAtom
( [in] long atomClass
, [in] string description
, [in] boolean create
);