Kaydet (Commit) 4e3086da authored tarafından David Ostrovsky's avatar David Ostrovsky Kaydeden (comit) Stephan Bergmann

Remove Seamonkey based address book driver

Seamonkey based address book driver is based on pre-compiled libraries
and is only used on Windows 32 bit. Remove it in favor of mork driver.

Given that Seamonkey based mozab driver also provides Outlook and
Outlook Express address book integration, that Windows-32-bit--only
feature is lost for now.  If necessary, support for that feature could
be rewritten from scratch, in a way that would also work for Windows 64
bit.

Change-Id: Ie1c125e692598bda999767c328c9e2262a2b82af
Reviewed-on: https://gerrit.libreoffice.org/19560Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst be114fd4
......@@ -230,11 +230,6 @@ $(WORKDIR)/download: $(BUILDDIR)/config_host.mk $(SRCDIR)/download.lst $(SRCDIR)
$(call fetch_Optional_pack,VALIDATOR_EXTENSION_PACK) \
$(call fetch_Optional_pack,WATCH_WINDOW_EXTENSION_PACK) \
,$(call fetch_Download_item,http://ooo.itc.hu/oxygenoffice/download/libreoffice,$(item)))
$(foreach item, \
$(call fetch_Optional,MOZ,$(MOZ_ZIP_INC)) \
$(call fetch_Optional,MOZ,$(MOZ_ZIP_LIB)) \
$(call fetch_Optional,MOZ,$(MOZ_ZIP_RUNTIME)) \
,$(call fetch_Download_item_unchecked,http://dev-www.libreoffice.org/mozilla,$(item)))
$(if $(call fetch_Optional,LIBGLTF,LIBGLTF_TARBALL) \
, $(call fetch_Download_item,http://dev-www.libreoffice.org/src/libgltf,$(call fetch_Optional,LIBGLTF,LIBGLTF_TARBALL)))
@mkdir -p $(dir $@) && touch $@
......
......@@ -440,14 +440,8 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \
xof \
xsltdlg \
xsltfilter \
$(if $(WITH_MOZAB4WIN), \
mozab2 \
mozabdrv \
) \
$(if $(WITH_MOZAB4WIN),,\
mork \
mozbootstrap \
) \
mork \
mozbootstrap \
$(if $(filter $(OS),WNT), \
ado \
$(if $(DISABLE_ATL),,oleautobridge) \
......
......@@ -2924,93 +2924,6 @@ endef
endif # SYSTEM_POSTGRESQL
ifneq ($(WITH_MOZAB4WIN),)
$(eval $(call gb_Helper_register_packages_for_install,ooo,\
moz_runtime \
))
define gb_LinkTarget__use_mozilla
$(call gb_LinkTarget_use_unpacked,$(1),moz_lib)
$(call gb_LinkTarget_use_unpacked,$(1),moz_inc)
$(call gb_LinkTarget_add_defs,$(1),\
-DMOZILLA_INTERNAL_API \
)
$(call gb_LinkTarget_set_include,$(1),\
-I$(call gb_UnpackedTarball_get_dir,moz_inc) \
-I$(call gb_UnpackedTarball_get_dir,moz_inc)/addrbook \
-I$(call gb_UnpackedTarball_get_dir,moz_inc)/content \
-I$(call gb_UnpackedTarball_get_dir,moz_inc)/embed_base \
-I$(call gb_UnpackedTarball_get_dir,moz_inc)/intl \
-I$(call gb_UnpackedTarball_get_dir,moz_inc)/mime \
-I$(call gb_UnpackedTarball_get_dir,moz_inc)/mozldap \
-I$(call gb_UnpackedTarball_get_dir,moz_inc)/msgbase \
-I$(call gb_UnpackedTarball_get_dir,moz_inc)/necko \
-I$(call gb_UnpackedTarball_get_dir,moz_inc)/pref \
-I$(call gb_UnpackedTarball_get_dir,moz_inc)/profile \
-I$(call gb_UnpackedTarball_get_dir,moz_inc)/rdf \
-I$(call gb_UnpackedTarball_get_dir,moz_inc)/string \
-I$(call gb_UnpackedTarball_get_dir,moz_inc)/uconv \
-I$(call gb_UnpackedTarball_get_dir,moz_inc)/xpcom \
-I$(call gb_UnpackedTarball_get_dir,moz_inc)/xpcom_obsolete \
$$(INCLUDE) \
)
$(call gb_LinkTarget_add_libs,$(1),\
$(call gb_UnpackedTarball_get_dir,nss)/dist/out/lib/nspr4.lib \
$(call gb_UnpackedTarball_get_dir,moz_lib)/xpcom.lib \
$(call gb_UnpackedTarball_get_dir,moz_lib)/xpcom_core.lib \
)
$(call gb_LinkTarget_add_defs,$(1),\
-DMOZILLA_CLIENT \
-DMOZ_REFLOW_PERF \
-DMOZ_REFLOW_PERF_DSP \
-DMOZ_XUL \
-DOJI \
-DWIN32 \
-DXP_PC \
-DXP_WIN \
-DXP_WIN32 \
-D_WINDOWS \
)
ifeq ($(COM),GCC)
$(call gb_LinkTarget_add_cxxflags,$(1),\
-Wall \
-Wcast-align \
-Wconversion \
-Wno-long-long \
-Woverloaded-virtual \
-Wpointer-arith \
-Wsynth \
-fno-rtti \
)
else
ifneq ($(DBG_LEVEL),0)
$(call gb_LinkTarget_add_defs,$(1),\
-D_STL_NOFORCE_MANIFEST \
)
endif
$(call gb_LinkTarget_add_libs,$(1),\
$(call gb_UnpackedTarball_get_dir,moz_lib)/embed_base_s.lib \
$(call gb_UnpackedTarball_get_dir,moz_lib)/mozreg_s.lib \
)
endif # !GCC
endef
endif # WITH_MOZAB4WIN
ifeq ($(ENABLE_KDE4),TRUE)
define gb_LinkTarget__use_kde4
......
......@@ -407,8 +407,6 @@ export MSPUB_LIBS=$(gb_SPACE)@MSPUB_LIBS@
export MSVC_DLLS=@MSVC_DLLS@
export MSVC_DLL_PATH=@MSVC_DLL_PATH@
export MSVC_USE_DEBUG_RUNTIME=@MSVC_USE_DEBUG_RUNTIME@
export MSVC80_DLLS=@MSVC80_DLLS@
export MSVC80_DLL_PATH=@MSVC80_DLL_PATH@
export MWAW_CFLAGS=$(gb_SPACE)@MWAW_CFLAGS@
export MWAW_LIBS=$(gb_SPACE)@MWAW_LIBS@
export MYTHES_CFLAGS=$(gb_SPACE)@MYTHES_CFLAGS@
......@@ -630,7 +628,6 @@ export WITH_HELPPACK_INTEGRATION=@WITH_HELPPACK_INTEGRATION@
export WITH_KRB5=@WITH_KRB5@
export WITH_LINKER_HASH_STYLE=@WITH_LINKER_HASH_STYLE@
export WITH_LOCALES=@WITH_LOCALES@
export WITH_MOZAB4WIN=@WITH_MOZAB4WIN@
export WITH_MYSPELL_DICTS=@WITH_MYSPELL_DICTS@
export WITH_POOR_HELP_LOCALIZATIONS=@WITH_POOR_HELP_LOCALIZATIONS@
export WITH_THEMES=@WITH_THEMES@
......
......@@ -1014,12 +1014,6 @@ AC_ARG_ENABLE(pch,
[Enables precompiled header support for C++. Forced default on Windows/VC build])
)
AC_ARG_ENABLE(win-mozab-driver,
AS_HELP_STRING([--enable-win-mozab-driver],
[LibreOffice includes a driver to connect to Mozilla
address books under Windows, to build with this version, use this option.])
)
AC_ARG_ENABLE(epm,
AS_HELP_STRING([--enable-epm],
[LibreOffice includes self-packaging code, that requires epm, however epm is
......@@ -3882,9 +3876,6 @@ if test -n "$enable_dbgutil" -a "$enable_dbgutil" != "no"; then
else
with_system_libgltf=no
fi
if test "$enable_win_mozab_driver" = "yes"; then
AC_MSG_ERROR([--enable-win-mozab-driver conflicts with --enable-dbgutil])
fi
else
ENABLE_DBGUTIL=""
MSVC_USE_DEBUG_RUNTIME=""
......@@ -8771,35 +8762,6 @@ fi
fi
AC_SUBST(SYSTEM_OPENLDAP)
dnl ===================================================================
dnl Check for mozilla ab connectivity for windows
dnl ===================================================================
if test "$_os" = "WINNT"; then
AC_MSG_CHECKING([whether to enable build of Mozilla addressbook connectivity driver for Windows])
if test "$enable_win_mozab_driver" = "yes" -a "$WITH_MINGW" != "YES" ; then
if test "$BITNESS_OVERRIDE" = 64; then
AC_MSG_ERROR([--with-win-mozab-driver and --enable-64-bit options are mutually exclusive])
fi
WITH_MOZAB4WIN=TRUE
AC_MSG_RESULT([yes, internal (old windows mozab driver)])
BUILD_TYPE="$BUILD_TYPE MOZ"
MSVC80_DLLS="msvcp80.dll msvcr80.dll Microsoft.VC80.CRT.manifest"
MSVC80_DLL_PATH=`cygpath -u "$TARFILE_LOCATION"`
for dll in $MSVC80_DLLS; do
if ! test -f "$MSVC80_DLL_PATH/$dll"; then
AC_MSG_ERROR([can not find $dll in $MSVC80_DLL_PATH needed for the pre-built Mozilla libraries])
fi
done
else
AC_MSG_RESULT([no])
WITH_MOZAB4WIN=
fi
fi
AC_SUBST(WITH_MOZAB4WIN)
AC_SUBST(MSVC80_DLLS)
AC_SUBST(MSVC80_DLL_PATH)
dnl ===================================================================
dnl Check for TLS/SSL and cryptographic implementation to use
dnl ===================================================================
......
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
# 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/.
#
$(eval $(call gb_Configuration_Configuration,driver_mozab))
$(eval $(call gb_Configuration_add_spool_modules,driver_mozab,connectivity/registry/mozab,\
org/openoffice/Office/DataAccess/Drivers-mozab.xcu \
))
$(eval $(call gb_Configuration_add_localized_datas,driver_mozab,connectivity/registry/mozab,\
org/openoffice/Office/DataAccess/Drivers.xcu \
))
# vim: set noet sw=4 ts=4:
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
# 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/.
#
$(eval $(call gb_Library_Library,mozab2))
$(eval $(call gb_Library_set_componentfile,mozab2,connectivity/source/drivers/mozab/mozab))
$(eval $(call gb_Library_set_include,mozab2,\
-I$(SRCDIR)/connectivity/source/inc \
$$(INCLUDE) \
-I$(WORKDIR)/YaccTarget/connectivity/source/parse \
))
$(eval $(call gb_Library_use_external,mozab2,boost_headers))
$(eval $(call gb_Library_use_sdk_api,mozab2))
$(eval $(call gb_Library_use_libraries,mozab2,\
cppu \
cppuhelper \
dbtools \
sal \
$(gb_UWINAPI) \
))
$(eval $(call gb_Library_add_exception_objects,mozab2,\
connectivity/source/drivers/mozab/MDriver \
connectivity/source/drivers/mozab/MServices \
))
# vim: set noet sw=4 ts=4:
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
# 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/.
#
$(eval $(call gb_Library_Library,mozabdrv))
$(eval $(call gb_Library_set_include,mozabdrv,\
-I$(SRCDIR)/connectivity/source/drivers/mozab \
-I$(SRCDIR)/connectivity/source/inc \
$$(INCLUDE) \
-I$(WORKDIR)/YaccTarget/connectivity/source/parse \
))
$(eval $(call gb_Library_use_sdk_api,mozabdrv))
$(eval $(call gb_Library_use_libraries,mozabdrv,\
comphelper \
cppu \
cppuhelper \
dbtools \
sal \
salhelper \
tl \
$(gb_UWINAPI) \
))
$(eval $(call gb_Library_use_externals,mozabdrv,\
boost_headers \
mozilla \
nss3 \
))
$(eval $(call gb_Library_add_exception_objects,mozabdrv,\
connectivity/source/drivers/mozab/MCatalog \
connectivity/source/drivers/mozab/MColumnAlias \
connectivity/source/drivers/mozab/MColumns \
connectivity/source/drivers/mozab/MConfigAccess \
connectivity/source/drivers/mozab/MConnection \
connectivity/source/drivers/mozab/MDatabaseMetaData \
connectivity/source/drivers/mozab/MPreparedStatement \
connectivity/source/drivers/mozab/MResultSet \
connectivity/source/drivers/mozab/MResultSetMetaData \
connectivity/source/drivers/mozab/MStatement \
connectivity/source/drivers/mozab/MTable \
connectivity/source/drivers/mozab/MTables \
connectivity/source/drivers/mozab/bootstrap/MMozillaBootstrap \
connectivity/source/drivers/mozab/bootstrap/MNSFolders \
connectivity/source/drivers/mozab/bootstrap/MNSINIParser \
connectivity/source/drivers/mozab/bootstrap/MNSInit \
connectivity/source/drivers/mozab/bootstrap/MNSProfile \
connectivity/source/drivers/mozab/bootstrap/MNSProfileDirServiceProvider \
connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover \
connectivity/source/drivers/mozab/bootstrap/MNSProfileManager \
connectivity/source/drivers/mozab/bootstrap/MNSRunnable \
connectivity/source/drivers/mozab/mozillasrc/MDatabaseMetaDataHelper \
connectivity/source/drivers/mozab/mozillasrc/MLdapAttributeMap \
connectivity/source/drivers/mozab/mozillasrc/MNSMozabProxy \
connectivity/source/drivers/mozab/mozillasrc/MNSTerminateListener \
connectivity/source/drivers/mozab/mozillasrc/MNameMapper \
connectivity/source/drivers/mozab/mozillasrc/MQuery \
connectivity/source/drivers/mozab/mozillasrc/MQueryHelper \
connectivity/source/drivers/mozab/mozillasrc/MTypeConverter \
))
# vim: set noet sw=4 ts=4:
......@@ -11,10 +11,6 @@ $(eval $(call gb_Library_Library,mozbootstrap))
$(eval $(call gb_Library_set_componentfile,mozbootstrap,connectivity/source/drivers/mozab/bootstrap/mozbootstrap))
$(eval $(call gb_Library_add_defs,mozbootstrap,\
-DMINIMAL_PROFILEDISCOVER \
))
$(eval $(call gb_Library_set_include,mozbootstrap,\
-I$(SRCDIR)/connectivity/source/drivers/mozab \
$$(INCLUDE) \
......
......@@ -94,15 +94,7 @@ $(eval $(call gb_Module_add_targets,connectivity,\
))
endif
ifneq ($(WITH_MOZAB4WIN),)
$(eval $(call gb_Module_add_targets,connectivity,\
Configuration_mozab \
Library_mozab \
Library_mozabdrv \
))
else ifneq (,$(filter DESKTOP,$(BUILD_TYPE)))
ifneq (,$(filter DESKTOP,$(BUILD_TYPE)))
$(eval $(call gb_Module_add_targets,connectivity,\
Configuration_mork \
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
* 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 .
-->
<oor:component-data oor:name="Drivers" oor:package="org.openoffice.Office.DataAccess" xmlns:install="http://openoffice.org/2004/installation" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<node oor:name="Installed" install:module="mozab">
<node oor:name="sdbc:address:outlook" oor:op="replace">
<prop oor:name="Driver">
<value>com.sun.star.comp.sdbc.MozabDriver</value>
</prop>
<prop oor:name="DriverTypeDisplayName" oor:type="xs:string">
<value xml:lang="en-US">Microsoft Outlook Address Book</value>
</prop>
<node oor:name="Features">
<node oor:name="EscapeDateTime" oor:op="replace">
<prop oor:name="Value" oor:type="xs:boolean">
<value>true</value>
</prop>
</node>
</node>
</node>
<node oor:name="sdbc:address:outlookexp" oor:op="replace">
<prop oor:name="Driver">
<value>com.sun.star.comp.sdbc.MozabDriver</value>
</prop>
<prop oor:name="DriverTypeDisplayName" oor:type="xs:string">
<value xml:lang="en-US">Microsoft Windows Address Book</value>
</prop>
<node oor:name="Features">
<node oor:name="EscapeDateTime" oor:op="replace">
<prop oor:name="Value" oor:type="xs:boolean">
<value>true</value>
</prop>
</node>
</node>
</node>
<node oor:name="sdbc:address:mozilla:" oor:op="replace">
<prop oor:name="Driver">
<value>com.sun.star.comp.sdbc.MozabDriver</value>
</prop>
<prop oor:name="DriverTypeDisplayName" oor:type="xs:string">
<value xml:lang="en-US">SeaMonkey Address Book</value>
</prop>
<node oor:name="Features">
<node oor:name="EscapeDateTime" oor:op="replace">
<prop oor:name="Value" oor:type="xs:boolean">
<value>true</value>
</prop>
</node>
</node>
<node oor:name="MetaData">
<node oor:name="SupportsBrowsing" oor:op="replace">
<prop oor:name="Value" oor:type="xs:boolean">
<value>true</value>
</prop>
</node>
</node>
</node>
<node oor:name="sdbc:address:thunderbird:" oor:op="replace">
<prop oor:name="Driver">
<value>com.sun.star.comp.sdbc.MozabDriver</value>
</prop>
<prop oor:name="DriverTypeDisplayName" oor:type="xs:string">
<value xml:lang="en-US">Thunderbird/Icedove Address Book</value>
</prop>
<node oor:name="Features">
<node oor:name="EscapeDateTime" oor:op="replace">
<prop oor:name="Value" oor:type="xs:boolean">
<value>true</value>
</prop>
</node>
</node>
<node oor:name="MetaData">
<node oor:name="SupportsBrowsing" oor:op="replace">
<prop oor:name="Value" oor:type="xs:boolean">
<value>true</value>
</prop>
</node>
</node>
</node>
<node oor:name="sdbc:address:ldap:*" oor:op="replace">
<prop oor:name="Driver">
<value>com.sun.star.comp.sdbc.MozabDriver</value>
</prop>
<prop oor:name="DriverTypeDisplayName" oor:type="xs:string">
<value xml:lang="en-US">LDAP Address Book</value>
</prop>
<node oor:name="Properties">
<node oor:name="BaseDN" oor:op="replace">
<prop oor:name="Value" oor:type="xs:string">
<value></value>
</prop>
</node>
<node oor:name="MaxRowCount" oor:op="replace">
<prop oor:name="Value" oor:type="xs:int">
<value>100</value>
</prop>
</node>
<node oor:name="PortNumber" oor:op="replace">
<prop oor:name="Value" oor:type="xs:int">
<value>389</value>
</prop>
</node>
<node oor:name="UseSSL" oor:op="replace">
<prop oor:name="Value" oor:type="xs:boolean">
<value>false</value>
</prop>
</node>
</node>
<node oor:name="Features">
<node oor:name="EscapeDateTime" oor:op="replace">
<prop oor:name="Value" oor:type="xs:boolean">
<value>true</value>
</prop>
</node>
</node>
<node oor:name="MetaData">
<node oor:name="SupportsTableCreation" oor:op="replace">
<prop oor:name="Value" oor:type="xs:boolean">
<value>true</value>
</prop>
</node>
<node oor:name="Authentication" oor:op="replace">
<prop oor:name="Value" oor:type="xs:string">
<value>UserPassword</value>
</prop>
</node>
</node>
</node>
</node>
</oor:component-data>
/* -*- 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 "MCatalog.hxx"
#include "MConnection.hxx"
#include "MTables.hxx"
#include <com/sun/star/sdbc/XRow.hpp>
#include <com/sun/star/sdbc/XResultSet.hpp>
#include <cppuhelper/interfacecontainer.h>
using namespace connectivity::mozab;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::sdbcx;
using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::lang;
using namespace ::cppu;
OCatalog::OCatalog(OConnection* _pCon) : connectivity::sdbcx::OCatalog(_pCon)
,m_pConnection(_pCon)
,m_xMetaData(m_pConnection->getMetaData( ))
{
// osl_atomic_increment( &m_refCount );
// refreshTables();
// refreshViews();
// refreshGroups();
// refreshUsers();
// osl_atomic_decrement( &m_refCount );
}
void OCatalog::refreshTables()
{
TStringVector aVector;
Sequence< OUString > aTypes(1);
aTypes[0] = "%";
Reference< XResultSet > xResult = m_xMetaData->getTables(Any(),
OUString("%"),OUString("%"),aTypes);
if(xResult.is())
{
Reference< XRow > xRow(xResult,UNO_QUERY);
OUString aName;
while(xResult->next())
{
aName = xRow->getString(3);
aVector.push_back(aName);
}
}
if(m_pTables)
m_pTables->reFill(aVector);
else
m_pTables = new OTables(m_xMetaData,*this,m_aMutex,aVector);
}
void OCatalog::refreshViews()
{
}
void OCatalog::refreshGroups()
{
}
void OCatalog::refreshUsers()
{
}
// XTablesSupplier
Reference< XNameAccess > SAL_CALL OCatalog::getTables( ) throw(RuntimeException)
{
::osl::MutexGuard aGuard(m_aMutex);
checkDisposed(rBHelper.bDisposed);
try
{
if(!m_pTables || m_pConnection->getForceLoadTables())
refreshTables();
}
catch( const RuntimeException& )
{
// allowed to leave this method
throw;
}
catch( const Exception& )
{
// allowed
}
return const_cast<OCatalog*>(this)->m_pTables;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- 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 INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_MOZAB_MCATALOG_HXX
#define INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_MOZAB_MCATALOG_HXX
#include <connectivity/sdbcx/VCatalog.hxx>
namespace connectivity
{
namespace mozab
{
// please don't name the class the same name as in an other namespaces
// some compilers have problems with this task as I noticed on windows
class OConnection;
class OCatalog : public connectivity::sdbcx::OCatalog
{
OConnection* m_pConnection; // used to get the metadata
::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData > m_xMetaData; // just to make things easier
public:
// implementation of the pure virtual methods
virtual void refreshTables();
virtual void refreshViews() ;
virtual void refreshGroups();
virtual void refreshUsers() ;
virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getTables( ) throw(::com::sun::star::uno::RuntimeException);
public:
explicit OCatalog(OConnection* _pCon);
OConnection* getConnection() const { return m_pConnection; }
sdbcx::OCollection* getPrivateTables() const { return m_pTables;}
sdbcx::OCollection* getPrivateViews() const { return m_pViews; }
};
}
}
#endif // INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_MOZAB_MCATALOG_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- 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 <sal/macros.h>
#include "MColumnAlias.hxx"
#include "MConnection.hxx"
#include "MExtConfigAccess.hxx"
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
#include <tools/diagnose_ex.h>
#include <algorithm>
#include <functional>
using namespace ::connectivity;
using namespace ::connectivity::mozab;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::container;
OColumnAlias::OColumnAlias( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB )
{
static const sal_Char* s_pProgrammaticNames[] =
{
"FirstName",
"LastName",
"DisplayName",
"NickName",
"PrimaryEmail",
"SecondEmail",
"PreferMailFormat",
"WorkPhone",
"HomePhone",
"FaxNumber",
"PagerNumber",
"CellularNumber",
"HomeAddress",
"HomeAddress2",
"HomeCity",
"HomeState",
"HomeZipCode",
"HomeCountry",
"WorkAddress",
"WorkAddress2",
"WorkCity",
"WorkState",
"WorkZipCode",
"WorkCountry",
"JobTitle",
"Department",
"Company",
"WebPage1",
"WebPage2",
"BirthYear",
"BirthMonth",
"BirthDay",
"Custom1",
"Custom2",
"Custom3",
"Custom4",
"Notes",
};
for ( size_t i = 0; i < sizeof( s_pProgrammaticNames ) / sizeof( s_pProgrammaticNames[0] ); ++i )
m_aAliasMap[ OUString::createFromAscii( s_pProgrammaticNames[i] ) ] = AliasEntry( s_pProgrammaticNames[i], i );
initialize( _rxORB );
}
void OColumnAlias::initialize( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB )
{
// open our driver settings config node
// the config path for our own driver's settings
Reference< XPropertySet > xDriverNode = createDriverConfigNode( _rxORB );
if ( xDriverNode.is() )
{
try
{
Reference< XNameAccess > xAliasesNode;
xDriverNode->getPropertyValue("ColumnAliases") >>= xAliasesNode;
OSL_ENSURE( xAliasesNode.is(), "OColumnAlias::setAlias: missing the aliases node!" );
// this is a set of string nodes
Sequence< OUString > aProgrammaticNames;
if ( xAliasesNode.is() )
aProgrammaticNames = xAliasesNode->getElementNames();
// travel through all the set elements
const OUString* pProgrammaticNames = aProgrammaticNames.getConstArray();
const OUString* pProgrammaticNamesEnd = pProgrammaticNames + aProgrammaticNames.getLength();
OUString sAssignedAlias;
for ( ; pProgrammaticNames < pProgrammaticNamesEnd; ++pProgrammaticNames )
{
OSL_VERIFY( xAliasesNode->getByName( *pProgrammaticNames ) >>= sAssignedAlias );
// normalize in case the config data is corrupted
// (what we really don't need is an empty alias ...)
if ( sAssignedAlias.isEmpty() )
sAssignedAlias = *pProgrammaticNames;
OString sAsciiProgrammaticName( OUStringToOString( *pProgrammaticNames, RTL_TEXTENCODING_ASCII_US ) );
bool bFound = false;
for ( AliasMap::iterator search = m_aAliasMap.begin();
( search != m_aAliasMap.end() );
++search
)
{
if ( search->second.programmaticAsciiName.equals( sAsciiProgrammaticName ) )
{
AliasEntry entry( search->second );
m_aAliasMap.erase( search );
m_aAliasMap[ sAssignedAlias ] = entry;
bFound = true;
break;
}
}
OSL_ENSURE( bFound, "OColumnAlias::setAlias: did not find a programmatic name which exists in the configuration!" );
}
}
catch( const Exception& )
{
DBG_UNHANDLED_EXCEPTION();
}
}
}
OString OColumnAlias::getProgrammaticNameOrFallbackToUTF8Alias( const OUString& _rAlias ) const
{
AliasMap::const_iterator pos = m_aAliasMap.find( _rAlias );
if ( pos == m_aAliasMap.end() )
{
OSL_FAIL( "OColumnAlias::getProgrammaticNameOrFallbackToUTF8Alias: no programmatic name for this alias!" );
return OUStringToOString( _rAlias, RTL_TEXTENCODING_UTF8 );
}
return pos->second.programmaticAsciiName;
}
bool OColumnAlias::isColumnSearchable( const OUString _alias ) const
{
OString sProgrammatic = getProgrammaticNameOrFallbackToUTF8Alias( _alias );
return ( !sProgrammatic.equals( "HomeCountry" )
&& !sProgrammatic.equals( "WorkCountry" )
);
// for those, we know that they're not searchable in the Mozilla/LDAP implementation.
// There might be more ...
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- 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 INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_MOZAB_MCOLUMNALIAS_HXX
#define INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_MOZAB_MCOLUMNALIAS_HXX
#include <unotools/confignode.hxx>
#include <osl/mutex.hxx>
#include <unordered_map>
#include <vector>
namespace connectivity
{
namespace mozab
{
class OColumnAlias
{
public:
struct AliasEntry
{
OString programmaticAsciiName;
size_t columnPosition;
AliasEntry()
:programmaticAsciiName()
,columnPosition( 0 )
{
}
AliasEntry( const sal_Char* _programmaticAsciiName, size_t _columnPosition )
:programmaticAsciiName( _programmaticAsciiName )
,columnPosition( _columnPosition )
{
}
};
typedef std::unordered_map< OUString, AliasEntry, OUStringHash > AliasMap;
private:
AliasMap m_aAliasMap;
public:
explicit OColumnAlias( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & );
inline bool hasAlias( const OUString& _rAlias ) const
{
return m_aAliasMap.find( _rAlias ) != m_aAliasMap.end();
}
OString getProgrammaticNameOrFallbackToUTF8Alias( const OUString& _rAlias ) const;
inline AliasMap::const_iterator begin() const { return m_aAliasMap.begin(); }
inline AliasMap::const_iterator end() const { return m_aAliasMap.end(); }
bool isColumnSearchable( const OUString _alias ) const;
private:
void initialize( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB );
};
}
}
#endif // INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_MOZAB_MCOLUMNALIAS_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- 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 "MColumns.hxx"
#include <connectivity/sdbcx/VColumn.hxx>
#include <com/sun/star/sdbc/XRow.hpp>
#include <com/sun/star/sdbc/XResultSet.hpp>
#include <com/sun/star/sdbc/DataType.hpp>
#include <com/sun/star/sdbc/ColumnValue.hpp>
#include "MTable.hxx"
#include "MTables.hxx"
#include "MCatalog.hxx"
#include <comphelper/types.hxx>
#include <connectivity/dbtools.hxx>
using namespace ::comphelper;
using namespace connectivity::mozab;
using namespace connectivity::sdbcx;
using namespace connectivity;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::lang;
sdbcx::ObjectType OColumns::createObject(const OUString& _rName)
{
const Any aCatalog;
const OUString sCatalogName;
const OUString sSchemaName(m_pTable->getSchema());
const OUString sTableName(m_pTable->getTableName());
Reference< XResultSet > xResult = m_pTable->getConnection()->getMetaData()->getColumns(
aCatalog, sSchemaName, sTableName, _rName);
sdbcx::ObjectType xRet = NULL;
if(xResult.is())
{
Reference< XRow > xRow(xResult,UNO_QUERY);
while(xResult->next())
{
if(xRow->getString(4) == _rName)
{
sal_Int32 nType = xRow->getInt(5);
OUString sTypeName = xRow->getString(6);
sal_Int32 nPrec = xRow->getInt(7);
OColumn* pRet = new OColumn(_rName,
sTypeName,
xRow->getString(13),
xRow->getString(12),
xRow->getInt(11),
nPrec,
xRow->getInt(9),
nType,
sal_False,sal_False,sal_False,sal_True,
sCatalogName,
sSchemaName,
sTableName);
xRet = pRet;
break;
}
}
}
return xRet;
}
void OColumns::impl_refresh() throw(RuntimeException)
{
m_pTable->refreshColumns();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- 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 INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_MOZAB_MCOLUMNS_HXX
#define INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_MOZAB_MCOLUMNS_HXX
#include <connectivity/sdbcx/VCollection.hxx>
#include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
#include <connectivity/sdbcx/IRefreshable.hxx>
#include "MTable.hxx"
namespace connectivity
{
namespace mozab
{
class OColumns : public sdbcx::OCollection
{
protected:
OTable* m_pTable;
virtual sdbcx::ObjectType createObject(const OUString& _rName);
virtual void impl_refresh() throw(::com::sun::star::uno::RuntimeException);
public:
OColumns( OTable* _pTable,
::osl::Mutex& _rMutex,
const TStringVector &_rVector
) : sdbcx::OCollection(*_pTable,sal_True,_rMutex,_rVector)
,m_pTable(_pTable)
{}
};
}
}
#endif // INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_MOZAB_MCOLUMNS_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- 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 <com/sun/star/configuration/theDefaultProvider.hpp>
#include <comphelper/processfactory.hxx>
#include "MConfigAccess.hxx"
#include "MExtConfigAccess.hxx"
#include "MConnection.hxx"
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::beans;
namespace connectivity
{
namespace mozab
{
Reference< XPropertySet > createDriverConfigNode( Reference< XMultiServiceFactory > _rxORB )
{
Reference< XPropertySet > xNode;
try
{
// create the config provider
Reference< XMultiServiceFactory > xConfigProvider(
com::sun::star::configuration::theDefaultProvider::get(
comphelper::getComponentContext( _rxORB ) ) );
OUString sCompleteNodePath( "/org.openoffice.Office.DataAccess/DriverSettings/" );
sCompleteNodePath += OConnection::getDriverImplementationName();
// arguments for creating the config access
Sequence< Any > aArguments(2);
// the path to the node to open
aArguments[0] <<= PropertyValue(
OUString("nodepath"),
0,
makeAny( sCompleteNodePath ),
PropertyState_DIRECT_VALUE
);
// the depth: -1 means unlimited
aArguments[1] <<= PropertyValue(
OUString("depth"),
0,
makeAny( (sal_Int32)-1 ),
PropertyState_DIRECT_VALUE
);
// create the access
Reference< XInterface > xAccess = xConfigProvider->createInstanceWithArguments(
OUString("com.sun.star.configuration.ConfigurationAccess" ),
aArguments
);
OSL_ENSURE( xAccess.is(), "createDriverConfigNode: invalid access returned (should throw an exception instead)!" );
xNode = xNode.query( xAccess );
}
catch( const Exception& )
{
OSL_FAIL( "createDriverConfigNode: caught an exception while accessing the driver's config node!" );
}
// outta here
return xNode;
}
namespace
{
// a private helper to accessing the point where we store the reference
// to the factory
Reference< XMultiServiceFactory >& accessFactoryStorage( )
{
static Reference< XMultiServiceFactory > xMozabServiceFactory;
return xMozabServiceFactory;
}
}
void setMozabServiceFactory( const Reference< XMultiServiceFactory >& _rxFactory )
{
accessFactoryStorage( ) = _rxFactory;
}
const Reference< XMultiServiceFactory >& getMozabServiceFactory( )
{
return accessFactoryStorage( );
}
OUString getDescription(const sal_Char* sNode,const OUString & sDefault)
{
OUString sPreferredName;
OUString sDescription;
Reference< XMultiServiceFactory > xFactory = getMozabServiceFactory();
OSL_ENSURE( xFactory.is(), "getPreferredProfileName: invalid service factory!" );
if ( xFactory.is() )
{
try
{
Reference< XPropertySet > xDriverNode = createDriverConfigNode( xFactory );
Reference< XPropertySet > xMozPrefsNode;
if ( xDriverNode.is() )
xDriverNode->getPropertyValue("MozillaPreferences") >>= xMozPrefsNode;
OSL_ENSURE( xMozPrefsNode.is(), "getPreferredProfileName: could not access the node for the mozilla preferences!" );
if ( xMozPrefsNode.is() )
xMozPrefsNode->getPropertyValue("ProfileName") >>= sPreferredName;
if ( xMozPrefsNode.is() )
xMozPrefsNode->getPropertyValue( OUString::createFromAscii(sNode) ) >>= sDescription;
if (sDescription.getLength() == 0)
sDescription = sDefault;
}
catch( const Exception& )
{
OSL_FAIL( "getDescription: caught an exception!" );
}
}
if (sDescription.getLength() == 0)
sDescription = sDefault;
return sDescription;
}
OUString getPreferredProfileName( )
{
OUString sPreferredName;
Reference< XMultiServiceFactory > xFactory = getMozabServiceFactory();
OSL_ENSURE( xFactory.is(), "getPreferredProfileName: invalid service factory!" );
if ( xFactory.is() )
{
try
{
Reference< XPropertySet > xDriverNode = createDriverConfigNode( xFactory );
Reference< XPropertySet > xMozPrefsNode;
if ( xDriverNode.is() )
xDriverNode->getPropertyValue("MozillaPreferences") >>= xMozPrefsNode;
OSL_ENSURE( xMozPrefsNode.is(), "getPreferredProfileName: could not access the node for the mozilla preferences!" );
if ( xMozPrefsNode.is() )
xMozPrefsNode->getPropertyValue("ProfileName") >>= sPreferredName;
}
catch( const Exception& )
{
OSL_FAIL( "getPreferredProfileName: caught an exception!" );
}
}
return sPreferredName;
}
}
}
extern "C" const sal_Unicode* SAL_CALL getUserProfile()
{
static sal_Bool bReadConfig = sal_False;
static OUString sUserProfile;
if ( !bReadConfig )
{
sUserProfile = ::connectivity::mozab::getPreferredProfileName( );
bReadConfig = sal_True;
}
return sUserProfile.getStr();
}
extern "C" const sal_Char* SAL_CALL getPabDescription()
{
static sal_Bool bReadConfig = sal_False;
static OUString usPabDescription;
static OString sPabDescription;
if ( !bReadConfig )
{
usPabDescription = ::connectivity::mozab::getDescription(
"PabDescription" ,
OUString("Personal Address Book" ));
sPabDescription = OUStringToOString( usPabDescription,
RTL_TEXTENCODING_UTF8);
bReadConfig = sal_True;
}
return sPabDescription.getStr();
}
extern "C" const sal_Char* SAL_CALL getHisDescription()
{
static sal_Bool bReadConfig = sal_False;
static OUString usHisDescription;
static OString sHisDescription;
if ( !bReadConfig )
{
usHisDescription = ::connectivity::mozab::getDescription(
"HisDescription" ,
OUString("Collected Addresses" ));
sHisDescription = OUStringToOString( usHisDescription,
RTL_TEXTENCODING_UTF8);
bReadConfig = sal_True;
}
return sHisDescription.getStr();
}
// MConfigAccess was invented to allow non-UNO parts access to the configuration.
// Unfortunately, configuration access requires a XMultiServiceFactory - which the
// mozilla side does not have.
// So we create a "library-local" service factory here: Every need for a service
// factory can be fulfilled by this factory (similar to the get/setProcessServiceFactory
// in comphelper).
// This is halfway valid, as usually, the mozabdrv library is invoked from the mozab library
// only. The latter contains the driver class (and only this class and nothing more), and
// the driver class is a singleton. The driver itself is created with a service factory,
// which (by definition) can and should be used for all subsequent service requests.
// And this is exactly what we're allowing with the following functions ....
/** _pFactory must point to an XMultiServiceFactory, which must be acquired once
for purpose of safely transferring it. The callee will release this interface
when it has stored the pointer somewhere else.
*/
extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL setMozabServiceFactory(
void* _pFactory )
{
Reference< XMultiServiceFactory > xFactory = static_cast< XMultiServiceFactory* >( _pFactory );
::connectivity::mozab::setMozabServiceFactory( xFactory );
// by definition, the object behind the interface pointer has been acquired once for purpose
// of safely transporting it
xFactory->release();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- 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 INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_MOZAB_MCONFIGACCESS_HXX
#define INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_MOZAB_MCONFIGACCESS_HXX
#include <sal/types.h>
extern "C" const sal_Unicode* SAL_CALL getUserProfile();
extern "C" const sal_Char* SAL_CALL getPabDescription();
extern "C" const sal_Char* SAL_CALL getHisDescription();
#endif // INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_MOZAB_MCONFIGACCESS_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- 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 INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_MOZAB_MDRIVER_HXX
#define INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_MOZAB_MDRIVER_HXX
#include <com/sun/star/sdbc/XDriver.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <cppuhelper/compbase.hxx>
#include <connectivity/CommonTools.hxx>
#include <osl/module.h>
#define MOZAB_DRIVER_IMPL_NAME "com.sun.star.comp.sdbc.MozabDriver"
namespace connectivity
{
namespace mozab
{
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL MozabDriver_CreateInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory) throw( ::com::sun::star::uno::Exception );
typedef void* (SAL_CALL * OMozabConnection_CreateInstanceFunction)(void* _pDriver );
typedef void (SAL_CALL * OSetMozabServiceFactory)( void* _pFactory );
typedef const void* (SAL_CALL * OGetSdbcScheme_Function)( short );
typedef ::cppu::WeakComponentImplHelper< ::com::sun::star::sdbc::XDriver,
::com::sun::star::lang::XServiceInfo > ODriver_BASE;
enum EDriverType
{
Mozilla,
ThunderBird,
LDAP,
Outlook,
OutlookExpress,
Unknown
};
class MozabDriver : public ODriver_BASE
{
protected:
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xMSFactory;
::osl::Mutex m_aMutex; // mutex is need to control member access
connectivity::OWeakRefArray m_xConnections; // vector containing a list
// of all the Connection objects
// for this Driver
oslModule m_hModule;
OMozabConnection_CreateInstanceFunction m_pCreationFunc;
OGetSdbcScheme_Function m_pSchemeFunction;
bool ensureInit();
virtual ~MozabDriver();
public:
explicit MozabDriver(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory);
// OComponentHelper
virtual void SAL_CALL disposing();
// XInterface
static OUString getImplementationName_Static( ) throw(::com::sun::star::uno::RuntimeException);
static ::com::sun::star::uno::Sequence< OUString > getSupportedServiceNames_Static( ) throw (::com::sun::star::uno::RuntimeException);
// XServiceInfo
virtual OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
// XDriver
virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > SAL_CALL connect( const OUString& url, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
virtual sal_Bool SAL_CALL acceptsURL( const OUString& url ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Sequence< ::com::sun::star::sdbc::DriverPropertyInfo > SAL_CALL getPropertyInfo( const OUString& url, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
virtual sal_Int32 SAL_CALL getMajorVersion( ) throw(::com::sun::star::uno::RuntimeException);
virtual sal_Int32 SAL_CALL getMinorVersion( ) throw(::com::sun::star::uno::RuntimeException);
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
& getMSFactory() const { return m_xMSFactory; }
private:
EDriverType impl_classifyURL( const OUString& url );
};
}
}
#endif // INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_MOZAB_MDRIVER_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- 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 INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_MOZAB_MEXTCONFIGACCESS_HXX
#define INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_MOZAB_MEXTCONFIGACCESS_HXX
// This is the extended version (for use on the SO side of the driver) of MConfigAccess
// (which is for use on the mozilla side only)
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
namespace connectivity
{
namespace mozab
{
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
createDriverConfigNode( ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > _rxORB );
}
}
#endif // INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_MOZAB_MEXTCONFIGACCESS_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- 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 INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_MOZAB_MRESULTSETMETADATA_HXX
#define INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_MOZAB_MRESULTSETMETADATA_HXX
#include <com/sun/star/sdbc/XResultSetMetaData.hpp>
#include <cppuhelper/implbase.hxx>
#include <vector>
#include <rtl/ref.hxx>
#include "MConnection.hxx"
#include "MTable.hxx"
namespace connectivity
{
namespace mozab
{
//************ Class: ResultSetMetaData
typedef ::cppu::WeakImplHelper< ::com::sun::star::sdbc::XResultSetMetaData> OResultSetMetaData_BASE;
class OResultSetMetaData : public OResultSetMetaData_BASE
{
OUString m_aTableName;
::rtl::Reference<connectivity::OSQLColumns> m_xColumns;
OTable* m_pTable;
sal_Bool m_bReadOnly;
protected:
virtual ~OResultSetMetaData();
public:
// a constructor that is needed to return the object:
// OResultSetMetaData(OConnection* _pConnection) : m_pConnection(_pConnection){}
OResultSetMetaData(const ::rtl::Reference<connectivity::OSQLColumns>& _rxColumns,
const OUString& _aTableName,OTable* _pTable,sal_Bool aReadOnly
)
:m_aTableName(_aTableName)
,m_xColumns(_rxColumns)
,m_pTable(_pTable)
,m_bReadOnly(aReadOnly)
{}
/// Avoid ambigous cast error from the compiler.
inline operator ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData > () throw()
{ return this; }
void checkColumnIndex(sal_Int32 column) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
virtual sal_Int32 SAL_CALL getColumnCount( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
virtual sal_Bool SAL_CALL isAutoIncrement( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
virtual sal_Bool SAL_CALL isCaseSensitive( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
virtual sal_Bool SAL_CALL isSearchable( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
virtual sal_Bool SAL_CALL isCurrency( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
virtual sal_Int32 SAL_CALL isNullable( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
virtual sal_Bool SAL_CALL isSigned( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
virtual sal_Int32 SAL_CALL getColumnDisplaySize( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
virtual OUString SAL_CALL getColumnLabel( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
virtual OUString SAL_CALL getColumnName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
virtual OUString SAL_CALL getSchemaName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
virtual sal_Int32 SAL_CALL getPrecision( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
virtual sal_Int32 SAL_CALL getScale( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
virtual OUString SAL_CALL getTableName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
virtual OUString SAL_CALL getCatalogName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
virtual sal_Int32 SAL_CALL getColumnType( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
virtual OUString SAL_CALL getColumnTypeName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
virtual sal_Bool SAL_CALL isReadOnly( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
virtual sal_Bool SAL_CALL isWritable( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
virtual sal_Bool SAL_CALL isDefinitelyWritable( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
virtual OUString SAL_CALL getColumnServiceName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
};
}
}
#endif // INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_MOZAB_MRESULTSETMETADATA_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -26,8 +26,6 @@
#define STR_MOZILLA_ADDRESSBOOKS ( STR_MORK_BASE + 0 )
#define STR_THUNDERBIRD_ADDRESSBOOKS ( STR_MORK_BASE + 1 )
#define STR_OE_ADDRESSBOOK ( STR_MORK_BASE + 2 )
#define STR_OUTLOOK_MAPI_ADDRESSBOOK ( STR_MORK_BASE + 3 )
// FREE
#define STR_NO_TABLE_CREATION_SUPPORT ( STR_MORK_BASE + 5 )
#define STR_MOZILLA_IS_RUNNING ( STR_MORK_BASE + 6 )
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment