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