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 28*cdf0e10cSrcweir 29*cdf0e10cSrcweir#ifndef __com_sun_star_sdb_DataSourceBrowser_idl__ 30*cdf0e10cSrcweir#define __com_sun_star_sdb_DataSourceBrowser_idl__ 31*cdf0e10cSrcweir 32*cdf0e10cSrcweir#ifndef __com_sun_star_frame_XController_idl__ 33*cdf0e10cSrcweir#include <com/sun/star/frame/XController.idl> 34*cdf0e10cSrcweir#endif 35*cdf0e10cSrcweir#ifndef __com_sun_star_lang_XInitialization_idl__ 36*cdf0e10cSrcweir#include <com/sun/star/lang/XInitialization.idl> 37*cdf0e10cSrcweir#endif 38*cdf0e10cSrcweir#ifndef __com_sun_star_frame_XDispatchProvider_idl__ 39*cdf0e10cSrcweir#include <com/sun/star/frame/XDispatchProvider.idl> 40*cdf0e10cSrcweir#endif 41*cdf0e10cSrcweir#ifndef __com_sun_star_form_FormController_idl__ 42*cdf0e10cSrcweir#include <com/sun/star/form/FormController.idl> 43*cdf0e10cSrcweir#endif 44*cdf0e10cSrcweir#ifndef __com_sun_star_ui_XContextMenuInterception_idl__ 45*cdf0e10cSrcweir#include <com/sun/star/ui/XContextMenuInterception.idl> 46*cdf0e10cSrcweir#endif 47*cdf0e10cSrcweir 48*cdf0e10cSrcweirmodule com { module sun { module star { module sdb { 49*cdf0e10cSrcweir 50*cdf0e10cSrcweir//============================================================================= 51*cdf0e10cSrcweir/** implements a component which allows browsing the data sources registered on the system. 52*cdf0e10cSrcweir 53*cdf0e10cSrcweir <p> 54*cdf0e10cSrcweir This service implements a user interface for browsing data sources registered on the 55*cdf0e10cSrcweir <type scope="com::sun::star::sdb"> 56*cdf0e10cSrcweir DatabaseContext 57*cdf0e10cSrcweir </type> 58*cdf0e10cSrcweir instance of the system. 59*cdf0e10cSrcweir </p> 60*cdf0e10cSrcweir 61*cdf0e10cSrcweir <p> 62*cdf0e10cSrcweir It is possible to navigate through all the data sources, it's queries and it's tables. 63*cdf0e10cSrcweir The queries/tables can be displayed in a grid-like view, where functionality for searching, 64*cdf0e10cSrcweir sorting, filtering, and such is provided. 65*cdf0e10cSrcweir </p> 66*cdf0e10cSrcweir 67*cdf0e10cSrcweir <p> 68*cdf0e10cSrcweir Usually, you won't instantiate this service directly, instead you use the dispatch mechanisms 69*cdf0e10cSrcweir of the application framework to load the URL <b>.component:DB/DataSourceBrowser</b> into an arbitrary 70*cdf0e10cSrcweir frame. This should involve a 71*cdf0e10cSrcweir <type scope="com::sun::star::sdb"> 72*cdf0e10cSrcweir ContentLoader 73*cdf0e10cSrcweir </type> 74*cdf0e10cSrcweir service, which creates and initializes 75*cdf0e10cSrcweir the browser. 76*cdf0e10cSrcweir </p> 77*cdf0e10cSrcweir 78*cdf0e10cSrcweir <p> 79*cdf0e10cSrcweir Some aspects of the browser can be controlled from outside, eg., 80*cdf0e10cSrcweir it is possible to dispatch a sort or filter 81*cdf0e10cSrcweir request, if a table or query is being displayed. 82*cdf0e10cSrcweir </p> 83*cdf0e10cSrcweir 84*cdf0e10cSrcweir <p 85*cdf0e10cSrcweir >The communication between the browser and external instances works in two ways. 86*cdf0e10cSrcweir <br/> 87*cdf0e10cSrcweir The way <em>in</em> is provided by the 88*cdf0e10cSrcweir <type scope="com::sun::star::frame">XDispatchProvider</type> 89*cdf0e10cSrcweir interface the service exports (Please see below for more details on this). 90*cdf0e10cSrcweir <br/> 91*cdf0e10cSrcweir The way <em>out</em> works in another way. There are several URL's which an external 92*cdf0e10cSrcweir instance can provide dispatches for (usually by implementing a 93*cdf0e10cSrcweir <type scope="com::sun::star::frame">XDispatchProviderInterceptor</type> 94*cdf0e10cSrcweir for the parent frame of the browser), thus indicating that the browser should provide special functionality. 95*cdf0e10cSrcweir <br/> 96*cdf0e10cSrcweir In this case, the browser displays and maintains some additional slots (to be more concrete: toolbox items), which, 97*cdf0e10cSrcweir upon triggering, call the 98*cdf0e10cSrcweir <member scope="com::sun::star::frame">XDispatch::dispatch()</member>methodoftheobject 99*cdf0e10cSrcweir provided by the external instance. 100*cdf0e10cSrcweir </p> 101*cdf0e10cSrcweir 102*cdf0e10cSrcweir <p> 103*cdf0e10cSrcweir In particular, the supported URL's for communicating to an external instance are: 104*cdf0e10cSrcweir <ul> 105*cdf0e10cSrcweir <li><b>.uno:DataSourceBrowser/InsertColumns</b> 106*cdf0e10cSrcweir <br/> 107*cdf0e10cSrcweir Available whenever an external instance provides a dispatcher ( 108*cdf0e10cSrcweir <type scope="com::sun::star::frame">XDispatch</type>) 109*cdf0e10cSrcweir for this URL. 110*cdf0e10cSrcweir <br/> 111*cdf0e10cSrcweir Enabled, if at least one row in the grid view of a table or query is selected. 112*cdf0e10cSrcweir <br/> 113*cdf0e10cSrcweir It is the task of the external instance to provide functionality for this URL, but usually it is used 114*cdf0e10cSrcweir to implement some kind of "Data To Text" functionality. 115*cdf0e10cSrcweir <br/> 116*cdf0e10cSrcweir </li> 117*cdf0e10cSrcweir <li><b>.uno:DataSourceBrowser/InsertContent</b> 118*cdf0e10cSrcweir <br/> 119*cdf0e10cSrcweir Available whenever an external instance provides a dispatcher( 120*cdf0e10cSrcweir <type scope="com::sun::star::frame">XDispatch</type> 121*cdf0e10cSrcweir ) for this URL. 122*cdf0e10cSrcweir <br/> 123*cdf0e10cSrcweir Enabled, if at least one row in the grid view of a table or query is selected. 124*cdf0e10cSrcweir <br/> 125*cdf0e10cSrcweir It is the task of the external instance to provide functionality for this URL, but usually it is used 126*cdf0e10cSrcweir to implement some kind of "Data To Fields" functionality. 127*cdf0e10cSrcweir <br/> 128*cdf0e10cSrcweir </li> 129*cdf0e10cSrcweir <li><b>.uno:DataSourceBrowser/FormLetter</b> 130*cdf0e10cSrcweir <br/> 131*cdf0e10cSrcweir Available whenever an external instance provides a dispatcher ( 132*cdf0e10cSrcweir <type scope="com::sun::star::frame">XDispatch</type>)forthisURL. 133*cdf0e10cSrcweir <br/> 134*cdf0e10cSrcweir It is the task of the external instance to provide functionality for this URL, but usually it is used 135*cdf0e10cSrcweir to implement some kind of "Form Letter" functionality. 136*cdf0e10cSrcweir <br/> 137*cdf0e10cSrcweir </li> 138*cdf0e10cSrcweir </ul> 139*cdf0e10cSrcweir </p> 140*cdf0e10cSrcweir <p>For all kinds of URL's, the parameters supplied during dispatching build up a <type>DataAccessDescriptor</type>, 141*cdf0e10cSrcweir where the following properties are present: 142*cdf0e10cSrcweir <ul> 143*cdf0e10cSrcweir <li><member>DataAccessDescriptor::DataSourceName</member></li> 144*cdf0e10cSrcweir <li><member>DataAccessDescriptor::Command</member></li> 145*cdf0e10cSrcweir <li><member>DataAccessDescriptor::CommandType</member></li> 146*cdf0e10cSrcweir <li><em>optional</em> <member>DataAccessDescriptor::Selection</member></li> 147*cdf0e10cSrcweir <li><em>optional</em> <member>DataAccessDescriptor::BookmarkSelection</member></li> 148*cdf0e10cSrcweir <li><em>optional</em> <member>DataAccessDescriptor::ResultSet</member></li> 149*cdf0e10cSrcweir </ul> 150*cdf0e10cSrcweir </p> 151*cdf0e10cSrcweir <p>The default for <member>DataAccessDescriptor::Selection</member> is to contain bookmarks, if not specified 152*cdf0e10cSrcweir otherwise by <member>DataAccessDescriptor::BookmarkSelection</member>.</pr> 153*cdf0e10cSrcweir </p> 154*cdf0e10cSrcweir 155*cdf0e10cSrcweir @see com::sun::star::sdb::ContentLoader 156*cdf0e10cSrcweir @see com::sun::star::sdb::DatabaseContext 157*cdf0e10cSrcweir @see com::sun::star::sdb::DataSource 158*cdf0e10cSrcweir @see com::sun::star::frame::XDispatch 159*cdf0e10cSrcweir @see com::sun::star::frame::XDispatchProvider 160*cdf0e10cSrcweir @see com::sun::star::frame::XDispatchProviderInterceptor 161*cdf0e10cSrcweir*/ 162*cdf0e10cSrcweirpublished service DataSourceBrowser 163*cdf0e10cSrcweir{ 164*cdf0e10cSrcweir /** implements basic form controller functionality. 165*cdf0e10cSrcweir <p> 166*cdf0e10cSrcweir With a data source browser implementing this interface, external components have access to 167*cdf0e10cSrcweir <ul><li>the grid control which is used to display the currently selected table/query 168*cdf0e10cSrcweir (see <method scope="com::sun::star::awt">XTabController::getControls</method>) 169*cdf0e10cSrcweir </li> 170*cdf0e10cSrcweir <li>the data form used for displaying objects. As always for components implementing this service, 171*cdf0e10cSrcweir the object returned by 172*cdf0e10cSrcweir <method scope="com::sun::star::awt">XTabController::getModel</method>is a dataform. 173*cdf0e10cSrcweir </li> 174*cdf0e10cSrcweir </ul> 175*cdf0e10cSrcweir </p> 176*cdf0e10cSrcweir */ 177*cdf0e10cSrcweir [optional] service com::sun::star::form::FormController; 178*cdf0e10cSrcweir 179*cdf0e10cSrcweir /** allows the component to be plugged into frames. 180*cdf0e10cSrcweir */ 181*cdf0e10cSrcweir interface com::sun::star::frame::XController; 182*cdf0e10cSrcweir 183*cdf0e10cSrcweir /** is used to initialize the browser. 184*cdf0e10cSrcweir 185*cdf0e10cSrcweir <p> 186*cdf0e10cSrcweir Parameters (passed to the method <member scope="com::sun::star::lang">XInitialization::initialize()</member>) 187*cdf0e10cSrcweir have to be instances of <type scope="com::sun::star::beans">PropertyValue</type>, or 188*cdf0e10cSrcweir instances of <type scope="com::sun::star::beans">NamedValue</type>, where the <code>Name</code> member 189*cdf0e10cSrcweir specifies what the parameter controls, with the <code>Value</code> member containing the value to be used. 190*cdf0e10cSrcweir <br/> 191*cdf0e10cSrcweir Recognized parameters are: 192*cdf0e10cSrcweir <ul> 193*cdf0e10cSrcweir <li><b>Frame</b><br/> 194*cdf0e10cSrcweir has to be an <type scope="com::sun::star::frame">XFrame</type> interface specifying the frame to 195*cdf0e10cSrcweir plug the browser component into.</li> 196*cdf0e10cSrcweir 197*cdf0e10cSrcweir <li><b>DataSourceName</b><br/> 198*cdf0e10cSrcweir The name of the globally registered <type>DataSource</type> to be used for initial display. It is only 199*cdf0e10cSrcweir meaningful together with the other parameters specifying the object to display.</li> 200*cdf0e10cSrcweir 201*cdf0e10cSrcweir <li><b>CommandType</b><br/> 202*cdf0e10cSrcweir This has to be a <type>CommandType</type> value, specifying the type of the object to display initially. 203*cdf0e10cSrcweir It is only meaningful together with the <em>DataSourceName</em> and the <em>Command</em> parameters.</li> 204*cdf0e10cSrcweir 205*cdf0e10cSrcweir <li><b>Command</b><br/> 206*cdf0e10cSrcweir This is a string giving the name of the object to display initially. Whether it is table name, a query 207*cdf0e10cSrcweir name or a SQL string is controller by the <em>CommandType</em> parameter.</li> 208*cdf0e10cSrcweir 209*cdf0e10cSrcweir <li><b>EnableBrowser</b><br/> 210*cdf0e10cSrcweir is a boolean value (defaulting to <TRUE/>), which specifies whether to enable the data source browser 211*cdf0e10cSrcweir control. This is a tree control on the left hand side of the view, which allows to browse all registered 212*cdf0e10cSrcweir data sources, including their tables and queries.</li> 213*cdf0e10cSrcweir 214*cdf0e10cSrcweir <li><b>ShowBrowser</b><br/> 215*cdf0e10cSrcweir is a boolean value (defaulting to <TRUE/>), which specifies whether to initially show the data source 216*cdf0e10cSrcweir browser control. If <code>EnableBrowser</code> is <FALSE/>, then this parameter is ignored. If 217*cdf0e10cSrcweir <code>EnableBrowser</code> is <TRUE/>, and <code>ShowBrowser</code> is <FALSE/>, then the control 218*cdf0e10cSrcweir is initially hidden, but can be toggled by a toolbar button.</p> 219*cdf0e10cSrcweir 220*cdf0e10cSrcweir <li><b>ShowMenu</b><br/> 221*cdf0e10cSrcweir is a boolean value (defaulting to <TRUE/>), specifying whether or not to show a menu in the frame 222*cdf0e10cSrcweir where the component is plugged.</li> 223*cdf0e10cSrcweir </ul> 224*cdf0e10cSrcweir </p> 225*cdf0e10cSrcweir */ 226*cdf0e10cSrcweir interface com::sun::star::lang::XInitialization; 227*cdf0e10cSrcweir 228*cdf0e10cSrcweir /** is used to control the browser from outside. 229*cdf0e10cSrcweir 230*cdf0e10cSrcweir <p> 231*cdf0e10cSrcweir You may use the 232*cdf0e10cSrcweir <member scope="com::sun::star::frame">XDispatchProvider::queryDispatch</member> 233*cdf0e10cSrcweir method 234*cdf0e10cSrcweir to query for objects which implement the 235*cdf0e10cSrcweir <type scope="com::sun::star::frame">XDispatch</type> 236*cdf0e10cSrcweir interface, 237*cdf0e10cSrcweir and which allow you to be notified on status changes and to dispatch special requests. 238*cdf0e10cSrcweir </p> 239*cdf0e10cSrcweir <p> 240*cdf0e10cSrcweir The recognized URLs are: 241*cdf0e10cSrcweir <ul> 242*cdf0e10cSrcweir <li><b>.uno:Copy</b> 243*cdf0e10cSrcweir <br/> 244*cdf0e10cSrcweir implements the usual <em>Copy</em> command. Enabled if the grid view has the focus and text in any cell 245*cdf0e10cSrcweir is selected. 246*cdf0e10cSrcweir </li> 247*cdf0e10cSrcweir <li><b>.uno:Cut</b> 248*cdf0e10cSrcweir <br/> 249*cdf0e10cSrcweir implements the usual <em>Cut</em> command. Enabled if the grid view has the focus and text in any cell 250*cdf0e10cSrcweir is selected. 251*cdf0e10cSrcweir </li> 252*cdf0e10cSrcweir <li><b>.uno:Paste</b> 253*cdf0e10cSrcweir <br/> 254*cdf0e10cSrcweir implements the usual <em>Paste</em> command. Enabled if the grid view has the focus and a cell which 255*cdf0e10cSrcweir allows text input is being edited. 256*cdf0e10cSrcweir </li> 257*cdf0e10cSrcweir <li><b>.uno:EditDoc</b> 258*cdf0e10cSrcweir <br/> 259*cdf0e10cSrcweir allows switching the edit mode of the grid view. Enabled if editing the data is allowed in general. 260*cdf0e10cSrcweir </li> 261*cdf0e10cSrcweir <li><b>.uno:Undo</b> 262*cdf0e10cSrcweir <br/> 263*cdf0e10cSrcweir revokes any changes done in the current row. 264*cdf0e10cSrcweir </li> 265*cdf0e10cSrcweir <li><b>.uno:Save</b><br/> 266*cdf0e10cSrcweir saves the changes done in the current row. 267*cdf0e10cSrcweir </li> 268*cdf0e10cSrcweir </ul> 269*cdf0e10cSrcweir </p> 270*cdf0e10cSrcweir */ 271*cdf0e10cSrcweir interface com::sun::star::frame::XDispatchProvider; 272*cdf0e10cSrcweir 273*cdf0e10cSrcweir /** allows to intercept user-triggered context menus in the data source browser 274*cdf0e10cSrcweir 275*cdf0e10cSrcweir <p>Context menu interception is currently supported only for the brower control where the registered 276*cdf0e10cSrcweir data sources and all their tables and queries are displayed in a tree view.</p> 277*cdf0e10cSrcweir 278*cdf0e10cSrcweir <p>The selection supplied by <member scope="com::sun::star::ui">ContextMenuExecuteEvent::Selection</member>, 279*cdf0e10cSrcweir in the event structure passed to the context menu interceptors, actually is a value from the 280*cdf0e10cSrcweir <type scope="com::sun::star::sdb::application">NamedDatabaseObject</type> group.</p> 281*cdf0e10cSrcweir 282*cdf0e10cSrcweir @since OOo 3.0 283*cdf0e10cSrcweir */ 284*cdf0e10cSrcweir [optional] interface ::com::sun::star::ui::XContextMenuInterception; 285*cdf0e10cSrcweir}; 286*cdf0e10cSrcweir 287*cdf0e10cSrcweir//============================================================================= 288*cdf0e10cSrcweir}; }; }; }; 289*cdf0e10cSrcweir 290*cdf0e10cSrcweir#endif 291