summaryrefslogtreecommitdiff
path: root/dbaccess/source/core/inc
diff options
context:
space:
mode:
Diffstat (limited to 'dbaccess/source/core/inc')
-rw-r--r--dbaccess/source/core/inc/ContentHelper.hxx8
-rw-r--r--dbaccess/source/core/inc/View.hxx91
-rw-r--r--dbaccess/source/core/inc/definitioncolumn.hxx3
-rw-r--r--dbaccess/source/core/inc/recovery/dbdocrecovery.hxx92
-rw-r--r--dbaccess/source/core/inc/sdbcoretools.hxx46
-rw-r--r--dbaccess/source/core/inc/table.hxx34
6 files changed, 216 insertions, 58 deletions
diff --git a/dbaccess/source/core/inc/ContentHelper.hxx b/dbaccess/source/core/inc/ContentHelper.hxx
index 6d3a8a59e0e9..10c5df0cd5f3 100644
--- a/dbaccess/source/core/inc/ContentHelper.hxx
+++ b/dbaccess/source/core/inc/ContentHelper.hxx
@@ -107,10 +107,12 @@ namespace dbaccess
sal_Bool bAsTemplate; // AsTemplate
::rtl::OUString sPersistentName;// persistent name of the document
- // @@@ Add other properties supported by your content.
-
ContentProperties()
- : bIsDocument( sal_True ), bIsFolder( sal_False ), bAsTemplate( sal_False ) {}
+ :bIsDocument( sal_True )
+ ,bIsFolder( sal_False )
+ ,bAsTemplate( sal_False )
+ {
+ }
};
class OContentHelper_Impl
diff --git a/dbaccess/source/core/inc/View.hxx b/dbaccess/source/core/inc/View.hxx
new file mode 100644
index 000000000000..4e96a1882423
--- /dev/null
+++ b/dbaccess/source/core/inc/View.hxx
@@ -0,0 +1,91 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: View.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef DBACCESS_VIEW_HXX
+#define DBACCESS_VIEW_HXX
+
+#include "connectivity/sdbcx/VView.hxx"
+
+/** === begin UNO includes === **/
+#include <com/sun/star/sdbcx/XAlterView.hpp>
+#include <com/sun/star/sdb/tools/XViewAccess.hpp>
+/** === end UNO includes === **/
+
+#include <comphelper/uno3.hxx>
+#include <cppuhelper/implbase1.hxx>
+
+//........................................................................
+namespace dbaccess
+{
+//........................................................................
+
+ //====================================================================
+ //= View
+ //====================================================================
+ typedef ::connectivity::sdbcx::OView View_Base;
+ typedef ::cppu::ImplHelper1< ::com::sun::star::sdbcx::XAlterView > View_IBASE;
+ class View :public View_Base
+ ,public View_IBASE
+ {
+ public:
+ View(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection,
+ sal_Bool _bCaseSensitive,
+ const ::rtl::OUString& _rCatalogName,
+ const ::rtl::OUString& _rSchemaName,
+ const ::rtl::OUString& _rName
+ );
+
+ // UNO
+ DECLARE_XINTERFACE()
+ DECLARE_XTYPEPROVIDER()
+
+ // XAlterView
+ virtual void SAL_CALL alterCommand( const ::rtl::OUString& NewCommand ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
+
+ protected:
+ virtual ~View();
+
+ protected:
+ // OPropertyContainer
+ virtual void SAL_CALL getFastPropertyValue( ::com::sun::star::uno::Any& _rValue, sal_Int32 _nHandle ) const;
+
+ private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdb::tools::XViewAccess> m_xViewAccess;
+ sal_Int32 m_nCommandHandle;
+ private:
+ using View_Base::getFastPropertyValue;
+ };
+
+//........................................................................
+} // namespace dbaccess
+//........................................................................
+
+#endif // DBACCESS_VIEW_HXX
diff --git a/dbaccess/source/core/inc/definitioncolumn.hxx b/dbaccess/source/core/inc/definitioncolumn.hxx
index 1e8219845d3e..d77aad2b6efd 100644
--- a/dbaccess/source/core/inc/definitioncolumn.hxx
+++ b/dbaccess/source/core/inc/definitioncolumn.hxx
@@ -164,7 +164,8 @@ namespace dbaccess
public:
OQueryColumn(
const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxParserColumn,
- const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection,
+ const ::rtl::OUString& _sNewName
);
// XTypeProvider
diff --git a/dbaccess/source/core/inc/recovery/dbdocrecovery.hxx b/dbaccess/source/core/inc/recovery/dbdocrecovery.hxx
new file mode 100644
index 000000000000..4aa124dc7015
--- /dev/null
+++ b/dbaccess/source/core/inc/recovery/dbdocrecovery.hxx
@@ -0,0 +1,92 @@
+/*************************************************************************
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2009 by Sun Microsystems, Inc.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+************************************************************************/
+
+#ifndef DBACCESS_DBDOCRECOVERY_HXX
+#define DBACCESS_DBDOCRECOVERY_HXX
+
+#include "dbaccessdllapi.h"
+
+/** === begin UNO includes === **/
+#include <com/sun/star/embed/XStorage.hpp>
+#include <com/sun/star/frame/XController.hpp>
+/** === end UNO includes === **/
+
+#include <vector>
+#include <memory>
+
+namespace comphelper
+{
+ class ComponentContext;
+}
+
+//........................................................................
+namespace dbaccess
+{
+//........................................................................
+
+ //====================================================================
+ //= DatabaseDocumentRecovery
+ //====================================================================
+ struct DatabaseDocumentRecovery_Data;
+ class DBACCESS_DLLPRIVATE DatabaseDocumentRecovery
+ {
+ public:
+ DatabaseDocumentRecovery(
+ const ::comphelper::ComponentContext& i_rContext
+ );
+ ~DatabaseDocumentRecovery();
+
+ /** saves the modified sub components of the given controller(s) to the "recovery" sub storage of the document
+ storage.
+
+ @throws ::com::sun::star::uno::Exception
+ in case of an error.
+ */
+ void saveModifiedSubComponents(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& i_rTargetStorage,
+ const ::std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController > >& i_rControllers
+ );
+
+ /** recovery sub components from the given document storage, if applicable
+
+ If the given document storage does not contain a recovery folder, the method silently returns.
+
+ @throws ::com::sun::star::uno::Exception
+ in case of an error.
+ */
+ void recoverSubDocuments(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& i_rDocumentStorage,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController >& i_rTargetController
+ );
+
+ private:
+ const ::std::auto_ptr< DatabaseDocumentRecovery_Data > m_pData;
+ };
+
+//........................................................................
+} // namespace dbaccess
+//........................................................................
+
+#endif // DBACCESS_DBDOCRECOVERY_HXX
diff --git a/dbaccess/source/core/inc/sdbcoretools.hxx b/dbaccess/source/core/inc/sdbcoretools.hxx
index 6e26bf55b254..d6044a6b9110 100644
--- a/dbaccess/source/core/inc/sdbcoretools.hxx
+++ b/dbaccess/source/core/inc/sdbcoretools.hxx
@@ -28,8 +28,14 @@
#ifndef DBACORE_SDBCORETOOLS_HXX
#define DBACORE_SDBCORETOOLS_HXX
+/** === begin UNO includes === **/
#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
#include <com/sun/star/sdbc/XConnection.hpp>
+#include <com/sun/star/embed/XStorage.hpp>
+#include <com/sun/star/io/IOException.hpp>
+#include <com/sun/star/lang/WrappedTargetException.hpp>
+#include <com/sun/star/uno/RuntimeException.hpp>
+/** === end UNO includes === **/
namespace comphelper
{
@@ -49,32 +55,32 @@ namespace dbaccess
getDataSource( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxDependentObject );
// -----------------------------------------------------------------------------
- /** retrieves a particular indirect data source setting
-
- @param _rxDataSource
- a data source component
- @param _pAsciiSettingsName
- the ASCII name of the setting to obtain
- @param _rSettingsValue
- the value of the setting, upon successfull return
-
- @return
- <FALSE/> if the setting is not present in the <member scope="com::sun::star::sdb">DataSource::Info</member>
- member of the data source
- <TRUE/> otherwise
- */
- bool getDataSourceSetting(
- const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxDataSource,
- const sal_Char* _pAsciiSettingsName,
- ::com::sun::star::uno::Any& /* [out] */ _rSettingsValue
- );
// -----------------------------------------------------------------------------
/** retrieves a to-be-displayed string for a given caught exception;
*/
::rtl::OUString extractExceptionMessage( const ::comphelper::ComponentContext& _rContext, const ::com::sun::star::uno::Any& _rError );
-//.........................................................................
+ namespace tools
+ {
+ namespace stor
+ {
+ bool storageIsWritable_nothrow(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& _rxStorage
+ );
+
+ /// commits a given storage if it's not readonly
+ bool commitStorageIfWriteable(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& _rxStorage
+ )
+ SAL_THROW((
+ ::com::sun::star::io::IOException,
+ ::com::sun::star::lang::WrappedTargetException
+ ));
+ }
+
+ }
+
} // namespace dbaccess
//.........................................................................
diff --git a/dbaccess/source/core/inc/table.hxx b/dbaccess/source/core/inc/table.hxx
index 1f2c68889c93..95e984949619 100644
--- a/dbaccess/source/core/inc/table.hxx
+++ b/dbaccess/source/core/inc/table.hxx
@@ -28,58 +28,24 @@
#ifndef _DBA_CORE_TABLE_HXX_
#define _DBA_CORE_TABLE_HXX_
-#ifndef _COM_SUN_STAR_SDBCX_XCOLUMNSSUPPLIER_HPP_
#include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDBCX_XDATADESCRIPTORFACTORY_HPP_
#include <com/sun/star/sdbcx/XDataDescriptorFactory.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDBCX_XINDEXESSUPPLIER_HPP_
#include <com/sun/star/sdbcx/XIndexesSupplier.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDBCX_XKEYSSUPPLIER_HPP_
#include <com/sun/star/sdbcx/XKeysSupplier.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDBCX_XRENAME_HPP_
#include <com/sun/star/sdbcx/XRename.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDBCX_XALTERTABLE_HPP_
#include <com/sun/star/sdbcx/XAlterTable.hpp>
-#endif
-#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
#include <com/sun/star/lang/XServiceInfo.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDBC_XROW_HPP_
#include <com/sun/star/sdbc/XRow.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDBC_XCONNECTION_HPP_
#include <com/sun/star/sdbc/XConnection.hpp>
-#endif
-#ifndef _CPPUHELPER_COMPBASE2_HXX_
#include <cppuhelper/compbase7.hxx>
-#endif
-#ifndef _DBASHARED_APITOOLS_HXX_
#include "apitools.hxx"
-#endif
-#ifndef _DBA_CORE_DATASETTINGS_HXX_
#include "datasettings.hxx"
-#endif
-#ifndef _DBA_COREAPI_COLUMN_HXX_
#include <column.hxx>
-#endif
-#ifndef _CONNECTIVITY_COMMONTOOLS_HXX_
#include <connectivity/CommonTools.hxx>
-#endif
-#ifndef CONNECTIVITY_TABLEHELPER_HXX
#include <connectivity/TTableHelper.hxx>
-#endif
-#ifndef _COMPHELPER_UNO3_HXX_
#include <comphelper/uno3.hxx>
-#endif
-#ifndef COMPHELPER_IDPROPERTYARRAYUSAGEHELPER_HXX
#include <comphelper/IdPropArrayHelper.hxx>
-#endif
namespace dbaccess
{