summaryrefslogtreecommitdiff
path: root/dbaccess/source/core/resource
diff options
context:
space:
mode:
Diffstat (limited to 'dbaccess/source/core/resource')
-rw-r--r--dbaccess/source/core/resource/core_resource.cxx119
-rw-r--r--dbaccess/source/core/resource/makefile.mk48
-rw-r--r--dbaccess/source/core/resource/strings.src326
3 files changed, 493 insertions, 0 deletions
diff --git a/dbaccess/source/core/resource/core_resource.cxx b/dbaccess/source/core/resource/core_resource.cxx
new file mode 100644
index 000000000000..f2efb811418d
--- /dev/null
+++ b/dbaccess/source/core/resource/core_resource.cxx
@@ -0,0 +1,119 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_dbaccess.hxx"
+
+#include "core_resource.hxx"
+
+#include <tools/resmgr.hxx>
+
+// ---- needed as long as we have no contexts for components ---
+#ifndef _SV_SVAPP_HXX
+#include <vcl/svapp.hxx>
+#endif
+//---------------------------------------------------
+
+#ifndef _SOLAR_HRC
+#include <svl/solar.hrc>
+#endif
+
+//.........................................................................
+namespace dbaccess
+{
+
+ //==================================================================
+ //= ResourceManager
+ //==================================================================
+ ::osl::Mutex ResourceManager::s_aMutex;
+ sal_Int32 ResourceManager::s_nClients = 0;
+ ResMgr* ResourceManager::m_pImpl = NULL;
+
+ //------------------------------------------------------------------
+ void ResourceManager::ensureImplExists()
+ {
+ if (m_pImpl)
+ return;
+
+ ::com::sun::star::lang::Locale aLocale = Application::GetSettings().GetUILocale();
+
+ ByteString sFileName("dba");
+
+ m_pImpl = ResMgr::CreateResMgr(sFileName.GetBuffer(), aLocale);
+ }
+
+ //------------------------------------------------------------------
+ ::rtl::OUString ResourceManager::loadString(sal_uInt16 _nResId)
+ {
+ ::rtl::OUString sReturn;
+
+ ensureImplExists();
+ if (m_pImpl)
+ sReturn = String(ResId(_nResId,*m_pImpl));
+
+ return sReturn;
+ }
+
+ //------------------------------------------------------------------
+ ::rtl::OUString ResourceManager::loadString( sal_uInt16 _nResId, const sal_Char* _pPlaceholderAscii, const ::rtl::OUString& _rReplace )
+ {
+ String sString( loadString( _nResId ) );
+ sString.SearchAndReplaceAscii( _pPlaceholderAscii, _rReplace );
+ return sString;
+ }
+
+ //------------------------------------------------------------------
+ ::rtl::OUString ResourceManager::loadString( sal_uInt16 _nResId, const sal_Char* _pPlaceholderAscii1, const ::rtl::OUString& _rReplace1,
+ const sal_Char* _pPlaceholderAscii2, const ::rtl::OUString& _rReplace2 )
+ {
+ String sString( loadString( _nResId ) );
+ sString.SearchAndReplaceAscii( _pPlaceholderAscii1, _rReplace1 );
+ sString.SearchAndReplaceAscii( _pPlaceholderAscii2, _rReplace2 );
+ return sString;
+ }
+
+ //-------------------------------------------------------------------------
+ void ResourceManager::registerClient()
+ {
+ ::osl::MutexGuard aGuard(s_aMutex);
+ ++s_nClients;
+ }
+
+ //-------------------------------------------------------------------------
+ void ResourceManager::revokeClient()
+ {
+ ::osl::MutexGuard aGuard(s_aMutex);
+ if (!--s_nClients && m_pImpl)
+ {
+ delete m_pImpl;
+ m_pImpl = NULL;
+ }
+ }
+//.........................................................................
+}
+//.........................................................................
+
diff --git a/dbaccess/source/core/resource/makefile.mk b/dbaccess/source/core/resource/makefile.mk
new file mode 100644
index 000000000000..293b92b5e4cf
--- /dev/null
+++ b/dbaccess/source/core/resource/makefile.mk
@@ -0,0 +1,48 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# 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.
+#
+#*************************************************************************
+
+PRJ=..$/..$/..
+PRJINC=$(PRJ)$/source
+PRJNAME=dbaccess
+TARGET=core_resource
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : settings.mk
+.INCLUDE : $(PRJ)$/util$/dba.pmk
+
+# --- Files --------------------------------------------------------
+
+SRS1NAME=core_strings
+SRC1FILES= \
+ strings.src \
+
+SLOFILES= $(SLO)$/core_resource.obj \
+
+# --- Targets ----------------------------------
+
+.INCLUDE : target.mk
diff --git a/dbaccess/source/core/resource/strings.src b/dbaccess/source/core/resource/strings.src
new file mode 100644
index 000000000000..dc7023ca6fba
--- /dev/null
+++ b/dbaccess/source/core/resource/strings.src
@@ -0,0 +1,326 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#include "core_resource.hrc"
+#include "dbamiscres.hrc"
+
+String RID_STR_TRIED_OPEN_TABLE
+{
+ Text [ en-US ] = "Tried to open the table $name$.";
+};
+String RID_STR_CONNECTION_INVALID
+{
+ Text [ en-US ] = "No connection could be established.";
+};
+
+String RID_STR_TABLE_IS_FILTERED
+{
+ Text [ en-US ] = "The table $name$ already exists. It is not visible because it has been filtered out.";
+};
+
+String RID_STR_NEED_CONFIG_WRITE_ACCESS
+{
+ Text [ en-US ] = "You have no write access to the configuration data the object is based on.";
+};
+
+
+String RID_STR_COULDNOTCONNECT_UNSPECIFIED
+{
+ Text [ en-US ] = "The connection to the external data source could not be established. An unknown error occurred. The driver is probably defective.";
+};
+
+String RID_STR_COULDNOTCONNECT_NODRIVER
+{
+ Text [ en-US ] = "The connection to the external data source could not be established. No SDBC driver was found for the given URL.";
+};
+
+String RID_STR_COULDNOTLOAD_MANAGER
+{
+ Text [ en-US ] = "The connection to the external data source could not be established. The SDBC driver manager could not be loaded.";
+};
+
+String RID_STR_FORM
+{
+ Text [ en-US ] = "Form";
+};
+
+String RID_STR_REPORT
+{
+ Text [ en-US ] = "Report";
+};
+
+String RID_STR_DATASOURCE_NOT_STORED
+{
+ Text [ en-US ] = "The data source was not saved. Please use the interface XStorable to save the data source.";
+};
+String RID_STR_ONLY_QUERY
+{
+ Text [ en-US ] = "The given command is not a SELECT statement.\nOnly queries are allowed.";
+};
+String RID_STR_NO_VALUE_CHANGED
+{
+ Text [ en-US ] = "No values were modified.";
+};
+String RID_STR_NO_XROWUPDATE
+{
+ Text [ en-US ] = "Values could not be inserted. The XRowUpdate interface is not supported by ResultSet.";
+};
+String RID_STR_NO_XRESULTSETUPDATE
+{
+ Text [ en-US ] = "Values could not be inserted. The XResultSetUpdate interface is not supported by ResultSet.";
+};
+String RID_STR_NO_UPDATE_MISSING_CONDITION
+{
+ Text [ en-US ] = "Values could not be modified, due to a missing condition statement.";
+};
+String RID_STR_NO_COLUMN_ADD
+{
+ Text [ en-US ] = "The adding of columns is not supported.";
+};
+String RID_STR_NO_COLUMN_DROP
+{
+ Text [ en-US ] = "The dropping of columns is not supported.";
+};
+String RID_STR_NO_CONDITION_FOR_PK
+{
+ Text [ en-US ] = "The WHERE condition could not be created for the primary key.";
+};
+String RID_STR_COLUMN_UNKNOWN_PROP
+{
+ Text [ en-US ] = "The column does not support the property '%value'.";
+};
+String RID_STR_COLUMN_NOT_SEARCHABLE
+{
+ Text [ en-US ] = "The column is not searchable!";
+};
+String RID_STR_NOT_SEQUENCE_INT8
+{
+ Text [ en-US ] = "The value of the columns is not of the type Sequence<sal_Int8>.";
+};
+String RID_STR_COLUMN_NOT_VALID
+{
+ Text [ en-US ] = "The column is not valid.";
+};
+String RID_STR_COLUMN_MUST_VISIBLE
+{
+ Text [ en-US ] = "The column '%name' must be visible as a column.";
+};
+String RID_STR_NO_XQUERIESSUPPLIER
+{
+ Text [ en-US ] = "The interface XQueriesSupplier is not available.";
+};
+String RID_STR_NOT_SUPPORTED_BY_DRIVER
+{
+ Text [ en-US ] = "The driver does not support this function.";
+};
+String RID_STR_NO_ABS_ZERO
+{
+ Text [ en-US ] = "An 'absolute(0)' call is not allowed.";
+};
+String RID_STR_NO_RELATIVE
+{
+ Text [ en-US ] = "Relative positioning is not allowed in this state.";
+};
+String RID_STR_NO_REFESH_AFTERLAST
+{
+ Text [ en-US ] = "A row cannot be refreshed when the ResultSet is positioned after the last row.";
+};
+String RID_STR_NO_MOVETOINSERTROW_CALLED
+{
+ Text [ en-US ] = "A new row cannot be inserted when the ResultSet is not first moved to the insert row.";
+};
+String RID_STR_NO_UPDATEROW
+{
+ Text [ en-US ] = "A row cannot be modified in this state";
+};
+String RID_STR_NO_DELETEROW
+{
+ Text [ en-US ] = "A row cannot be deleted in this state.";
+};
+String RID_STR_NO_TABLE_RENAME
+{
+ Text [ en-US ] = "The driver does not support table renaming.";
+};
+String RID_STR_NO_ALTER_COLUMN_DEF
+{
+ Text [ en-US ] = "The driver does not support the modification of column descriptions.";
+};
+String RID_STR_COLUMN_ALTER_BY_NAME
+{
+ Text [ en-US ] = "The driver does not support the modification of column descriptions by changing the name.";
+};
+String RID_STR_COLUMN_ALTER_BY_INDEX
+{
+ Text [ en-US ] = "The driver does not support the modification of column descriptions by changing the index.";
+};
+String RID_STR_FILE_DOES_NOT_EXIST
+{
+ Text[ en-US ] = "The file \"$file$\" does not exist.";
+};
+
+String RID_STR_TABLE_DOES_NOT_EXIST
+{
+ Text [ en-US ] = "There exists no table named \"$table$\".";
+};
+
+String RID_STR_QUERY_DOES_NOT_EXIST
+{
+ Text [ en-US ] = "There exists no query named \"$table$\".";
+};
+
+String RID_STR_CONFLICTING_NAMES
+{
+ Text [ en-US ] = "There are tables in the database whose names conflict with the names of existing queries. To make full use of all queries and tables, make sure they have distinct names.";
+};
+
+String RID_STR_COMMAND_LEADING_TO_ERROR
+{
+ Text [ en-US ] = "The SQL command leading to this error is:\n\n$command$";
+
+};
+
+String RID_STR_STATEMENT_WITHOUT_RESULT_SET
+{
+ Text [ en-US ] = "The SQL command does not describe a result set.";
+};
+
+String RID_STR_NAME_MUST_NOT_BE_EMPTY
+{
+ Text [ en-US ] = "The name must not be empty.";
+};
+
+String RID_STR_NO_NULL_OBJECTS_IN_CONTAINER
+{
+ Text [ en-US ] = "The container cannot contain NULL objects.";
+};
+
+String RID_STR_NAME_ALREADY_USED
+{
+ Text [ en-US ] = "There already is an object with the given name.";
+};
+
+String RID_STR_OBJECT_CONTAINER_MISMATCH
+{
+ Text [ en-US ] = "This object cannot be part of this container.";
+};
+
+String RID_STR_OBJECT_ALREADY_CONTAINED
+{
+ Text [ en-US ] = "The object already is, with a different name, part of the container.";
+};
+
+String RID_STR_NAME_NOT_FOUND
+{
+ Text [ en-US ] = "Unable to find the document '$name$'.";
+};
+
+String RID_STR_ERROR_WHILE_SAVING
+{
+ Text [ en-US ] = "Could not save the document to $location$:\n$message$";
+};
+
+String RID_NO_SUCH_DATA_SOURCE
+{
+ Text [ en-US ] = "Error accessing data source '$name$':\n$error$";
+};
+String RID_STR_NO_SUB_FOLDER
+{
+ Text [ en-US ] = "There exists no folder named \"$folder$\".";
+};
+String RID_STR_NO_DELETE_BEFORE_AFTER
+{
+ Text [ en-US ] = "Cannot delete the before-first or after-last row.";
+};
+String RID_STR_NO_DELETE_INSERT_ROW
+{
+ Text [ en-US ] = "Cannot delete the insert-row.";
+};
+String RID_STR_RESULT_IS_READONLY
+{
+ Text [ en-US ] = "Result set is read only.";
+};
+String RID_STR_NO_DELETE_PRIVILEGE
+{
+ Text [ en-US ] = "DELETE privilege not available.";
+};
+String RID_STR_ROW_ALREADY_DELETED
+{
+ Text [ en-US ] = "Current row is already deleted.";
+};
+String RID_STR_UPDATE_FAILED
+{
+ Text [ en-US ] = "Current row could be updated.";
+};
+//-------------------------------------------------------------------------
+String RID_STR_NO_INSERT_PRIVILEGE
+{
+ Text [ en-US ] = "INSERT privilege not available.";
+};
+String RID_STR_INTERNAL_ERROR
+{
+ Text [ en-US ] = "Internal error: no statement object provided by the database driver.";
+};
+String RID_STR_EXPRESSION1
+{
+ Text [ en-US ] = "Expression1";
+};
+String RID_STR_NO_SQL_COMMAND
+{
+ Text [ en-US ] = "No SQL command was provided.";
+};
+String RID_STR_INVALID_INDEX
+{
+ Text [ en-US ] = "Invalid column index.";
+};
+String RID_STR_INVALID_CURSOR_STATE
+{
+ Text [ en-US ] = "Invalid cursor state.";
+};
+String RID_STR_CURSOR_BEFORE_OR_AFTER
+{
+ Text [ en-US ] = "The cursor points to before the first or after the last row.";
+};
+String RID_STR_NO_BOOKMARK_BEFORE_OR_AFTER
+{
+ Text [ en-US ] = "The rows before the first and after the last row don't have a bookmark.";
+};
+String RID_STR_NO_BOOKMARK_DELETED
+{
+ Text [ en-US ] = "The current row is deleted, and thus doesn't have a bookmark.";
+};
+String RID_STR_NO_EMBEDDING
+{
+ Text [ en-US ] = "Embedding of database documents is not supported.";
+};
+String RID_STR_CONNECTION_REQUEST
+{
+ Text [ en-US ] = "A connection for the following URL was requested \"$name$\".";
+};
+String RID_STR_MISSING_EXTENSION
+{
+ Text [ en-US ] = "The extension is not installed.";
+};