Tag: cws_dev300_odbmacros3
User: fs      
Date: 2008-07-16 14:23:42+0000
Modified:
   dba/dbaccess/source/core/dataaccess/databasedocument.cxx
   dba/dbaccess/source/core/dataaccess/databasedocument.hxx

Log:
 #i49133# +XEventsSupplier

File Changes:

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

File [changed]: databasedocument.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/databasedocument.cxx?r1=1.40.6.6&r2=1.40.6.7
Delta lines:  +35 -73
---------------------
--- databasedocument.cxx        2008-07-01 07:39:19+0000        1.40.6.6
+++ databasedocument.cxx        2008-07-16 14:23:40+0000        1.40.6.7
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: databasedocument.cxx,v $
- * $Revision: 1.40.6.6 $
+ * $Revision: 1.40.6.7 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -35,88 +35,42 @@
 #include "databasedocument.hxx"
 #include "dbastrings.hrc"
 #include "module_dba.hxx"
+#include "documentevents.hxx"
+#include "databasecontext.hxx"
+#include "documentcontainer.hxx"
 
-#include <comphelper/documentconstants.hxx>
-#include <comphelper/namedvaluecollection.hxx>
-#include <comphelper/enumhelper.hxx>
-#include <comphelper/numberedcollection.hxx>
-#include <framework/titlehelper.hxx>
-#ifndef _COM_SUN_STAR_EMBED_XTRANSACTEDOBJECT_HPP_
+/** === begin UNO includes === **/
+#include <com/sun/star/document/XExporter.hpp>
+#include <com/sun/star/document/XFilter.hpp>
+#include <com/sun/star/document/XImporter.hpp>
+#include <com/sun/star/embed/EntryInitModes.hpp>
+#include <com/sun/star/embed/XEmbedPersist.hpp>
 #include <com/sun/star/embed/XTransactedObject.hpp>
-#endif
-#ifndef _COM_SUN_STAR_IO_XACTIVEDATASOURCE_HPP_
+#include <com/sun/star/embed/XTransactionBroadcaster.hpp>
 #include <com/sun/star/io/XActiveDataSource.hpp>
-#endif
-#ifndef _COM_SUN_STAR_IO_XSEEKABLE_HPP_
 #include <com/sun/star/io/XSeekable.hpp>
-#endif
-#ifndef _COM_SUN_STAR_TASK_XSTATUSINDICATOR_HPP_
+#include <com/sun/star/script/provider/XScriptProviderFactory.hpp>
+#include <com/sun/star/task/ErrorCodeIOException.hpp>
 #include <com/sun/star/task/XStatusIndicator.hpp>
-#endif
-#ifndef _COM_SUN_STAR_TASK_XSTATUSINDICATORFACTORY_HPP_
 #include <com/sun/star/task/XStatusIndicatorFactory.hpp>
-#endif
-#ifndef _COM_SUN_STAR_DOCUMENT_XEXPORTER_HPP_
-#include <com/sun/star/document/XExporter.hpp>
-#endif
-#ifndef _COM_SUN_STAR_DOCUMENT_XFILTER_HPP_
-#include <com/sun/star/document/XFilter.hpp>
-#endif
-#ifndef _COM_SUN_STAR_TASK_ERRORCODEIOEXCEPTION_HPP_
-#include <com/sun/star/task/ErrorCodeIOException.hpp>
-#endif
-#ifndef _COM_SUN_STAR_XML_SAX_XDOCUMENTHANDLER_HPP_
-#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
-#endif
-#ifndef _DBA_COREDATAACCESS_DOCUMENTCONTAINER_HXX_
-#include "documentcontainer.hxx"
-#endif
-#ifndef _DBA_COREDATAACCESS_DATABASECONTEXT_HXX_
-#include "databasecontext.hxx"
-#endif
-#ifndef _URLOBJ_HXX
-#include <tools/urlobj.hxx>
-#endif
-#ifndef TOOLS_DIAGNOSE_EX_H
-#include <tools/diagnose_ex.h>
-#endif
-#ifndef _ERRCODE_HXX
-#include <tools/errcode.hxx>
-#endif
-#ifndef _COMPHELPER_MEDIADESCRIPTOR_HXX_
-#include <comphelper/mediadescriptor.hxx>
-#endif
-#ifndef _COM_SUN_STAR_UI_XUICONFIGURATIONSTORAGE_HPP_
 #include <com/sun/star/ui/XUIConfigurationStorage.hpp>
