diff options
Diffstat (limited to 'dbaccess/source/ui/misc/dsmeta.cxx')
-rw-r--r-- | dbaccess/source/ui/misc/dsmeta.cxx | 164 |
1 files changed, 83 insertions, 81 deletions
diff --git a/dbaccess/source/ui/misc/dsmeta.cxx b/dbaccess/source/ui/misc/dsmeta.cxx index 98e7ef3afe33..10f955e4a7d2 100644 --- a/dbaccess/source/ui/misc/dsmeta.cxx +++ b/dbaccess/source/ui/misc/dsmeta.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: dsmeta.cxx,v $ - * $Revision: 1.8 $ + * $Revision: 1.8.8.2 $ * * This file is part of OpenOffice.org. * @@ -47,7 +47,7 @@ namespace dbaui { // strange ctor, but makes instantiating this class more readable (see below) InitAdvanced( short _Generated, short _SQL, short _Append, short _As, short _Outer, short _Priv, short _Param, - short _Version, short _Catalog, short _Schema, short _Index, short _DOS, short _Required, short _Bool,short _IgnoreCur ) + short _Version, short _Catalog, short _Schema, short _Index, short _DOS, short _Required, short _Bool,short _IgnoreCur,short _AutoPKey ) :AdvancedSettingsSupport() { bGeneratedValues = ( _Generated != 0 ); @@ -65,6 +65,7 @@ namespace dbaui bBooleanComparisonMode = ( _Bool != 0 ); bFormsCheckRequiredFields = ( _Required != 0 ); bIgnoreCurrency = ( _IgnoreCur != 0 ); + bAutoIncrementIsPrimaryKey = ( _AutoPKey != 0 ); } enum Special { All, None }; @@ -87,6 +88,7 @@ namespace dbaui bBooleanComparisonMode = ( _eType == All ); bFormsCheckRequiredFields = ( _eType == All ); bIgnoreCurrency = false; // Oracle special + bAutoIncrementIsPrimaryKey = false; // hsqldb special } }; @@ -110,95 +112,95 @@ namespace dbaui //= global tables //==================================================================== //-------------------------------------------------------------------- - static const AdvancedSettingsSupport& getAdvancedSettingsSupport( DATASOURCE_TYPE _eType ) + static const AdvancedSettingsSupport& getAdvancedSettingsSupport( ::dbaccess::DATASOURCE_TYPE _eType ) { - typedef ::std::map< DATASOURCE_TYPE, AdvancedSettingsSupport > AdvancedSupport; + typedef ::std::map< ::dbaccess::DATASOURCE_TYPE, AdvancedSettingsSupport > AdvancedSupport; static AdvancedSupport s_aSupport; if ( s_aSupport.empty() ) { - s_aSupport[ DST_MSACCESS ] = InitAdvanced( 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0 ); - s_aSupport[ DST_MYSQL_ODBC ] = InitAdvanced( 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0 ); - s_aSupport[ DST_MYSQL_JDBC ] = InitAdvanced( 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0 ); - s_aSupport[ DST_MYSQL_NATIVE ] = InitAdvanced( 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0 ); - s_aSupport[ DST_ORACLE_JDBC ] = InitAdvanced( InitAdvanced::All ); - s_aSupport[ DST_ADABAS ] = InitAdvanced( 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0 ); - s_aSupport[ DST_CALC ] = InitAdvanced( InitAdvanced::None ); - s_aSupport[ DST_DBASE ] = InitAdvanced( 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 ); - s_aSupport[ DST_FLAT ] = InitAdvanced( 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ); - s_aSupport[ DST_JDBC ] = InitAdvanced( InitAdvanced::All ); - s_aSupport[ DST_ODBC ] = InitAdvanced( InitAdvanced::All ); - s_aSupport[ DST_ADO ] = InitAdvanced( 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0 ); - s_aSupport[ DST_MOZILLA ] = InitAdvanced( InitAdvanced::None ); - s_aSupport[ DST_THUNDERBIRD ] = InitAdvanced( InitAdvanced::None ); - s_aSupport[ DST_LDAP ] = InitAdvanced( InitAdvanced::None ); - s_aSupport[ DST_OUTLOOK ] = InitAdvanced( InitAdvanced::None ); - s_aSupport[ DST_OUTLOOKEXP ] = InitAdvanced( InitAdvanced::None ); - s_aSupport[ DST_EVOLUTION ] = InitAdvanced( InitAdvanced::None ); - s_aSupport[ DST_EVOLUTION_GROUPWISE ] = InitAdvanced( InitAdvanced::None ); - s_aSupport[ DST_EVOLUTION_LDAP ] = InitAdvanced( InitAdvanced::None ); - s_aSupport[ DST_KAB ] = InitAdvanced( InitAdvanced::None ); - s_aSupport[ DST_MACAB ] = InitAdvanced( InitAdvanced::None ); - s_aSupport[ DST_MSACCESS_2007 ] = InitAdvanced( 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0 ); - s_aSupport[ DST_EMBEDDED_HSQLDB ] = InitAdvanced( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0 ); - s_aSupport[ DST_USERDEFINE1 ] = InitAdvanced( InitAdvanced::All ); - s_aSupport[ DST_USERDEFINE2 ] = InitAdvanced( InitAdvanced::All ); - s_aSupport[ DST_USERDEFINE3 ] = InitAdvanced( InitAdvanced::All ); - s_aSupport[ DST_USERDEFINE4 ] = InitAdvanced( InitAdvanced::All ); - s_aSupport[ DST_USERDEFINE5 ] = InitAdvanced( InitAdvanced::All ); - s_aSupport[ DST_USERDEFINE6 ] = InitAdvanced( InitAdvanced::All ); - s_aSupport[ DST_USERDEFINE7 ] = InitAdvanced( InitAdvanced::All ); - s_aSupport[ DST_USERDEFINE8 ] = InitAdvanced( InitAdvanced::All ); - s_aSupport[ DST_USERDEFINE9 ] = InitAdvanced( InitAdvanced::All ); - s_aSupport[ DST_USERDEFINE10 ] = InitAdvanced( InitAdvanced::All ); + s_aSupport[ ::dbaccess::DST_MSACCESS ] = InitAdvanced( 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0 ); + s_aSupport[ ::dbaccess::DST_MYSQL_ODBC ] = InitAdvanced( 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0 ); + s_aSupport[ ::dbaccess::DST_MYSQL_JDBC ] = InitAdvanced( 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0 ); + s_aSupport[ ::dbaccess::DST_MYSQL_NATIVE ] = InitAdvanced( 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0 ); + s_aSupport[ ::dbaccess::DST_ORACLE_JDBC ] = InitAdvanced( InitAdvanced::All ); + s_aSupport[ ::dbaccess::DST_ADABAS ] = InitAdvanced( 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0 ); + s_aSupport[ ::dbaccess::DST_CALC ] = InitAdvanced( InitAdvanced::None ); + s_aSupport[ ::dbaccess::DST_DBASE ] = InitAdvanced( 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 ); + s_aSupport[ ::dbaccess::DST_FLAT ] = InitAdvanced( 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ); + s_aSupport[ ::dbaccess::DST_JDBC ] = InitAdvanced( InitAdvanced::All ); + s_aSupport[ ::dbaccess::DST_ODBC ] = InitAdvanced( InitAdvanced::All ); + s_aSupport[ ::dbaccess::DST_ADO ] = InitAdvanced( 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0 ); + s_aSupport[ ::dbaccess::DST_MOZILLA ] = InitAdvanced( InitAdvanced::None ); + s_aSupport[ ::dbaccess::DST_THUNDERBIRD ] = InitAdvanced( InitAdvanced::None ); + s_aSupport[ ::dbaccess::DST_LDAP ] = InitAdvanced( InitAdvanced::None ); + s_aSupport[ ::dbaccess::DST_OUTLOOK ] = InitAdvanced( InitAdvanced::None ); + s_aSupport[ ::dbaccess::DST_OUTLOOKEXP ] = InitAdvanced( InitAdvanced::None ); + s_aSupport[ ::dbaccess::DST_EVOLUTION ] = InitAdvanced( InitAdvanced::None ); + s_aSupport[ ::dbaccess::DST_EVOLUTION_GROUPWISE ] = InitAdvanced( InitAdvanced::None ); + s_aSupport[ ::dbaccess::DST_EVOLUTION_LDAP ] = InitAdvanced( InitAdvanced::None ); + s_aSupport[ ::dbaccess::DST_KAB ] = InitAdvanced( InitAdvanced::None ); + s_aSupport[ ::dbaccess::DST_MACAB ] = InitAdvanced( InitAdvanced::None ); + s_aSupport[ ::dbaccess::DST_MSACCESS_2007 ] = InitAdvanced( 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0 ); + s_aSupport[ ::dbaccess::DST_EMBEDDED_HSQLDB ] = InitAdvanced( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1 ); + s_aSupport[ ::dbaccess::DST_USERDEFINE1 ] = InitAdvanced( InitAdvanced::All ); + s_aSupport[ ::dbaccess::DST_USERDEFINE2 ] = InitAdvanced( InitAdvanced::All ); + s_aSupport[ ::dbaccess::DST_USERDEFINE3 ] = InitAdvanced( InitAdvanced::All ); + s_aSupport[ ::dbaccess::DST_USERDEFINE4 ] = InitAdvanced( InitAdvanced::All ); + s_aSupport[ ::dbaccess::DST_USERDEFINE5 ] = InitAdvanced( InitAdvanced::All ); + s_aSupport[ ::dbaccess::DST_USERDEFINE6 ] = InitAdvanced( InitAdvanced::All ); + s_aSupport[ ::dbaccess::DST_USERDEFINE7 ] = InitAdvanced( InitAdvanced::All ); + s_aSupport[ ::dbaccess::DST_USERDEFINE8 ] = InitAdvanced( InitAdvanced::All ); + s_aSupport[ ::dbaccess::DST_USERDEFINE9 ] = InitAdvanced( InitAdvanced::All ); + s_aSupport[ ::dbaccess::DST_USERDEFINE10 ] = InitAdvanced( InitAdvanced::All ); - s_aSupport[ DST_ORACLE_JDBC ].bIgnoreCurrency = true; + s_aSupport[ ::dbaccess::DST_ORACLE_JDBC ].bIgnoreCurrency = true; } return s_aSupport[ _eType ]; } //-------------------------------------------------------------------- - static AuthenticationMode getAuthenticationMode( DATASOURCE_TYPE _eType ) + static AuthenticationMode getAuthenticationMode( ::dbaccess::DATASOURCE_TYPE _eType ) { - typedef ::std::map< DATASOURCE_TYPE, FeatureSupport > Supported; + typedef ::std::map< ::dbaccess::DATASOURCE_TYPE, FeatureSupport > Supported; static Supported s_aSupport; if ( s_aSupport.empty() ) { - s_aSupport[ DST_MSACCESS ] = FeatureSupport( AuthNone ); - s_aSupport[ DST_MYSQL_NATIVE ] = FeatureSupport( AuthUserPwd ); - s_aSupport[ DST_MYSQL_ODBC ] = FeatureSupport( AuthUserPwd ); - s_aSupport[ DST_MYSQL_JDBC ] = FeatureSupport( AuthUserPwd ); - s_aSupport[ DST_ORACLE_JDBC ] = FeatureSupport( AuthUserPwd ); - s_aSupport[ DST_ADABAS ] = FeatureSupport( AuthUserPwd ); - s_aSupport[ DST_CALC ] = FeatureSupport( AuthPwd ); - s_aSupport[ DST_DBASE ] = FeatureSupport( AuthNone ); - s_aSupport[ DST_FLAT ] = FeatureSupport( AuthNone ); - s_aSupport[ DST_JDBC ] = FeatureSupport( AuthUserPwd ); - s_aSupport[ DST_ODBC ] = FeatureSupport( AuthUserPwd ); - s_aSupport[ DST_ADO ] = FeatureSupport( AuthUserPwd ); - s_aSupport[ DST_MOZILLA ] = FeatureSupport( AuthNone ); - s_aSupport[ DST_THUNDERBIRD ] = FeatureSupport( AuthNone ); - s_aSupport[ DST_LDAP ] = FeatureSupport( AuthUserPwd ); - s_aSupport[ DST_OUTLOOK ] = FeatureSupport( AuthNone ); - s_aSupport[ DST_OUTLOOKEXP ] = FeatureSupport( AuthNone ); - s_aSupport[ DST_EVOLUTION ] = FeatureSupport( AuthNone ); - s_aSupport[ DST_EVOLUTION_GROUPWISE ] = FeatureSupport( AuthNone ); - s_aSupport[ DST_EVOLUTION_LDAP ] = FeatureSupport( AuthNone ); - s_aSupport[ DST_KAB ] = FeatureSupport( AuthNone ); - s_aSupport[ DST_MACAB ] = FeatureSupport( AuthNone ); - s_aSupport[ DST_MSACCESS_2007 ] = FeatureSupport( AuthNone ); - s_aSupport[ DST_EMBEDDED_HSQLDB ] = FeatureSupport( AuthNone ); - s_aSupport[ DST_USERDEFINE1 ] = FeatureSupport( AuthUserPwd ); - s_aSupport[ DST_USERDEFINE2 ] = FeatureSupport( AuthUserPwd ); - s_aSupport[ DST_USERDEFINE3 ] = FeatureSupport( AuthUserPwd ); - s_aSupport[ DST_USERDEFINE4 ] = FeatureSupport( AuthUserPwd ); - s_aSupport[ DST_USERDEFINE5 ] = FeatureSupport( AuthUserPwd ); - s_aSupport[ DST_USERDEFINE6 ] = FeatureSupport( AuthUserPwd ); - s_aSupport[ DST_USERDEFINE7 ] = FeatureSupport( AuthUserPwd ); - s_aSupport[ DST_USERDEFINE8 ] = FeatureSupport( AuthUserPwd ); - s_aSupport[ DST_USERDEFINE9 ] = FeatureSupport( AuthUserPwd ); - s_aSupport[ DST_USERDEFINE10 ] = FeatureSupport( AuthUserPwd ); + s_aSupport[ ::dbaccess::DST_MSACCESS ] = FeatureSupport( AuthNone ); + s_aSupport[ ::dbaccess::DST_MYSQL_NATIVE ] = FeatureSupport( AuthUserPwd ); + s_aSupport[ ::dbaccess::DST_MYSQL_ODBC ] = FeatureSupport( AuthUserPwd ); + s_aSupport[ ::dbaccess::DST_MYSQL_JDBC ] = FeatureSupport( AuthUserPwd ); + s_aSupport[ ::dbaccess::DST_ORACLE_JDBC ] = FeatureSupport( AuthUserPwd ); + s_aSupport[ ::dbaccess::DST_ADABAS ] = FeatureSupport( AuthUserPwd ); + s_aSupport[ ::dbaccess::DST_CALC ] = FeatureSupport( AuthPwd ); + s_aSupport[ ::dbaccess::DST_DBASE ] = FeatureSupport( AuthNone ); + s_aSupport[ ::dbaccess::DST_FLAT ] = FeatureSupport( AuthNone ); + s_aSupport[ ::dbaccess::DST_JDBC ] = FeatureSupport( AuthUserPwd ); + s_aSupport[ ::dbaccess::DST_ODBC ] = FeatureSupport( AuthUserPwd ); + s_aSupport[ ::dbaccess::DST_ADO ] = FeatureSupport( AuthUserPwd ); + s_aSupport[ ::dbaccess::DST_MOZILLA ] = FeatureSupport( AuthNone ); + s_aSupport[ ::dbaccess::DST_THUNDERBIRD ] = FeatureSupport( AuthNone ); + s_aSupport[ ::dbaccess::DST_LDAP ] = FeatureSupport( AuthUserPwd ); + s_aSupport[ ::dbaccess::DST_OUTLOOK ] = FeatureSupport( AuthNone ); + s_aSupport[ ::dbaccess::DST_OUTLOOKEXP ] = FeatureSupport( AuthNone ); + s_aSupport[ ::dbaccess::DST_EVOLUTION ] = FeatureSupport( AuthNone ); + s_aSupport[ ::dbaccess::DST_EVOLUTION_GROUPWISE ] = FeatureSupport( AuthNone ); + s_aSupport[ ::dbaccess::DST_EVOLUTION_LDAP ] = FeatureSupport( AuthNone ); + s_aSupport[ ::dbaccess::DST_KAB ] = FeatureSupport( AuthNone ); + s_aSupport[ ::dbaccess::DST_MACAB ] = FeatureSupport( AuthNone ); + s_aSupport[ ::dbaccess::DST_MSACCESS_2007 ] = FeatureSupport( AuthNone ); + s_aSupport[ ::dbaccess::DST_EMBEDDED_HSQLDB ] = FeatureSupport( AuthNone ); + s_aSupport[ ::dbaccess::DST_USERDEFINE1 ] = FeatureSupport( AuthUserPwd ); + s_aSupport[ ::dbaccess::DST_USERDEFINE2 ] = FeatureSupport( AuthUserPwd ); + s_aSupport[ ::dbaccess::DST_USERDEFINE3 ] = FeatureSupport( AuthUserPwd ); + s_aSupport[ ::dbaccess::DST_USERDEFINE4 ] = FeatureSupport( AuthUserPwd ); + s_aSupport[ ::dbaccess::DST_USERDEFINE5 ] = FeatureSupport( AuthUserPwd ); + s_aSupport[ ::dbaccess::DST_USERDEFINE6 ] = FeatureSupport( AuthUserPwd ); + s_aSupport[ ::dbaccess::DST_USERDEFINE7 ] = FeatureSupport( AuthUserPwd ); + s_aSupport[ ::dbaccess::DST_USERDEFINE8 ] = FeatureSupport( AuthUserPwd ); + s_aSupport[ ::dbaccess::DST_USERDEFINE9 ] = FeatureSupport( AuthUserPwd ); + s_aSupport[ ::dbaccess::DST_USERDEFINE10 ] = FeatureSupport( AuthUserPwd ); } return s_aSupport[ _eType ].eAuthentication; } @@ -209,16 +211,16 @@ namespace dbaui class DataSourceMetaData_Impl { public: - DataSourceMetaData_Impl( DATASOURCE_TYPE _eType ); + DataSourceMetaData_Impl( ::dbaccess::DATASOURCE_TYPE _eType ); - inline DATASOURCE_TYPE getType() const { return m_eType; } + inline ::dbaccess::DATASOURCE_TYPE getType() const { return m_eType; } private: - DATASOURCE_TYPE m_eType; + ::dbaccess::DATASOURCE_TYPE m_eType; }; //-------------------------------------------------------------------- - DataSourceMetaData_Impl::DataSourceMetaData_Impl( DATASOURCE_TYPE _eType ) + DataSourceMetaData_Impl::DataSourceMetaData_Impl( ::dbaccess::DATASOURCE_TYPE _eType ) :m_eType( _eType ) { } @@ -227,7 +229,7 @@ namespace dbaui //= DataSourceMetaData //==================================================================== //-------------------------------------------------------------------- - DataSourceMetaData::DataSourceMetaData( DATASOURCE_TYPE _eType ) + DataSourceMetaData::DataSourceMetaData( ::dbaccess::DATASOURCE_TYPE _eType ) :m_pImpl( new DataSourceMetaData_Impl( _eType ) ) { } @@ -250,7 +252,7 @@ namespace dbaui } //-------------------------------------------------------------------- - AuthenticationMode DataSourceMetaData::getAuthentication( DATASOURCE_TYPE _eType ) + AuthenticationMode DataSourceMetaData::getAuthentication( ::dbaccess::DATASOURCE_TYPE _eType ) { return getAuthenticationMode( _eType ); } |