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_container_XContainerQuery_idl__
28#define __com_sun_star_container_XContainerQuery_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_container_XEnumeration_idl__
35#include <com/sun/star/container/XEnumeration.idl>
36#endif
37
38#ifndef __com_sun_star_beans_NamedValue_idl__
39#include <com/sun/star/beans/NamedValue.idl>
40#endif
41
42//=============================================================================
43
44module com {  module sun {  module star {  module container {
45
46//=============================================================================
47/** supports simple query feature on a container
48
49    <p>
50    This interface makes it possible to create sub sets of container items
51    which serve specified search criterion.
52    <p>
53 */
54published interface XContainerQuery: com::sun::star::uno::XInterface
55{
56    //-------------------------------------------------------------------------
57    /** creates a sub set of container items which match given query command
58
59        <p>
60        Items of this sub set must match used query string. Format of query depends
61        from real implementation. Using of "param=value" pairs isn't neccessary.
62        So it's possible to combine different parameters as one simple command
63        string.
64        <p>
65
66        @param Query    items of sub set must match to this query<br>
67                        example:<br>
68                        (1)<br>
69                        query as parameter sequence to return all elements wich match
70                        the name pattern and supports a special feature; sort it ascending<br>
71                        "name=*myname_??_;sort=ascending;feature=VISIBLE"<br>
72                        (2)<br>
73                        query as command to return all elements which support special feature
74                        and match by name pattern;ascending sort is the default<br>
75                        "getAllVisible(*myname_??_)"<br>
76
77        @returns an sub set of container items as an enumeration.
78     */
79    XEnumeration createSubSetEnumerationByQuery( [in] string Query );
80
81    //-------------------------------------------------------------------------
82    /** creates a sub set of container items which supports searched properties as minimum
83
84        <p>
85        It's not possible to use special commands or search specific parameters here.
86        You can match by properties only. Enumerated elements must provide queried
87        properties as minimum. Not specified properties willn't be used for searching.
88        <p>
89
90        @param Properties   items of sub set must support given properties as minimum<br>
91                            example:<br>
92                            (supported)<br>
93                            search for items wich match the name pattern and supports the VISIBLE feature<br>
94                            Parameters[0].Name  = "name"<br>
95                            Parameters[0].Value = "*myname_??_"<br>
96                            Parameters[1].Name  = "feature"<br>
97                            Parameters[1].Value = "VISIBLE"<br>
98                            ...<br>
99                            (unsupported)<br>
100                            "sort" isn't a property of a container item!
101                            Parameters[0].Name  = "sort"<br>
102                            Parameters[0].Value = "ascending"<br>
103                            ...<br>
104
105        @returns an sub set of container items as an enumeration.
106     */
107    XEnumeration createSubSetEnumerationByProperties( [in] sequence< com::sun::star::beans::NamedValue > Properties );
108};
109
110//=============================================================================
111
112}; }; }; };
113
114#endif
115