-#endif
-#ifndef _COM_SUN_STAR_EMBED_XTRANSACTIONBROADCASTER_HPP_
-#include <com/sun/star/embed/XTransactionBroadcaster.hpp>
-#endif
-#ifndef _COM_SUN_STAR_EMBED_XEMBEDPERSIST_HPP_
-#include <com/sun/star/embed/XEmbedPersist.hpp>
-#endif
-#ifndef _COM_SUN_STAR_EMBED_ENTRYINITMODES_HPP_
-#include <com/sun/star/embed/EntryInitModes.hpp>
-#endif
-#ifndef _COM_SUN_STAR_VIEW_XSELECTIONSUPPLIER_HPP_
 #include <com/sun/star/view/XSelectionSupplier.hpp>
-#endif
-#ifndef _COM_SUN_STAR_DOCUMENT_XIMPORTER_HPP_
-#include <com/sun/star/document/XImporter.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SCRIPT_PROVIDER_XSCRIPTPROVIDERFACTORY_HPP_
-#include <com/sun/star/script/provider/XScriptProviderFactory.hpp>
-#endif
-#ifndef _TOOLS_DEBUG_HXX
-#include <tools/debug.hxx>
-#endif
-#ifndef _CPPUHELPER_EXC_HLP_HXX_
+#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
+/** === end UNO includes === **/
+
+#include <comphelper/documentconstants.hxx>
+#include <comphelper/enumhelper.hxx>
+#include <comphelper/mediadescriptor.hxx>
+#include <comphelper/namedvaluecollection.hxx>
+#include <comphelper/numberedcollection.hxx>
 #include <cppuhelper/exc_hlp.hxx>
-#endif
+#include <framework/titlehelper.hxx>
+#include <tools/debug.hxx>
+#include <tools/diagnose_ex.h>
+#include <tools/errcode.hxx>
+#include <tools/urlobj.hxx>
 
-#ifndef BOOST_BIND_HPP_INCLUDED
 #include <boost/bind.hpp>
-#endif
 
 #include <algorithm>
 #include <functional>
@@ -166,6 +120,7 @@
                        ,m_aCloseListener( getMutex() )
             ,m_aDocEventListeners( getMutex() )
             ,m_aStorageListeners( getMutex() )
+            ,m_pEventContainer( new DocumentEvents( *this, getMutex() ) )
 {
        DBG_CTOR(ODatabaseDocument,NULL);
 
@@ -188,6 +143,8 @@
                acquire();
                dispose();
        }
+
+    delete m_pEventContainer, m_pEventContainer = NULL;
 }
 // 
-----------------------------------------------------------------------------
 Any SAL_CALL ODatabaseDocument::queryInterface( const Type& _rType ) throw 
(RuntimeException)
@@ -1342,6 +1299,11 @@
     return xScriptProvider;
 }
 
+// 
-----------------------------------------------------------------------------
+Reference< XNameReplace > SAL_CALL ODatabaseDocument::getEvents(  ) throw 
(RuntimeException)
+{
+    return m_pEventContainer;
+}
 
 // 
-----------------------------------------------------------------------------
 void SAL_CALL ODatabaseDocument::disposing( const 
::com::sun::star::lang::EventObject& Source ) throw(RuntimeException)

File [changed]: databasedocument.hxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/databasedocument.hxx?r1=1.20.2.2&r2=1.20.2.3
Delta lines:  +20 -14
---------------------
--- databasedocument.hxx        2008-05-08 13:14:51+0000        1.20.2.2
+++ databasedocument.hxx        2008-07-16 14:23:40+0000        1.20.2.3
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: databasedocument.hxx,v $
- * $Revision: 1.20.2.2 $
+ * $Revision: 1.20.2.3 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -46,9 +46,6 @@
 #include <com/sun/star/util/XCloseable.hpp>
 #include <com/sun/star/view/XPrintable.hpp>
 #include <com/sun/star/frame/XModuleManager.hpp>
-#include <cppuhelper/compbase10.hxx>
-#include <cppuhelper/implbase3.hxx>
-
 #include <com/sun/star/document/XEventListener.hpp>
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
 #include <com/sun/star/lang/XServiceInfo.hpp>
@@ -56,17 +53,21 @@
 #include <com/sun/star/embed/XTransactionListener.hpp>
 #include <com/sun/star/document/XStorageBasedDocument.hpp>
 #include <com/sun/star/document/XEmbeddedScripts.hpp>
