1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef __com_sun_star_container_XContainerQuery_idl__
24 #define __com_sun_star_container_XContainerQuery_idl__
25 
26 #ifndef __com_sun_star_uno_XInterface_idl__
27 #include <com/sun/star/uno/XInterface.idl>
28 #endif
29 
30 #ifndef __com_sun_star_container_XEnumeration_idl__
31 #include <com/sun/star/container/XEnumeration.idl>
32 #endif
33 
34 #ifndef __com_sun_star_beans_NamedValue_idl__
35 #include <com/sun/star/beans/NamedValue.idl>
36 #endif
37 
38 //=============================================================================
39 
40 module com {  module sun {  module star {  module container {
41 
42 //=============================================================================
43 /** supports simple query feature on a container
44 
45     <p>
46     This interface makes it possible to create sub sets of container items
47     which serve specified search criterion.
48     <p>
49  */
50 published interface XContainerQuery: com::sun::star::uno::XInterface
51 {
52     //-------------------------------------------------------------------------
53     /** creates a sub set of container items which match given query command
54 
55         <p>
56         Items of this sub set must match used query string. Format of query depends
57         from real implementation. Using of "param=value" pairs isn't necessary.
58         So it's possible to combine different parameters as one simple command
59         string.
60         <p>
61 
62         @param Query    items of sub set must match to this query<br>
63                         example:<br>
64                         (1)<br>
65                         query as parameter sequence to return all elements which match
66                         the name pattern and supports a special feature; sort it ascending<br>
67                         "name=*myname_??_;sort=ascending;feature=VISIBLE"<br>
68                         (2)<br>
69                         query as command to return all elements which support special feature
70                         and match by name pattern;ascending sort is the default<br>
71                         "getAllVisible(*myname_??_)"<br>
72 
73         @returns an sub set of container items as an enumeration.
74      */
75     XEnumeration createSubSetEnumerationByQuery( [in] string Query );
76 
77     //-------------------------------------------------------------------------
78     /** creates a sub set of container items which supports searched properties as minimum
79 
80         <p>
81         It's not possible to use special commands or search specific parameters here.
82         You can match by properties only. Enumerated elements must provide queried
83         properties as minimum. Not specified properties willn't be used for searching.
84         <p>
85 
86         @param Properties   items of sub set must support given properties as minimum<br>
87                             example:<br>
88                             (supported)<br>
89                             search for items which match the name pattern and supports the VISIBLE feature<br>
90                             Parameters[0].Name  = "name"<br>
91                             Parameters[0].Value = "*myname_??_"<br>
92                             Parameters[1].Name  = "feature"<br>
93                             Parameters[1].Value = "VISIBLE"<br>
94                             ...<br>
95                             (unsupported)<br>
96                             "sort" isn't a property of a container item!
97                             Parameters[0].Name  = "sort"<br>
98                             Parameters[0].Value = "ascending"<br>
99                             ...<br>
100 
101         @returns an sub set of container items as an enumeration.
102      */
103     XEnumeration createSubSetEnumerationByProperties( [in] sequence< com::sun::star::beans::NamedValue > Properties );
104 };
105 
106 //=============================================================================
107 
108 }; }; }; };
109 
110 #endif
111