summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkash Shetye <shetyeakash@gmail.com>2013-07-30 08:08:13 +0530
committerKohei Yoshida <kohei.yoshida@gmail.com>2013-08-05 14:30:24 -0400
commitd3fbf3bebfaf75d94f08a6560d5f916932440280 (patch)
tree8fab70ccdb2f0bbc297d58413ad787cb47a7059d
parentac4c81f7b9c4e927419f7d42307f684ef6174478 (diff)
Part 1 of Adding DB Data export
Adding this skeleton for all the constructs for DB Data export Change-Id: I7510358af5f2ac92bd7f2ec7d1af4170ec8f763c
-rw-r--r--sc/source/filter/excel/xedbdata.cxx86
-rw-r--r--sc/source/filter/inc/xedbdata.hxx81
2 files changed, 167 insertions, 0 deletions
diff --git a/sc/source/filter/excel/xedbdata.cxx b/sc/source/filter/excel/xedbdata.cxx
new file mode 100644
index 000000000000..ebce789f3f35
--- /dev/null
+++ b/sc/source/filter/excel/xedbdata.cxx
@@ -0,0 +1,86 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#include "xedbdata.hxx"
+#include "document.hxx"
+
+XclExpXmlDBDataStyleInfo::XclExpXmlDBDataStyleInfo( const XclExpRoot& rRoot, ScDBDataFormatting& rDBDataFormatting )
+ : XclExpRoot( rRoot )
+{
+}
+
+void XclExpXmlDBDataStyleInfo::SaveXml( XclExpXmlStream& rStrm )
+{
+}
+
+// ============================================================================
+XclExpXmlDBDataColumn::XclExpXmlDBDataColumn( const XclExpRoot& rRoot, int iID, OUString& rName )
+ : XclExpRoot( rRoot )
+{
+}
+
+void XclExpXmlDBDataColumn::SaveXml( XclExpXmlStream& rStrm )
+{
+}
+
+// ============================================================================
+XclExpXmlDBDataColumns::XclExpXmlDBDataColumns( const XclExpRoot& rRoot, ScDBData& rDBData )
+ : XclExpRoot( rRoot )
+{
+}
+
+void XclExpXmlDBDataColumns::SaveXml( XclExpXmlStream& rStrm )
+{
+}
+
+// ============================================================================
+XclExpXmlDBDataTable::XclExpXmlDBDataTable(const XclExpRoot& rRoot, ScDBData& rDBData )
+ : XclExpRoot( rRoot )
+{
+ maTableColumns.reset( new XclExpXmlDBDataColumns( rRoot, rDBData ) );
+ ScDBDataFormatting aDBFormatting;
+ rDBData.GetTableFormatting( aDBFormatting );
+ maStyleInfo.reset( new XclExpXmlDBDataStyleInfo( rRoot, aDBFormatting) );
+}
+void XclExpXmlDBDataTable::SaveXml( XclExpXmlStream& rStrm )
+{
+}
+
+// =============================================================================
+XclExpXmlDBDataTables::XclExpXmlDBDataTables( const XclExpRoot& rRoot )
+ : XclExpRoot( rRoot )
+{
+ ScDBCollection* pDBCollection = rRoot.GetDoc().GetDBCollection();
+ if( pDBCollection )
+ {
+ ScDBCollection::NamedDBs& aNamedDBs = pDBCollection->getNamedDBs();
+ ScDBCollection::NamedDBs::iterator itr = aNamedDBs.begin();
+ ScDBCollection::NamedDBs::iterator itrEnd = aNamedDBs.end();
+ for(; itr!= itrEnd; ++itr)
+ {
+ maDBDataTableContainer.push_back( new XclExpXmlDBDataTable( rRoot, *itr ) );
+ ++miCount;
+ }
+ }
+}
+
+void XclExpXmlDBDataTables::SaveXml( XclExpXmlStream& rStrm )
+{
+}
+// =============================================================================
diff --git a/sc/source/filter/inc/xedbdata.hxx b/sc/source/filter/inc/xedbdata.hxx
new file mode 100644
index 000000000000..d05b6836bd6a
--- /dev/null
+++ b/sc/source/filter/inc/xedbdata.hxx
@@ -0,0 +1,81 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef SC_XEDBDATA_HXX
+#define SC_ZEDBDATA_HXX
+
+#include "dbdata.hxx"
+#include "xeroot.hxx"
+#include "xerecord.hxx"
+#include <boost/shared_ptr.hpp>
+#include <boost/scoped_ptr.hpp>
+#include <boost/ptr_container/ptr_vector.hpp>
+
+class XclExpXmlDBDataStyleInfo : public XclExpRecordBase, protected XclExpRoot
+{
+public:
+ XclExpXmlDBDataStyleInfo( const XclExpRoot& rRoot, ScDBDataFormatting& rDBDataFormatting );
+ virtual void SaveXml( XclExpXmlStream& rStrm );
+};
+// ===========================================================================
+class XclExpXmlDBDataColumn : public XclExpRecordBase, protected XclExpRoot
+{
+public:
+ XclExpXmlDBDataColumn( const XclExpRoot& rRoot, int iID, OUString& rName );
+ virtual void SaveXml( XclExpXmlStream& rStrm );
+};
+
+// ===========================================================================
+class XclExpXmlDBDataColumns : public XclExpRecordBase, protected XclExpRoot
+{
+public:
+ XclExpXmlDBDataColumns( const XclExpRoot& rRoot, ScDBData& rDBData );
+ virtual void SaveXml( XclExpXmlStream& rStrm );
+private:
+ typedef boost::ptr_vector< XclExpXmlDBDataColumn > DBDataColumnContainer;
+ DBDataColumnContainer maDBDataColumnContainer;
+ int miCount;
+};
+
+// ============================================================================
+class XclExpXmlDBDataTable : public XclExpRecordBase, protected XclExpRoot
+{
+public:
+ XclExpXmlDBDataTable( const XclExpRoot& rRoot, ScDBData& rDBData );
+ virtual void SaveXml( XclExpXmlStream& rStrm );
+private:
+ typedef boost::scoped_ptr < XclExpXmlDBDataColumns > DBDataTableColumns;
+ typedef boost::scoped_ptr < XclExpXmlDBDataStyleInfo > DBDataStyleInfo;
+ DBDataTableColumns maTableColumns;
+ DBDataStyleInfo maStyleInfo;
+};
+
+// ============================================================================
+class XclExpXmlDBDataTables : public XclExpRecordBase, protected XclExpRoot
+{
+public:
+ XclExpXmlDBDataTables( const XclExpRoot& rRoot );
+ virtual void SaveXml( XclExpXmlStream& rStrm );
+private:
+ typedef boost::ptr_vector< XclExpXmlDBDataTable > DBDataTableContainer;
+ DBDataTableContainer maDBDataTableContainer;
+ int miCount;
+};
+
+#endif