+#include <com/sun/star/document/XEventsSupplier.hpp>
 #include <com/sun/star/document/XScriptInvocationContext.hpp>
 #include <com/sun/star/script/XStorageBasedLibraryContainer.hpp>
 #include <com/sun/star/script/provider/XScriptProviderSupplier.hpp>
 /** === end UNO includes === **/
 
-#if ! defined(INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_14)
-#define INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_14
-#define COMPHELPER_IMPLBASE_INTERFACE_NUMBER 14
+#if ! defined(INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_15)
+#define INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_15
+#define COMPHELPER_IMPLBASE_INTERFACE_NUMBER 15
 #include <comphelper/implbase_var.hxx>
 #endif
 
+#include <cppuhelper/compbase10.hxx>
+#include <cppuhelper/implbase3.hxx>
+
 #include <boost/shared_ptr.hpp>
 
 namespace comphelper {
@@ -78,14 +79,14 @@
 {
 //........................................................................
 
-class ODatabaseContext;
+class DocumentEvents;
 
 typedef ::std::vector< ::com::sun::star::uno::Reference< 
::com::sun::star::frame::XController > >   Controllers;
 
 //============================================================
 //= ODatabaseDocument
 //============================================================
-typedef ::comphelper::WeakComponentImplHelper14 <   
::com::sun::star::frame::XModel2
+typedef ::comphelper::WeakComponentImplHelper15 <   
::com::sun::star::frame::XModel2
                                                 ,   
::com::sun::star::util::XModifiable
                                                 ,   
::com::sun::star::frame::XStorable
                                                 ,   
::com::sun::star::document::XEventBroadcaster
@@ -99,6 +100,7 @@
                                                 ,   
::com::sun::star::document::XEmbeddedScripts
                                                 ,   
::com::sun::star::document::XScriptInvocationContext
                                                 ,   
::com::sun::star::script::provider::XScriptProviderSupplier
+                                                ,   
::com::sun::star::document::XEventsSupplier
                                                 >   
ODatabaseDocument_OfficeDocument;
 
 typedef ::cppu::ImplHelper3<    ::com::sun::star::frame::XTitle
@@ -120,11 +122,17 @@
 
     ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController >   
                 m_xCurrentController;
     Controllers                                                                
                 m_aControllers;
+    DocumentEvents*                                                            
                 m_pEventContainer;
 
        ::com::sun::star::uno::WeakReference< 
::com::sun::star::container::XNameAccess >                m_xForms;
        ::com::sun::star::uno::WeakReference< 
::com::sun::star::container::XNameAccess >                m_xReports;
     ::com::sun::star::uno::WeakReference< 
::com::sun::star::script::provider::XScriptProvider > m_xScriptProvider;
 
+    /** @short  such module manager is used to classify new opened documents. 
*/
+    ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModuleManager 
>                 m_xModuleManager;
+    ::com::sun::star::uno::Reference< ::com::sun::star::frame::XTitle >        
                 m_xTitleHelper;
+    TNumberedController                                                        
                 m_aNumberedControllers;
+
     /** stores the document to the given URL, rebases it to the respective new 
storage, if necessary, resets
         the modified flag, and notifies any listeners as required
     */
@@ -135,11 +143,6 @@
             ModelMethodGuard& _rGuard
          );
 
-    /** @short  such module manager is used to classify new opened documents. 
*/
-    ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModuleManager 
>         m_xModuleManager;
-    ::com::sun::star::uno::Reference< ::com::sun::star::frame::XTitle >        
         m_xTitleHelper;
-    TNumberedController                                                        
         m_aNumberedControllers;
-
     /** notifies the global event broadcaster 
         The method must be called without our mutex locked
     */
@@ -330,6 +333,9 @@
     // XScriptProviderSupplier
     virtual ::com::sun::star::uno::Reference< 
::com::sun::star::script::provider::XScriptProvider > SAL_CALL 
getScriptProvider(  ) throw (::com::sun::star::uno::RuntimeException);
 
+    // XEventsSupplier
+    virtual ::com::sun::star::uno::Reference< 
::com::sun::star::container::XNameReplace > SAL_CALL getEvents(  ) throw 
(::com::sun::star::uno::RuntimeException);
+
     // XTitle
     virtual ::rtl::OUString SAL_CALL getTitle(  ) throw 
(::com::sun::star::uno::RuntimeException);
     virtual void SAL_CALL setTitle( const ::rtl::OUString& sTitle ) throw 
(::com::sun::star::uno::RuntimeException);




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

Reply via email to