Tag: cws_src680_dba30
User: fs      
Date: 05/09/29 23:10:06

Modified:
 /dba/dbaccess/source/core/dataaccess/
  ModelImpl.hxx

Log:
 RESYNC: (1.6-1.8); FILE MERGED

File Changes:

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

File [changed]: ModelImpl.hxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/ModelImpl.hxx?r1=1.3.2.3&r2=1.3.2.4
Delta lines:  +69 -64
---------------------
--- ModelImpl.hxx       1 Jul 2005 07:07:04 -0000       1.3.2.3
+++ ModelImpl.hxx       30 Sep 2005 06:10:03 -0000      1.3.2.4
@@ -1,22 +1,20 @@
 /*************************************************************************
  *
+ *  OpenOffice.org - a multi-platform office productivity suite
+ *
  *  $RCSfile$
  *
  *  $Revision$
  *
  *  last change: $Author$ $Date$
  *
- *  The Contents of this file are made available subject to the terms of
- *  either of the following licenses
- *
- *         - GNU Lesser General Public License Version 2.1
- *         - Sun Industry Standards Source License Version 1.1
+ *  The Contents of this file are made available subject to
+ *  the terms of GNU Lesser General Public License Version 2.1.
  *
- *  Sun Microsystems Inc., October, 2000
  *
  *  GNU Lesser General Public License Version 2.1
  *  =============================================
- *  Copyright 2000 by Sun Microsystems, Inc.
+ *    Copyright 2005 by Sun Microsystems, Inc.
  *  901 San Antonio Road, Palo Alto, CA 94303, USA
  *
  *  This library is free software; you can redistribute it and/or
@@ -33,30 +31,6 @@
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  *  MA  02111-1307  USA
  *
- *
- *  Sun Industry Standards Source License Version 1.1
- *  =================================================
- *  The contents of this file are subject to the Sun Industry Standards
- *  Source License Version 1.1 (the "License"); You may not use this file
- *  except in compliance with the License. You may obtain a copy of the
- *  License at http://www.openoffice.org/license.html.
- *
- *  Software provided under this License is provided on an "AS IS" basis,
- *  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
- *  WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
- *  MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
- *  See the License for the specific provisions governing your rights and
- *  obligations concerning the Software.
- *
- *  The Initial Developer of the Original Code is: Sun Microsystems, Inc.
- *
- *  Copyright: 2000 by Sun Microsystems, Inc.
- *
- *  All Rights Reserved.
- *
- *  Contributor(s): _______________________________________
- *
- *
  ************************************************************************/
 
 #ifndef _DBA_COREDATAACCESS_MODELIMPL_HXX_
@@ -185,6 +159,7 @@
 #ifndef _COM_SUN_STAR_BEANS_XPROPERTYACCESS_HPP_
 #include <com/sun/star/beans/XPropertyAccess.hpp>
 #endif
+#include <memory>
 
 //........................................................................
 namespace dbaccess
@@ -208,11 +183,16 @@
 //============================================================
 DECLARE_STL_USTRINGACCESS_MAP(::com::sun::star::uno::Reference< 
::com::sun::star::embed::XStorage >,TStorages);
 
