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 DBAUI_TOOLS_HXX 28*cdf0e10cSrcweir #define DBAUI_TOOLS_HXX 29*cdf0e10cSrcweir 30*cdf0e10cSrcweir #ifndef _DBHELPER_DBEXCEPTION_HXX_ 31*cdf0e10cSrcweir #include <connectivity/dbexception.hxx> 32*cdf0e10cSrcweir #endif 33*cdf0e10cSrcweir #ifndef _COMPHELPER_STLTYPES_HXX_ 34*cdf0e10cSrcweir #include <comphelper/stl_types.hxx> 35*cdf0e10cSrcweir #endif 36*cdf0e10cSrcweir #ifndef DBAUI_TYPEINFO_HXX 37*cdf0e10cSrcweir #include "TypeInfo.hxx" 38*cdf0e10cSrcweir #endif 39*cdf0e10cSrcweir #ifndef _SVX_SVXENUM_HXX 40*cdf0e10cSrcweir #include <editeng/svxenum.hxx> 41*cdf0e10cSrcweir #endif 42*cdf0e10cSrcweir #ifndef _SV_TASKPANELIST_HXX 43*cdf0e10cSrcweir #include <vcl/taskpanelist.hxx> 44*cdf0e10cSrcweir #endif 45*cdf0e10cSrcweir #ifndef _CONNECTIVITY_DBTOOLS_HXX_ 46*cdf0e10cSrcweir #include <connectivity/dbtools.hxx> 47*cdf0e10cSrcweir #endif 48*cdf0e10cSrcweir 49*cdf0e10cSrcweir #define RET_ALL 10 50*cdf0e10cSrcweir 51*cdf0e10cSrcweir // we only need forward decl here 52*cdf0e10cSrcweir namespace com { namespace sun { namespace star { 53*cdf0e10cSrcweir 54*cdf0e10cSrcweir namespace beans { class XPropertySet;} 55*cdf0e10cSrcweir namespace container 56*cdf0e10cSrcweir { 57*cdf0e10cSrcweir class XNameAccess; 58*cdf0e10cSrcweir class XIndexAccess; 59*cdf0e10cSrcweir class XHierarchicalNameContainer; 60*cdf0e10cSrcweir class XNameContainer; 61*cdf0e10cSrcweir } 62*cdf0e10cSrcweir namespace lang 63*cdf0e10cSrcweir { 64*cdf0e10cSrcweir class XEventListener; 65*cdf0e10cSrcweir class XMultiServiceFactory; 66*cdf0e10cSrcweir } 67*cdf0e10cSrcweir namespace awt 68*cdf0e10cSrcweir { 69*cdf0e10cSrcweir struct FontDescriptor; 70*cdf0e10cSrcweir } 71*cdf0e10cSrcweir namespace sdbc 72*cdf0e10cSrcweir { 73*cdf0e10cSrcweir class XDatabaseMetaData; 74*cdf0e10cSrcweir class XConnection; 75*cdf0e10cSrcweir } 76*cdf0e10cSrcweir namespace util 77*cdf0e10cSrcweir { 78*cdf0e10cSrcweir struct URL; 79*cdf0e10cSrcweir class XNumberFormatter; 80*cdf0e10cSrcweir } 81*cdf0e10cSrcweir namespace frame 82*cdf0e10cSrcweir { 83*cdf0e10cSrcweir class XModel; 84*cdf0e10cSrcweir } 85*cdf0e10cSrcweir namespace ucb { class XContent; } 86*cdf0e10cSrcweir 87*cdf0e10cSrcweir }}} 88*cdf0e10cSrcweir 89*cdf0e10cSrcweir namespace svt 90*cdf0e10cSrcweir { 91*cdf0e10cSrcweir class EditBrowseBox; 92*cdf0e10cSrcweir } 93*cdf0e10cSrcweir 94*cdf0e10cSrcweir class Window; 95*cdf0e10cSrcweir class ToolBox; 96*cdf0e10cSrcweir class Font; 97*cdf0e10cSrcweir class SvNumberFormatter; 98*cdf0e10cSrcweir class SfxFilter; 99*cdf0e10cSrcweir class SvLBoxEntry; 100*cdf0e10cSrcweir 101*cdf0e10cSrcweir // ......................................................................... 102*cdf0e10cSrcweir namespace dbaui 103*cdf0e10cSrcweir { 104*cdf0e10cSrcweir // ......................................................................... 105*cdf0e10cSrcweir //class ODsnTypeCollection; 106*cdf0e10cSrcweir class DBTreeListBox; 107*cdf0e10cSrcweir 108*cdf0e10cSrcweir /** creates a new connection and appends the eventlistener 109*cdf0e10cSrcweir @param _rsDataSourceName name of the datasource 110*cdf0e10cSrcweir @param _xDatabaseContext the database context 111*cdf0e10cSrcweir @param _rMF the multi service factory 112*cdf0e10cSrcweir @param _rEvtLst the eventlistener which will be added to the new created connection 113*cdf0e10cSrcweir @param _rOUTConnection this parameter will be filled with the new created connection 114*cdf0e10cSrcweir @return SQLExceptionInfo contains a SQLException, SQLContext or a SQLWarning when they araised else .isValid() will return false 115*cdf0e10cSrcweir */ 116*cdf0e10cSrcweir ::dbtools::SQLExceptionInfo createConnection( 117*cdf0e10cSrcweir const ::rtl::OUString& _rsDataSourceName, 118*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& _xDatabaseContext, 119*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rMF, 120*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener>& _rEvtLst, 121*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _rOUTConnection ); 122*cdf0e10cSrcweir /** creates a new connection and appends the eventlistener 123*cdf0e10cSrcweir @param _xDataSource the datasource 124*cdf0e10cSrcweir @param _rMF the multi service factory 125*cdf0e10cSrcweir @param _rEvtLst the eventlistener which will be added to the new created connection 126*cdf0e10cSrcweir @param _rOUTConnection this parameter will be filled with the new created connection 127*cdf0e10cSrcweir @return SQLExceptionInfo contains a SQLException, SQLContext or a SQLWarning when they araised else .isValid() will return false 128*cdf0e10cSrcweir */ 129*cdf0e10cSrcweir ::dbtools::SQLExceptionInfo createConnection( 130*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _xDataSource, 131*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rMF, 132*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener>& _rEvtLst, 133*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _rOUTConnection ); 134*cdf0e10cSrcweir 135*cdf0e10cSrcweir /** creates a error dialog which displays the SQLExceptionInfo. Also it supports a "more" button where detailed information are available 136*cdf0e10cSrcweir @param _rInfo the error which should be shown, if the info is not valid no error dialog will appear 137*cdf0e10cSrcweir @param _pParent the parent of the error dialog 138*cdf0e10cSrcweir @param _xFactory need to create the dialog 139*cdf0e10cSrcweir */ 140*cdf0e10cSrcweir void showError( const ::dbtools::SQLExceptionInfo& _rInfo, 141*cdf0e10cSrcweir Window* _pParent, 142*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _xFactory); 143*cdf0e10cSrcweir 144*cdf0e10cSrcweir /** return a vector which contains all key columns for the @see com::sun::star::sdbc::KeyType _nKeyType 145*cdf0e10cSrcweir @param _rxTable the table which must be a @see com::sun::star::sdbcx::XColumnsSupplier 146*cdf0e10cSrcweir @param _nKeyType @see com::sun::star::sdbc::KeyType 147*cdf0e10cSrcweir */ 148*cdf0e10cSrcweir 149*cdf0e10cSrcweir ::std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess> > 150*cdf0e10cSrcweir getKeyColumns( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess >& _rxKeys, 151*cdf0e10cSrcweir sal_Int32 _nKeyType); 152*cdf0e10cSrcweir 153*cdf0e10cSrcweir /** fills a map and a vector with localized type names 154*cdf0e10cSrcweir @param _rxConnection the connection to acces the metadata 155*cdf0e10cSrcweir @param _rsTypeNames a list of localized type names seperated with ';' 156*cdf0e10cSrcweir @param _rTypeInfoMap the filled map with the type names 157*cdf0e10cSrcweir @param _rTypeInfoIters the vector filled with map iterators 158*cdf0e10cSrcweir */ 159*cdf0e10cSrcweir void fillTypeInfo( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _rxConnection, 160*cdf0e10cSrcweir const String& _rsTypeNames, 161*cdf0e10cSrcweir OTypeInfoMap& _rTypeInfoMap, 162*cdf0e10cSrcweir ::std::vector<OTypeInfoMap::iterator>& _rTypeInfoIters); 163*cdf0e10cSrcweir 164*cdf0e10cSrcweir /** fill a column with data of a field description 165*cdf0e10cSrcweir @param _rxColumn the column which should be filled 166*cdf0e10cSrcweir @param _pFieldDesc the source of the data 167*cdf0e10cSrcweir */ 168*cdf0e10cSrcweir class OFieldDescription; 169*cdf0e10cSrcweir void setColumnProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxColumn, 170*cdf0e10cSrcweir const OFieldDescription* _pFieldDesc); 171*cdf0e10cSrcweir 172*cdf0e10cSrcweir ::rtl::OUString createDefaultName( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData>& _xMetaData, 173*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess>& _xTables, 174*cdf0e10cSrcweir const ::rtl::OUString& _sName); 175*cdf0e10cSrcweir 176*cdf0e10cSrcweir /** checks if the given name exists in the database context 177*cdf0e10cSrcweir */ 178*cdf0e10cSrcweir sal_Bool checkDataSourceAvailable( const ::rtl::OUString& _sDataSourceName, 179*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _xFactory_xORB); 180*cdf0e10cSrcweir 181*cdf0e10cSrcweir /** maps SvxCellHorJustify to com::sun::star::awt::TextAlign 182*cdf0e10cSrcweir @param SvxCellHorJustify& _eAlignment 183*cdf0e10cSrcweir @return the corresponding com::sun::star::awt::TextAlign 184*cdf0e10cSrcweir */ 185*cdf0e10cSrcweir sal_Int32 mapTextAllign(const SvxCellHorJustify& _eAlignment); 186*cdf0e10cSrcweir 187*cdf0e10cSrcweir /** retrieves a data source given by name or URL, and displays an error if this fails 188*cdf0e10cSrcweir 189*cdf0e10cSrcweir Any <type scope="com::sun::star::sdbc">SQLException</type>s which occur will be displayed. 190*cdf0e10cSrcweir Additionally, and Exceptions which indicate a data source name pointing to a non-existent database 191*cdf0e10cSrcweir URL will also be denoted. Yet more additionally, and other exceptions will be forwarded to 192*cdf0e10cSrcweir a <type scope="com::sun::star::sdb">InteractionHandler</type>. 193*cdf0e10cSrcweir 194*cdf0e10cSrcweir @param _rDataSourceName 195*cdf0e10cSrcweir the URL of the database document, or the name of a registered data source 196*cdf0e10cSrcweir @param _pErrorMessageParent 197*cdf0e10cSrcweir the window to use as parent for error messages 198*cdf0e10cSrcweir @param _rxORB 199*cdf0e10cSrcweir a service factory to use for components to be created 200*cdf0e10cSrcweir @param _pErrorInfo 201*cdf0e10cSrcweir takes the error info in case of failure. If <NULL/>, the error is displayed to the user. 202*cdf0e10cSrcweir */ 203*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDataSource > 204*cdf0e10cSrcweir getDataSourceByName( 205*cdf0e10cSrcweir const ::rtl::OUString& _rDataSourceName, 206*cdf0e10cSrcweir Window* _pErrorMessageParent, 207*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > _rxORB, 208*cdf0e10cSrcweir ::dbtools::SQLExceptionInfo* _pErrorInfo 209*cdf0e10cSrcweir ); 210*cdf0e10cSrcweir 211*cdf0e10cSrcweir /** returns either the model when data source is given as parameter, 212*cdf0e10cSrcweir or returns a data source when a model is given. 213*cdf0e10cSrcweir @param _xObject Either a data source or a model. 214*cdf0e10cSrcweir */ 215*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > getDataSourceOrModel(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xObject); 216*cdf0e10cSrcweir 217*cdf0e10cSrcweir /** maps com::sun::star::awt::TextAlign to SvxCellHorJustify 218*cdf0e10cSrcweir @param com::sun::star::awt::TextAlign& _nAlignment 219*cdf0e10cSrcweir @return the corresponding SvxCellHorJustify 220*cdf0e10cSrcweir */ 221*cdf0e10cSrcweir SvxCellHorJustify mapTextJustify(const sal_Int32& _nAlignment); 222*cdf0e10cSrcweir 223*cdf0e10cSrcweir /** convert Font to ::com::sun::star::awt::FontDescriptor 224*cdf0e10cSrcweir @param _rFont Font to be converted 225*cdf0e10cSrcweir @return the new FontDescriptor 226*cdf0e10cSrcweir */ 227*cdf0e10cSrcweir ::com::sun::star::awt::FontDescriptor CreateFontDescriptor( const Font& _rFont ); 228*cdf0e10cSrcweir 229*cdf0e10cSrcweir /** call teh format dialog and set the selected format at the column 230*cdf0e10cSrcweir @param _xAffectedCol Font to be converted 231*cdf0e10cSrcweir @param _xField Font to be converted 232*cdf0e10cSrcweir */ 233*cdf0e10cSrcweir void callColumnFormatDialog(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _xAffectedCol, 234*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _xField, 235*cdf0e10cSrcweir SvNumberFormatter* _pFormatter, 236*cdf0e10cSrcweir Window* _pParent); 237*cdf0e10cSrcweir 238*cdf0e10cSrcweir /** second variant of the function before 239*cdf0e10cSrcweir */ 240*cdf0e10cSrcweir sal_Bool callColumnFormatDialog(Window* _pParent, 241*cdf0e10cSrcweir SvNumberFormatter* _pFormatter, 242*cdf0e10cSrcweir sal_Int32 _nDataType, 243*cdf0e10cSrcweir sal_Int32& _nFormatKey, 244*cdf0e10cSrcweir SvxCellHorJustify& _eJustify, 245*cdf0e10cSrcweir sal_uInt16& _nFlags, 246*cdf0e10cSrcweir sal_Bool _bHasFormat); 247*cdf0e10cSrcweir /** append a name to tablefilter of a datasource 248*cdf0e10cSrcweir @param _xConnection the connection is need to get the datasource 249*cdf0e10cSrcweir @param _sName the name which should be appended 250*cdf0e10cSrcweir @param _xFactory needed to check if datasource is available 251*cdf0e10cSrcweir @param _pParent needed when an error must be shown 252*cdf0e10cSrcweir @return false when datsource is not available otherwise true 253*cdf0e10cSrcweir */ 254*cdf0e10cSrcweir sal_Bool appendToFilter(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _xConnection, 255*cdf0e10cSrcweir const ::rtl::OUString& _sName, 256*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _xFactory, 257*cdf0e10cSrcweir Window* _pParent); 258*cdf0e10cSrcweir 259*cdf0e10cSrcweir /** notifySystemWindow adds or remove the given window _pToRegister at the Systemwindow found when search _pWindow. 260*cdf0e10cSrcweir @param _pWindow 261*cdf0e10cSrcweir The window which is used to search for the SystemWindow. 262*cdf0e10cSrcweir @param _pToRegister 263*cdf0e10cSrcweir The window which should be added or removed on the TaskPaneList. 264*cdf0e10cSrcweir @param _rMemFunc 265*cdf0e10cSrcweir The member function which should be called at the SystemWindow when found. 266*cdf0e10cSrcweir Possible values are: 267*cdf0e10cSrcweir ::comphelper::mem_fun(&TaskPaneList::AddWindow) 268*cdf0e10cSrcweir ::comphelper::mem_fun(&TaskPaneList::RemoveWindow) 269*cdf0e10cSrcweir */ 270*cdf0e10cSrcweir void notifySystemWindow(Window* _pWindow, 271*cdf0e10cSrcweir Window* _pToRegister, 272*cdf0e10cSrcweir ::comphelper::mem_fun1_t<TaskPaneList,Window*> _rMemFunc); 273*cdf0e10cSrcweir 274*cdf0e10cSrcweir /** adjustToolBoxSize checks if the size of the ToolBox is still valid. If not it will be resized. 275*cdf0e10cSrcweir @param _pToolBox 276*cdf0e10cSrcweir The Toolbox which should be resized. 277*cdf0e10cSrcweir */ 278*cdf0e10cSrcweir void adjustToolBoxSize(ToolBox* _pToolBox); 279*cdf0e10cSrcweir 280*cdf0e10cSrcweir /** isHiContrast check if we are in hi contrast mode. 281*cdf0e10cSrcweir @param _pWindow 282*cdf0e10cSrcweir The window we have to check on. 283*cdf0e10cSrcweir @return 284*cdf0e10cSrcweir <TRUE/> if so, otherwise <FALSE/> 285*cdf0e10cSrcweir */ 286*cdf0e10cSrcweir sal_Bool isHiContrast(Window* _pWindow); 287*cdf0e10cSrcweir 288*cdf0e10cSrcweir void adjustBrowseBoxColumnWidth( ::svt::EditBrowseBox* _pBox, sal_uInt16 _nColId ); 289*cdf0e10cSrcweir 290*cdf0e10cSrcweir /** check if SQL92 name checking is enabled 291*cdf0e10cSrcweir @param _xConnection 292*cdf0e10cSrcweir Used to get the datasource as parent from the connection. 293*cdf0e10cSrcweir @return 294*cdf0e10cSrcweir <TRUE/> if so otherwise <FALSE/> 295*cdf0e10cSrcweir */ 296*cdf0e10cSrcweir sal_Bool isSQL92CheckEnabled(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _xConnection); 297*cdf0e10cSrcweir 298*cdf0e10cSrcweir /** check if the alias name of the table should be added at select statements 299*cdf0e10cSrcweir @param _xConnection 300*cdf0e10cSrcweir Used to get the datasource as parent from the connection. 301*cdf0e10cSrcweir @return 302*cdf0e10cSrcweir <TRUE/> if so otherwise <FALSE/> 303*cdf0e10cSrcweir */ 304*cdf0e10cSrcweir sal_Bool isAppendTableAliasEnabled(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _xConnection); 305*cdf0e10cSrcweir 306*cdf0e10cSrcweir /** determines whether when generating SQL statements, AS should be placed before a table alias 307*cdf0e10cSrcweir */ 308*cdf0e10cSrcweir sal_Bool generateAsBeforeTableAlias( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _rxConnection ); 309*cdf0e10cSrcweir 310*cdf0e10cSrcweir /** fills the bool and string value with information out of the datasource info property 311*cdf0e10cSrcweir @param _xDatasource 312*cdf0e10cSrcweir Asked for the properties. 313*cdf0e10cSrcweir @param _rAutoIncrementValueEnabled 314*cdf0e10cSrcweir <OUT/> Set to sal_True when the property was set in the datasource. 315*cdf0e10cSrcweir @param _rsAutoIncrementValue 316*cdf0e10cSrcweir <OUT/> Set to the value when the property was set in the datasource. 317*cdf0e10cSrcweir */ 318*cdf0e10cSrcweir void fillAutoIncrementValue(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _xDatasource 319*cdf0e10cSrcweir ,sal_Bool& _rAutoIncrementValueEnabled 320*cdf0e10cSrcweir ,::rtl::OUString& _rsAutoIncrementValue); 321*cdf0e10cSrcweir 322*cdf0e10cSrcweir /** fills the bool and string value with information out of the datasource info property 323*cdf0e10cSrcweir @param _xConnection 324*cdf0e10cSrcweir Used to get the datasource as parent from the connection. 325*cdf0e10cSrcweir @param _rAutoIncrementValueEnabled 326*cdf0e10cSrcweir <OUT/> Set to sal_True when the property was set in the datasource. 327*cdf0e10cSrcweir @param _rsAutoIncrementValue 328*cdf0e10cSrcweir <OUT/> Set to the value when the property was set in the datasource. 329*cdf0e10cSrcweir */ 330*cdf0e10cSrcweir void fillAutoIncrementValue(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _xConnection 331*cdf0e10cSrcweir ,sal_Bool& _rAutoIncrementValueEnabled 332*cdf0e10cSrcweir ,::rtl::OUString& _rsAutoIncrementValue); 333*cdf0e10cSrcweir 334*cdf0e10cSrcweir /** creates the URL or the help agent 335*cdf0e10cSrcweir @param _sModuleName 336*cdf0e10cSrcweir @param _nHelpId 337*cdf0e10cSrcweir @return 338*cdf0e10cSrcweir The URL for the help agent to dispatch. 339*cdf0e10cSrcweir */ 340*cdf0e10cSrcweir ::com::sun::star::util::URL createHelpAgentURL(const ::rtl::OUString& _sModuleName,const rtl::OString& _rHelpId); 341*cdf0e10cSrcweir 342*cdf0e10cSrcweir /** set the evaluation flag at the number formatter 343*cdf0e10cSrcweir @param _rxFormatter 344*cdf0e10cSrcweir */ 345*cdf0e10cSrcweir void setEvalDateFormatForFormatter(::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& _rxFormatter); 346*cdf0e10cSrcweir 347*cdf0e10cSrcweir /** query for a type info which can be used to create a primary key column 348*cdf0e10cSrcweir @param _rTypeInfo 349*cdf0e10cSrcweir The map which contains all available types. 350*cdf0e10cSrcweir @return 351*cdf0e10cSrcweir The type info which can be used to create a primary key column. 352*cdf0e10cSrcweir */ 353*cdf0e10cSrcweir TOTypeInfoSP queryPrimaryKeyType(const OTypeInfoMap& _rTypeInfo); 354*cdf0e10cSrcweir 355*cdf0e10cSrcweir /** query for a specific type. 356*cdf0e10cSrcweir @param _nDataType 357*cdf0e10cSrcweir The type we are searching. 358*cdf0e10cSrcweir @param _rTypeInfo 359*cdf0e10cSrcweir The map which contains all available types. 360*cdf0e10cSrcweir @return 361*cdf0e10cSrcweir The type or <NULL/> if we can't find it. 362*cdf0e10cSrcweir */ 363*cdf0e10cSrcweir TOTypeInfoSP queryTypeInfoByType(sal_Int32 _nDataType,const OTypeInfoMap& _rTypeInfo); 364*cdf0e10cSrcweir 365*cdf0e10cSrcweir /** returns the configuration node name of user defined drivers. 366*cdf0e10cSrcweir @return 367*cdf0e10cSrcweir the configuration node name of user defined drivers. 368*cdf0e10cSrcweir */ 369*cdf0e10cSrcweir 370*cdf0e10cSrcweir /** returns the result of the user action when view the query dialog. 371*cdf0e10cSrcweir @param _pParent 372*cdf0e10cSrcweir The parent of the dialog 373*cdf0e10cSrcweir @param _nTitle 374*cdf0e10cSrcweir A string resource id for the text which will be displayed as title. 375*cdf0e10cSrcweir @param _nText 376*cdf0e10cSrcweir A string resource id for the text which will be displayed above the buttons. 377*cdf0e10cSrcweir When the string contains a #1. This will be replaced by the name. 378*cdf0e10cSrcweir @param _bAll 379*cdf0e10cSrcweir When set to <TRUE/>, the all button will be appended. 380*cdf0e10cSrcweir @param _sName 381*cdf0e10cSrcweir The name of the object to ask for. 382*cdf0e10cSrcweir @return 383*cdf0e10cSrcweir RET_YES, RET_NO, RET_ALL 384*cdf0e10cSrcweir */ 385*cdf0e10cSrcweir sal_Int32 askForUserAction(Window* _pParent,sal_uInt16 _nTitle,sal_uInt16 _nText,sal_Bool _bAll,const ::rtl::OUString& _sName); 386*cdf0e10cSrcweir 387*cdf0e10cSrcweir /** creates a new view from a query or table 388*cdf0e10cSrcweir @param _sName 389*cdf0e10cSrcweir The name of the view to be created. 390*cdf0e10cSrcweir @param _xConnection 391*cdf0e10cSrcweir The source connection. 392*cdf0e10cSrcweir @param _xSourceObject 393*cdf0e10cSrcweir The object for which a view should be created. 394*cdf0e10cSrcweir @return 395*cdf0e10cSrcweir The created view. 396*cdf0e10cSrcweir */ 397*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> createView( const ::rtl::OUString& _sName 398*cdf0e10cSrcweir ,const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _xConnection 399*cdf0e10cSrcweir ,const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _xSourceObject); 400*cdf0e10cSrcweir 401*cdf0e10cSrcweir /** creates a view with the given command 402*cdf0e10cSrcweir */ 403*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> createView( 404*cdf0e10cSrcweir const ::rtl::OUString& _rName, 405*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _xConnection, 406*cdf0e10cSrcweir const ::rtl::OUString& _rCommand 407*cdf0e10cSrcweir ); 408*cdf0e10cSrcweir 409*cdf0e10cSrcweir /** returns the stripped database name. 410*cdf0e10cSrcweir @param _xDataSource 411*cdf0e10cSrcweir The data source 412*cdf0e10cSrcweir @param _rsDatabaseName 413*cdf0e10cSrcweir Will be filled with the original data source if it is empty. 414*cdf0e10cSrcweir @return 415*cdf0e10cSrcweir The stripped database name either the registered naem or if it is a file url the last segment. 416*cdf0e10cSrcweir */ 417*cdf0e10cSrcweir ::rtl::OUString getStrippedDatabaseName(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _xDataSource 418*cdf0e10cSrcweir ,::rtl::OUString& _rsDatabaseName); 419*cdf0e10cSrcweir 420*cdf0e10cSrcweir /** returns the standard database filter 421*cdf0e10cSrcweir @retrun 422*cdf0e10cSrcweir the filter 423*cdf0e10cSrcweir */ 424*cdf0e10cSrcweir const SfxFilter* getStandardDatabaseFilter(); 425*cdf0e10cSrcweir 426*cdf0e10cSrcweir /** opens a save dialog to store a form or report folder in the current hierachy. 427*cdf0e10cSrcweir @param _pParent 428*cdf0e10cSrcweir The parent of the dialog. 429*cdf0e10cSrcweir @param _rxORB 430*cdf0e10cSrcweir a multi service factory which can be used to instantiate usual global services 431*cdf0e10cSrcweir @param _xNames 432*cdf0e10cSrcweir Where to insert the new object. 433*cdf0e10cSrcweir @param _sParentFolder 434*cdf0e10cSrcweir The name of the parent folder. 435*cdf0e10cSrcweir @param _bForm 436*cdf0e10cSrcweir <TRUE/> if a form should be inserted 437*cdf0e10cSrcweir @param _bCollection 438*cdf0e10cSrcweir A folder should be inserted 439*cdf0e10cSrcweir @param _xContent 440*cdf0e10cSrcweir The content which should be copied. 441*cdf0e10cSrcweir @param _bMove 442*cdf0e10cSrcweir if <TRUE/> the name of the content must be inserted without any change, otherwise not. 443*cdf0e10cSrcweir @return 444*cdf0e10cSrcweir <TRUE/> if the insert opertions was successfull, otherwise <FALSE/>. 445*cdf0e10cSrcweir */ 446*cdf0e10cSrcweir sal_Bool insertHierachyElement( 447*cdf0e10cSrcweir Window* _pParent, 448*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB, 449*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::container::XHierarchicalNameContainer>& _xNames, 450*cdf0e10cSrcweir const String& _sParentFolder, 451*cdf0e10cSrcweir sal_Bool _bForm, 452*cdf0e10cSrcweir sal_Bool _bCollection = sal_True, 453*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XContent>& _xContent = NULL, 454*cdf0e10cSrcweir sal_Bool _bMove = sal_False 455*cdf0e10cSrcweir ); 456*cdf0e10cSrcweir 457*cdf0e10cSrcweir /** creates a number formatter 458*cdf0e10cSrcweir @param _rxConnection 459*cdf0e10cSrcweir The connection is needed to create the formatter 460*cdf0e10cSrcweir @param _rMF 461*cdf0e10cSrcweir The multi service factory 462*cdf0e10cSrcweir */ 463*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter > getNumberFormatter(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection,const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rMF ); 464*cdf0e10cSrcweir 465*cdf0e10cSrcweir // this completes a help url with the system parameters "Language" and "System" 466*cdf0e10cSrcweir // detect installed locale 467*cdf0e10cSrcweir void AppendConfigToken( ::rtl::OUString& _rURL, sal_Bool _bQuestionMark ); 468*cdf0e10cSrcweir 469*cdf0e10cSrcweir // ......................................................................... 470*cdf0e10cSrcweir } 471*cdf0e10cSrcweir // ......................................................................... 472*cdf0e10cSrcweir #endif // DBAUI_TOOLS_HXX 473*cdf0e10cSrcweir 474*cdf0e10cSrcweir 475