Tag: cws_src680_hsqlcsv
User: fs      
Date: 2006/09/14 05:22:40

Modified:
   dba/dbaccess/source/core/dataaccess/connection.cxx
   dba/dbaccess/source/core/dataaccess/connection.hxx

Log:
 #i69526# XTableUIProvider

File Changes:

Directory: /dba/dbaccess/source/core/dataaccess/
================================================

File [changed]: connection.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/connection.cxx?r1=1.48&r2=1.48.18.1
Delta lines:  +42 -3
--------------------
--- connection.cxx      10 Jul 2006 15:09:51 -0000      1.48
+++ connection.cxx      14 Sep 2006 12:22:37 -0000      1.48.18.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: connection.cxx,v $
  *
- *  $Revision: 1.48 $
+ *  $Revision: 1.48.18.1 $
  *
- *  last change: $Author: obo $ $Date: 2006/07/10 15:09:51 $
+ *  last change: $Author: fs $ $Date: 2006/09/14 12:22:37 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -124,6 +124,7 @@
 using namespace ::com::sun::star::beans;
 using namespace ::com::sun::star::reflection;
 using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::graphic;
 using namespace ::osl;
 using namespace ::comphelper;
 using namespace ::cppu;
@@ -373,8 +374,11 @@
        }
        catch(const Exception&)
        {
+        DBG_UNHANDLED_EXCEPTION();
        }
 
+    m_xTableUIProvider = m_xTableUIProvider.query( m_xMasterConnection );
+
        try
        {
                m_xQueries = new OQueryContainer(Reference< XNameContainer 
>(_rDB.getQueryDefinitions( ),UNO_QUERY), this,_rxORB, &m_aWarnings);
@@ -846,6 +850,41 @@
        DBG_UNHANDLED_EXCEPTION();
     }
 }
+
+// 
-----------------------------------------------------------------------------
+Reference< XGraphic > SAL_CALL OConnection::getTableIcon( const 
::rtl::OUString& _TableName, ::sal_Int16 _ColorMode ) throw (RuntimeException)
+{
+    Reference< XGraphic > xReturn;
+
+    // ask our aggregate
+    if ( m_xTableUIProvider.is() )
+        xReturn = m_xTableUIProvider->getTableIcon( _TableName, _ColorMode );
+
+    // ask ourself
+    // well, we don't have own functionality here ...
+    // In the future, we might decide to delegate the complete handling to 
this interface.
+    // In this case, we would need to load the icon here.
+
+    return xReturn;
+}
+
+// 
-----------------------------------------------------------------------------
+Reference< XInterface > SAL_CALL OConnection::getTableEditor( const 
::rtl::OUString& _TableName ) throw (IllegalArgumentException, 
WrappedTargetException, RuntimeException)
+{
+    Reference< XInterface > xReturn;
+
+    // ask our aggregate
+    if ( m_xTableUIProvider.is() )
+        xReturn = m_xTableUIProvider->getTableEditor( _TableName );
+
+    // ask ourself
+    // well, we don't have own functionality here ...
+    // In the future, we might decide to delegate the complete handling to 
this interface.
+    // In this case, we would need to instantiate an css.sdb.TableDesign here.
+
+    return xReturn;
+}
+
 
 //........................................................................
 }      // namespace dbaccess

File [changed]: connection.hxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/connection.hxx?r1=1.24&r2=1.24.46.1
Delta lines:  +19 -9
--------------------
--- connection.hxx      10 Jul 2006 15:10:04 -0000      1.24
+++ connection.hxx      14 Sep 2006 12:22:37 -0000      1.24.46.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: connection.hxx,v $
  *
- *  $Revision: 1.24 $
+ *  $Revision: 1.24.46.1 $
  *
- *  last change: $Author: obo $ $Date: 2006/07/10 15:10:04 $
+ *  last change: $Author: fs $ $Date: 2006/09/14 12:22:37 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -88,11 +88,14 @@
 #ifndef _COM_SUN_STAR_SDB_TOOLS_XCONNECTIONTOOLS_HPP_
 #include <com/sun/star/sdb/tools/XConnectionTools.hpp>
 #endif
+#ifndef _COM_SUN_STAR_SDB_APPLICATION_XTABLEUIPROVIDER_HPP_
+#include <com/sun/star/sdb/application/XTableUIProvider.hpp>
+#endif
 /** === end UNO includes === **/
 
-#if ! defined(INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_13)
-#define INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_13
-#define COMPHELPER_IMPLBASE_INTERFACE_NUMBER 13
+#if ! defined(INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_14)
+#define INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_14
+#define COMPHELPER_IMPLBASE_INTERFACE_NUMBER 14
 #include <comphelper/implbase_var.hxx>
 #endif
 
@@ -111,7 +114,7 @@
 
 //==========================================================================
 //==========================================================================
-typedef ::comphelper::ImplHelper13  <   ::com::sun::star::container::XChild
+typedef ::comphelper::ImplHelper14  <   ::com::sun::star::container::XChild
                                     ,   
::com::sun::star::sdbcx::XTablesSupplier
                                     ,   ::com::sun::star::sdbcx::XViewsSupplier
                                     ,   ::com::sun::star::sdbc::XConnection
@@ -124,6 +127,7 @@
                                     ,   ::com::sun::star::sdbcx::XUsersSupplier
                                     ,   
::com::sun::star::sdbcx::XGroupsSupplier
                                     ,   
::com::sun::star::sdb::tools::XConnectionTools
+                                    ,   
::com::sun::star::sdb::application::XTableUIProvider
                                     >   OConnection_Base;
 
 class ODatabaseSource;
@@ -150,6 +154,8 @@
     ::comphelper::ComponentContext                      m_aContext;
        ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > 
                        m_xMasterConnection;
     ::com::sun::star::uno::Reference< 
::com::sun::star::sdb::tools::XConnectionTools >  m_xConnectionTools;
+    ::com::sun::star::uno::Reference< 
::com::sun::star::sdb::application::XTableUIProvider >    m_xTableUIProvider;
+
 
        OTableContainer*                        m_pTables;
        OViewContainer*                         m_pViews;
@@ -241,6 +247,10 @@
     virtual ::com::sun::star::uno::Reference< 
::com::sun::star::sdb::tools::XTableName > SAL_CALL createTableName(  ) throw 
(::com::sun::star::uno::RuntimeException);
     virtual ::com::sun::star::uno::Reference< 
::com::sun::star::sdb::tools::XObjectNames > SAL_CALL getObjectNames(  ) throw 
(::com::sun::star::uno::RuntimeException);
     virtual ::com::sun::star::uno::Reference< 
::com::sun::star::sdb::tools::XDataSourceMetaData > SAL_CALL 
getDataSourceMetaData(  ) throw (::com::sun::star::uno::RuntimeException);
+
+    // XTableUIProvider
+    virtual ::com::sun::star::uno::Reference< 
::com::sun::star::graphic::XGraphic > SAL_CALL getTableIcon( const 
::rtl::OUString& TableName, ::sal_Int16 ColorMode ) throw 
(::com::sun::star::uno::RuntimeException);
+    virtual ::com::sun::star::uno::Reference< 
::com::sun::star::uno::XInterface > SAL_CALL getTableEditor( const 
::rtl::OUString& TableName ) throw 
(::com::sun::star::lang::IllegalArgumentException, 
::com::sun::star::lang::WrappedTargetException, 
::com::sun::star::uno::RuntimeException);
 
     // IRefreshListener
        virtual void refresh(const ::com::sun::star::uno::Reference< 
::com::sun::star::container::XNameAccess >& _rToBeRefreshed);




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to