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