+class ODatabaseContext;
+class DocumentStorageAccess;
+class OSharedConnectionManager;
 class ODatabaseModelImpl : public ::rtl::IReference
 {
-       friend class ODatabaseContext;
-       friend class OConnection;
-       friend class OSharedConnectionManager;
+private:
+    ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel>         
                                m_xTempModel;
+    ::com::sun::star::uno::WeakReference< ::com::sun::star::sdbc::XDataSource> 
                        m_xDataSource;
+
+    DocumentStorageAccess*                                                     
             m_pStorageAccess;
 
 public:
 
@@ -279,10 +259,6 @@
     ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController>    
                                m_xCurrentController;
     ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >      
                                m_xStorage;
 
-    ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel>         
                                m_xModel;
-    ::com::sun::star::uno::WeakReference< ::com::sun::star::sdbc::XDataSource> 
                        m_xDataSource;
-
-
        ODatabaseContext*                                                       
                m_pDBContext;
        OSharedConnectionManager*                                               
        m_pSharedConnectionManager;
        oslInterlockedCount                                                     
                m_refCount;
@@ -297,9 +273,15 @@
     inline bool isEmbeddedDatabase() const { return ( 
m_sConnectURL.compareToAscii( "sdbc:embedded:", 14 ) == 0 ); }
 
     /** stores the embedded storage ("database")
+
+        @param _bPreventRootCommits
+            Normally, committing the embedded storage results in also 
commiting the root storage
+            - this is an automatism for data safety reasons.
+            If you pass <TRUE/> here, committing the root storage is prevented 
for this particular
+            call.
                @return <TRUE/> if the storage could be commited, otherwise 
<FALSE/>
        */
-       sal_Bool commitEmbeddedStorage();
+       sal_Bool    commitEmbeddedStorage( sal_Bool _bPreventRootCommits = 
sal_False );
 
     /** commits all storages
     */
@@ -359,7 +341,7 @@
        ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > 
SAL_CALL getIsolatedConnection( const ::rtl::OUString& user, const 
::rtl::OUString& password ) throw(::com::sun::star::sdbc::SQLException, 
::com::sun::star::uno::RuntimeException);
        ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > 
SAL_CALL getIsolatedConnectionWithCompletion( const 
::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler 
>& handler ) throw(::com::sun::star::sdbc::SQLException, 
::com::sun::star::uno::RuntimeException);
 
-       void dispose(  );
+       void dispose();
 
     ::rtl::OUString getURL();
 
@@ -373,7 +355,7 @@
 // XCloseable
        void SAL_CALL close( sal_Bool DeliverOwnership ) throw 
(::com::sun::star::util::CloseVetoException, 
::com::sun::star::uno::RuntimeException);
 
-       ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage> 
getStorage(const ::rtl::OUString& _sStorageName,const 
::com::sun::star::uno::Reference< 
::com::sun::star::embed::XTransactionListener>& _xEventListener, sal_Int32 
nMode = ::com::sun::star::embed::ElementModes::READWRITE);
+       ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage> 
getStorage(const ::rtl::OUString& _sStorageName,sal_Int32 nMode = 
::com::sun::star::embed::ElementModes::READWRITE);
 // helper
        const ::com::sun::star::uno::Reference< 
::com::sun::star::util::XNumberFormatsSupplier >&
                        getNumberFormatsSupplier();
@@ -414,12 +396,35 @@
 
        /** returns the data source. If it doesn't exist it will be created
        */
-       ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDataSource> 
getDataSource();
-       /** returns the model or creates a new one.
+       ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDataSource> 
getDataSource( bool _bCreateIfNecessary = true );
+
+    /** returns the model, if there already exists one
        */
-       ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel>      
getModel();
+       ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > 
getModel_noCreate();
+
+    /** returns a new ->ODatabaseDocument
+
+        @precond
+            No ->ODatabaseDocument exists so far
+        @seealso
+            getModel_noCreate
+    */
+       ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > 
createNewModel_deliverOwnership();
+
+    struct ResetModelAccess { friend class ODatabaseDocument; private: 
ResetModelAccess() { } };
+    /** resets the model to NULL
+
+        Only to be called when the model is being disposed
+    */
+    void    modelIsDisposing( ResetModelAccess ) { m_xTempModel = NULL; }
+
+    DocumentStorageAccess*
+            getDocumentStorageAccess();
+
+    ::com::sun::star::uno::Reference< 
::com::sun::star::document::XDocumentSubStorageSupplier >
+            getDocumentSubStorageSupplier();
 
-       void clear();
+//     void clear();
 
        /** @see osl_incrementInterlockedCount.
         */




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

Reply via email to