xref: /AOO41X/main/offapi/com/sun/star/sdb/QueryDesign.idl (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1*cdf0e10cSrcweir/*************************************************************************
2*cdf0e10cSrcweir *
3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir *
5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir *
7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir *
9*cdf0e10cSrcweir * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir *
11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir *
15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir *
21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir *
26*cdf0e10cSrcweir ************************************************************************/
27*cdf0e10cSrcweir#ifndef __com_sun_star_sdb_QueryDesign_idl__
28*cdf0e10cSrcweir#define __com_sun_star_sdb_QueryDesign_idl__
29*cdf0e10cSrcweir
30*cdf0e10cSrcweir#ifndef __com_sun_star_frame_XController_idl__
31*cdf0e10cSrcweir#include <com/sun/star/frame/XController.idl>
32*cdf0e10cSrcweir#endif
33*cdf0e10cSrcweir#ifndef __com_sun_star_lang_XInitialization_idl__
34*cdf0e10cSrcweir#include <com/sun/star/lang/XInitialization.idl>
35*cdf0e10cSrcweir#endif
36*cdf0e10cSrcweir#ifndef __com_sun_star_frame_XDispatchProvider_idl__
37*cdf0e10cSrcweir#include <com/sun/star/frame/XDispatchProvider.idl>
38*cdf0e10cSrcweir#endif
39*cdf0e10cSrcweir#ifndef __com_sun_star_form_FormController_idl__
40*cdf0e10cSrcweir#include <com/sun/star/form/FormController.idl>
41*cdf0e10cSrcweir#endif
42*cdf0e10cSrcweir
43*cdf0e10cSrcweirmodule com {  module sun {  module star {  module sdb {
44*cdf0e10cSrcweir
45*cdf0e10cSrcweir//=============================================================================
46*cdf0e10cSrcweir/** implements a component which allows the creation of SQL statements.
47*cdf0e10cSrcweir
48*cdf0e10cSrcweir	<p>This service implements a user interface for creating SQL statements either through a graphical design
49*cdf0e10cSrcweir	interface or simply to enter the SQL statement directly.</p>
50*cdf0e10cSrcweir
51*cdf0e10cSrcweir	<p>The design view of the QueryDesign is divided into two parts. The first part contains the table windows
52*cdf0e10cSrcweir	where columns can be selected for the SQL statement. The second part contains the columns which should appear
53*cdf0e10cSrcweir	in the selection of the SQL statement or criterias which narrow the query.</p>
54*cdf0e10cSrcweir
55*cdf0e10cSrcweir    <h3>Operation Modes</h3>
56*cdf0e10cSrcweir
57*cdf0e10cSrcweir    <p>A <code>QueryDesign</code> component has 3 operation modes, which control what kind of object is edited:
58*cdf0e10cSrcweir    <ul><li><a name="query_mode"></a><b>Query Mode</b>
59*cdf0e10cSrcweir        <p>In <code>Query Mode</code>, the designer is used to modify an existing or create a new client-side
60*cdf0e10cSrcweir        query.</p></li>
61*cdf0e10cSrcweir
62*cdf0e10cSrcweir        <li><a name="view_mode"</a><b>View Mode</b>
63*cdf0e10cSrcweir        <p>In <code>View Mode</code>, the designer is used to modify an existing or create a new server-side
64*cdf0e10cSrcweir        view.</p>
65*cdf0e10cSrcweir        <p>The view which is being designed must support the <type scope="com::sun::star::sdbcx">XAlterView</type>
66*cdf0e10cSrcweir        interface, except when a new view is being designed. In the latter case, the designer closes itself
67*cdf0e10cSrcweir        automatically when <code>XAlterView</code> is not supported, and the view has been saved.</p></li>
68*cdf0e10cSrcweir
69*cdf0e10cSrcweir        <li><a name="command_mode"</a><b>Command Mode</b>
70*cdf0e10cSrcweir        <p>In <code>Command Mode</code>, the designer is used to design an standalone SQL command.</p>
71*cdf0e10cSrcweir        <p>The client of the designer is then responsible to listen at changes in the
72*cdf0e10cSrcweir        <member>ActiveCommand</member> and <member>EscapeProcessing</member> members, which are updated
73*cdf0e10cSrcweir        every time the user saves the command.</p></li>
74*cdf0e10cSrcweir    </ul></p>
75*cdf0e10cSrcweir
76*cdf0e10cSrcweir    <h3><a name="initialization"></a>Initialization</h3>
77*cdf0e10cSrcweir
78*cdf0e10cSrcweir    <p>Initialization is done using the <type scope="com::sun::star::lang">XInitialization</type> interface,
79*cdf0e10cSrcweir    which expects a sequence of objects being either <type scope="com::sun::star::beans">NamedValue</type>s or
80*cdf0e10cSrcweir    <type scope="com::sun::star::beans">PropertyValue</type>s. The following parameters are supported at
81*cdf0e10cSrcweir    initialization time:
82*cdf0e10cSrcweir	<ul>
83*cdf0e10cSrcweir		<li><b>Frame</b><br/>
84*cdf0e10cSrcweir		has to be an <type scope="com::sun::star::frame">XFrame</type> interface specifying the frame to plug the
85*cdf0e10cSrcweir		QueryDesign component into.<br/>
86*cdf0e10cSrcweir        This parameter is mandatory.
87*cdf0e10cSrcweir		</li>
88*cdf0e10cSrcweir
89*cdf0e10cSrcweir        <li><a name="data_source"></a><b>DataSourceName</b><br/>
90*cdf0e10cSrcweir		specifies the name of the globally registered <type>DataSource</type> for which a query, view, or SQL
91*cdf0e10cSrcweir        command is to be designed.<br/>
92*cdf0e10cSrcweir        The DataSourceName may be omitted if and only if a valid <a href="#active_connection">ActiveConnection</a>
93*cdf0e10cSrcweir        parameter is present.<br/>
94*cdf0e10cSrcweir        If both <code>DataSourceName</code> and <code>ActiveConnection</code> are present, the former
95*cdf0e10cSrcweir        is ignored.
96*cdf0e10cSrcweir		</li>
97*cdf0e10cSrcweir
98*cdf0e10cSrcweir        <li><a name="active_connection"></a><b>ActiveConnection</b><br/>
99*cdf0e10cSrcweir        specifies the connection to work with.<br/>
100*cdf0e10cSrcweir        May be ommitted if and only if a valid <a href="#data_source">DataSourceName</a> parameter is supplied.
101*cdf0e10cSrcweir        </li>
102*cdf0e10cSrcweir
103*cdf0e10cSrcweir        <li><a name="command"></a><b>Command</b><br/>
104*cdf0e10cSrcweir        specifies the name of the query or view to design, or, in case of the <a href="#command_type">CommandType</a>
105*cdf0e10cSrcweir        being <member>CommandType::COMMAND</member>, the initial SQL command.<br/>
106*cdf0e10cSrcweir        If this parameter is not present, a new query/view will be designed, respectively the initial
107*cdf0e10cSrcweir        command will be empty.
108*cdf0e10cSrcweir        </li>
109*cdf0e10cSrcweir
110*cdf0e10cSrcweir        <li><a name="command_type"></a><b>CommandType</b><br/>
111*cdf0e10cSrcweir        specifies the type of object which should be designed. The following options are
112*cdf0e10cSrcweir        supported:
113*cdf0e10cSrcweir        <ul><li><member>CommandType::QUERY</member> specifies the designer should operate in
114*cdf0e10cSrcweir            <a href="#query_mode">query mode</a>, that is, an existing client-side query should be
115*cdf0e10cSrcweir            designed, or a new query should be created, depending on the presence of the
116*cdf0e10cSrcweir            <a href="#command">Command</a> parameter.<br/>
117*cdf0e10cSrcweir            If the <a href="#data_source">DataSourceName</a> parameter is present, the query is
118*cdf0e10cSrcweir            looked up in the specified data source. Otherwise, the designer tries to determine
119*cdf0e10cSrcweir            the data source which the <a href="#active_connection">ActiveConnection</a> belongs
120*cdf0e10cSrcweir            to, and looks up the query there.</li>
121*cdf0e10cSrcweir
122*cdf0e10cSrcweir            <li><member>CommandType::COMMAND</member> specifies the designer should operate in
123*cdf0e10cSrcweir            <a href="#command_mode">command mode</a>, that is, a standalone SQL command
124*cdf0e10cSrcweir            should be designed. When the user attempts to save the designed SQL statement,
125*cdf0e10cSrcweir            the <member>ActiveCommand</member> and <member>EscapeProcessing</member> properties
126*cdf0e10cSrcweir            of the designer are updated.</li>
127*cdf0e10cSrcweir
128*cdf0e10cSrcweir            <li><member>CommandType::TABLE</member> specifies the designer should operate in
129*cdf0e10cSrcweir            <a href="#view_mode">view mode</a>, that is, an existing or a new
130*cdf0e10cSrcweir            server-side view should be designed, depending on the presence of the
131*cdf0e10cSrcweir            <a href="#command">Command</a> parameter.<br/>
132*cdf0e10cSrcweir            If the <a href="#data_source">DataSourceName</a> parameter is present, the view is
133*cdf0e10cSrcweir            looked up in a newly created connection for the specified data source. Otherwise,
134*cdf0e10cSrcweir            it is looked up in the connection given as <a href="#active_connection">ActiveConnection</a>.</li>
135*cdf0e10cSrcweir        </ul>
136*cdf0e10cSrcweir        If not present, this parameter defaults to <member>CommandType::QUERY</member>.
137*cdf0e10cSrcweir        </li>
138*cdf0e10cSrcweir
139*cdf0e10cSrcweir        <li><b>EscapeProcessing</b><br/>
140*cdf0e10cSrcweir        Specifies whether or not escape processing should be initially enabled in the query designer. If set
141*cdf0e10cSrcweir        to <FALSE/>, then the designer can operate in text view only (as opposed to the graphical view). The
142*cdf0e10cSrcweir        <a href="#graphical_design">GraphicalDesign</a> parameter will be ignored then, and assumed to be <FALSE/>.<br/>
143*cdf0e10cSrcweir        If not present, <TRUE/> is assumed for this parameter.</li>
144*cdf0e10cSrcweir
145*cdf0e10cSrcweir		<li><a name="graphical_design"></a><b>GraphicalDesign</b><br/>
146*cdf0e10cSrcweir		This value indicates whether the designer should be opened in the graphical design view
147*cdf0e10cSrcweir        (<TRUE/>) or in the text view (<FALSE/>).<br/>
148*cdf0e10cSrcweir        If not present, <FALSE/> is assumed for this parameter.
149*cdf0e10cSrcweir		</li>
150*cdf0e10cSrcweir	</ul>
151*cdf0e10cSrcweir    </p>
152*cdf0e10cSrcweir
153*cdf0e10cSrcweir    <p>There's a number of legacy settings which are recognized for compatibility reasons, though
154*cdf0e10cSrcweir    you're discouraged from using them:
155*cdf0e10cSrcweir    <ul>
156*cdf0e10cSrcweir        <li><b>CurrentQuery</b><br/>
157*cdf0e10cSrcweir        is the same as Command, and implies a <a href="#command_type">CommandType</a> of
158*cdf0e10cSrcweir        <member>CommandType::QUERY</member></li>
159*cdf0e10cSrcweir
160*cdf0e10cSrcweir        <li><b>QueryDesignView</b><br/>
161*cdf0e10cSrcweir        is the same as <a href="#graphical_design">GraphicalDesign</a>.</li>
162*cdf0e10cSrcweir
163*cdf0e10cSrcweir        <li><b>IndependentSQLCommand</b><br/>
164*cdf0e10cSrcweir        is the same as Command, and implies a <a href="#command_type">CommandType</a> of
165*cdf0e10cSrcweir        <member>CommandType::COMMAND</member></li>
166*cdf0e10cSrcweir
167*cdf0e10cSrcweir        <li><b>CreateView</b><br/>
168*cdf0e10cSrcweir        implies a <a href="#command_type">CommandType</a> of <member>CommandType::TABLE</member></li>
169*cdf0e10cSrcweir    </ul>
170*cdf0e10cSrcweir
171*cdf0e10cSrcweir	@see com::sun::star::sdb::ContentLoader
172*cdf0e10cSrcweir*/
173*cdf0e10cSrcweir
174*cdf0e10cSrcweirpublished service QueryDesign
175*cdf0e10cSrcweir{
176*cdf0e10cSrcweir	/** allows the component to be plugged into frames.
177*cdf0e10cSrcweir	*/
178*cdf0e10cSrcweir	interface com::sun::star::frame::XController;
179*cdf0e10cSrcweir
180*cdf0e10cSrcweir	/** is used to initialize the QueryDesign.
181*cdf0e10cSrcweir
182*cdf0e10cSrcweir        <p>See chapter <a href="#initialization">Initialization</a> for details.</p>
183*cdf0e10cSrcweir	*/
184*cdf0e10cSrcweir	interface com::sun::star::lang::XInitialization;
185*cdf0e10cSrcweir
186*cdf0e10cSrcweir    /** reflects the designed SQL command at the moment it was last saved by the user.
187*cdf0e10cSrcweir    */
188*cdf0e10cSrcweir    [readonly, property] string ActiveCommand;
189*cdf0e10cSrcweir
190*cdf0e10cSrcweir    /** specifies whether the user enabled escape processing for the statement being designed.
191*cdf0e10cSrcweir
192*cdf0e10cSrcweir        @see DataAccessDescriptor::EscapeProcessing
193*cdf0e10cSrcweir        @since OOo 2.4
194*cdf0e10cSrcweir    */
195*cdf0e10cSrcweir    [readonly, property, optional] boolean EscapeProcessing;
196*cdf0e10cSrcweir};
197*cdf0e10cSrcweir
198*cdf0e10cSrcweir//=============================================================================
199*cdf0e10cSrcweir}; }; }; };
200*cdf0e10cSrcweir
201*cdf0e10cSrcweir#endif
202