summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2009-07-30 10:24:24 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2009-07-30 10:24:24 +0000
commit3bf6f1976814b5488c4572954dbadf624a4130cf (patch)
tree09676595763e7be4c8c3fce350eda935a3af1b1d /svtools
parentb1afe0f67dca54e3deec4110f1760dd4880e6762 (diff)
CWS-TOOLING: integrate CWS wordencryption
2009-07-10 09:42:25 +0200 mav r273872 : resolve merge problem 2009-07-08 07:46:13 +0200 mav r273815 : CWS-TOOLING: rebase CWS wordencryption to trunk@273468 (milestone: DEV300:m51) 2009-07-03 10:38:03 +0200 mav r273682 : #i10000# resolve conflict 2009-07-02 08:47:35 +0200 steve_yin r273618 : Removed IBM(C) from modified files. 2009-06-22 04:34:44 +0200 steve_yin r273191 : Based on Mikhail suggestions, I changed some code. 2009-06-18 09:37:14 +0200 mav r273100 : #i10000# get rid of windows warnings 2009-06-17 08:18:33 +0200 mav r273047 : #i10000# adopt for linux build
Diffstat (limited to 'svtools')
-rw-r--r--svtools/inc/docmspasswdrequest.hxx72
-rw-r--r--svtools/inc/pch/precompiled_svtools.hxx1
-rw-r--r--svtools/prj/d.lst1
-rw-r--r--svtools/source/misc1/docmspasswdrequest.cxx143
-rw-r--r--svtools/source/misc1/makefile.mk1
5 files changed, 218 insertions, 0 deletions
diff --git a/svtools/inc/docmspasswdrequest.hxx b/svtools/inc/docmspasswdrequest.hxx
new file mode 100644
index 000000000000..684bffe71760
--- /dev/null
+++ b/svtools/inc/docmspasswdrequest.hxx
@@ -0,0 +1,72 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright IBM Corporation 2009.
+ * Copyright 2009 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: docmspasswdrequest.hxx,v $
+ * $Revision: 1.0 $
+ *
+ * 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 INCLUDED_SVTOOLS_DOCMSPASSWDREQUEST_HXX
+#define INCLUDED_SVTOOLS_DOCMSPASSWDREQUEST_HXX
+
+#include "svtools/svldllapi.h"
+#include <com/sun/star/task/DocumentMSPasswordRequest.hpp>
+#include <com/sun/star/task/XInteractionRequest.hpp>
+#include <rtl/ustring.hxx>
+#include <cppuhelper/implbase1.hxx>
+
+class MSAbortContinuation;
+class MSPasswordContinuation;
+
+class SVL_DLLPUBLIC RequestMSDocumentPassword : public ::cppu::WeakImplHelper1< ::com::sun::star::task::XInteractionRequest >
+{
+ ::com::sun::star::uno::Any m_aRequest;
+
+ ::com::sun::star::uno::Sequence<
+ ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation >
+ > m_lContinuations;
+
+ MSAbortContinuation* m_pAbort;
+ MSPasswordContinuation* m_pPassword;
+
+public:
+ RequestMSDocumentPassword( ::com::sun::star::task::PasswordRequestMode nMode, ::rtl::OUString aName );
+
+ sal_Bool isAbort();
+ sal_Bool isPassword();
+
+ ::rtl::OUString getPassword();
+
+ virtual ::com::sun::star::uno::Any SAL_CALL getRequest()
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ virtual ::com::sun::star::uno::Sequence<
+ ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation >
+ > SAL_CALL getContinuations()
+ throw( ::com::sun::star::uno::RuntimeException );
+};
+
+#endif /* INCLUDED_SVTOOLS_DOCMSPASSWDREQUEST_HXX */
diff --git a/svtools/inc/pch/precompiled_svtools.hxx b/svtools/inc/pch/precompiled_svtools.hxx
index 440bd04dce36..cab81cac04ec 100644
--- a/svtools/inc/pch/precompiled_svtools.hxx
+++ b/svtools/inc/pch/precompiled_svtools.hxx
@@ -227,6 +227,7 @@
#include <com/sun/star/system/XProxySettings.hpp>
#include <com/sun/star/system/XSystemShellExecute.hpp>
#include <com/sun/star/task/DocumentPasswordRequest.hpp>
+#include <com/sun/star/task/DocumentMSPasswordRequest.hpp>
#include <com/sun/star/task/MasterPasswordRequest.hpp>
#include <com/sun/star/task/NoMasterException.hpp>
#include <com/sun/star/task/PasswordRequestMode.hpp>
diff --git a/svtools/prj/d.lst b/svtools/prj/d.lst
index 6b85194db6c1..4ff74419b9d4 100644
--- a/svtools/prj/d.lst
+++ b/svtools/prj/d.lst
@@ -312,6 +312,7 @@ mkdir: %_DEST%\inc%_EXT%\svtools
..\inc\textwindowaccessibility.hxx %_DEST%\inc%_EXT%\svtools\textwindowaccessibility.hxx
..\inc\docpasswdrequest.hxx %_DEST%\inc%_EXT%\svtools\docpasswdrequest.hxx
+..\inc\docmspasswdrequest.hxx %_DEST%\inc%_EXT%\svtools\docmspasswdrequest.hxx
..\inc\fontsubstconfig.hxx %_DEST%\inc%_EXT%\svtools\fontsubstconfig.hxx
..\inc\apearcfg.hxx %_DEST%\inc%_EXT%\svtools\apearcfg.hxx
..\inc\fltrcfg.hxx %_DEST%\inc%_EXT%\svtools\fltrcfg.hxx
diff --git a/svtools/source/misc1/docmspasswdrequest.cxx b/svtools/source/misc1/docmspasswdrequest.cxx
new file mode 100644
index 000000000000..e892d3a57d1a
--- /dev/null
+++ b/svtools/source/misc1/docmspasswdrequest.cxx
@@ -0,0 +1,143 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright IBM Corporation 2009.
+ * Copyright 2009 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: docmspasswdrequest.cxx,v $
+ * $Revision: 1.0 $
+ *
+ * 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_svtools.hxx"
+
+#include "docmspasswdrequest.hxx"
+#include <com/sun/star/task/XInteractionAbort.hpp>
+#include <com/sun/star/task/XInteractionPassword.hpp>
+
+//==========================================================================
+
+class MSAbortContinuation : public ::cppu::WeakImplHelper1< ::com::sun::star::task::XInteractionAbort >
+{
+ sal_Bool mbSelected;
+
+public:
+ MSAbortContinuation() : mbSelected( sal_False ) {}
+
+ sal_Bool isSelected() { return mbSelected; }
+
+ void reset() { mbSelected = sal_False; }
+
+ virtual void SAL_CALL select() throw(::com::sun::star::uno::RuntimeException) { mbSelected = sal_True; }
+};
+
+//==========================================================================
+
+class MSPasswordContinuation : public ::cppu::WeakImplHelper1< ::com::sun::star::task::XInteractionPassword >
+{
+ sal_Bool mbSelected;
+ ::rtl::OUString maPassword;
+
+public:
+ MSPasswordContinuation() : mbSelected( sal_False ) {}
+
+ sal_Bool isSelected() { return mbSelected; }
+
+ void reset() { mbSelected = sal_False; }
+
+ virtual void SAL_CALL select() throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setPassword( const ::rtl::OUString& aPass ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getPassword( ) throw (::com::sun::star::uno::RuntimeException);
+};
+
+void SAL_CALL MSPasswordContinuation::select()
+ throw(::com::sun::star::uno::RuntimeException)
+{
+ mbSelected = sal_True;
+}
+
+void SAL_CALL MSPasswordContinuation::setPassword( const ::rtl::OUString& aPass )
+ throw (::com::sun::star::uno::RuntimeException)
+{
+ maPassword = aPass;
+}
+
+::rtl::OUString SAL_CALL MSPasswordContinuation::getPassword()
+ throw (::com::sun::star::uno::RuntimeException)
+{
+ return maPassword;
+}
+
+//==========================================================================
+
+RequestMSDocumentPassword::RequestMSDocumentPassword( ::com::sun::star::task::PasswordRequestMode nMode, ::rtl::OUString aName )
+{
+ ::rtl::OUString temp;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > temp2;
+ ::com::sun::star::task::DocumentMSPasswordRequest
+ aDocumentMSPasswordRequest( temp,
+ temp2,
+ ::com::sun::star::task::InteractionClassification_QUERY,
+ nMode,
+ aName );
+
+ m_aRequest <<= aDocumentMSPasswordRequest;
+
+ m_pAbort = new MSAbortContinuation;
+ m_pPassword = new MSPasswordContinuation;
+
+ m_lContinuations.realloc( 2 );
+ m_lContinuations[0] = ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation >( m_pAbort );
+ m_lContinuations[1] = ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation >( m_pPassword );
+}
+
+sal_Bool RequestMSDocumentPassword::isAbort()
+{
+ return m_pAbort->isSelected();
+}
+
+sal_Bool RequestMSDocumentPassword::isPassword()
+{
+ return m_pPassword->isSelected();
+}
+
+::rtl::OUString RequestMSDocumentPassword::getPassword()
+{
+ return m_pPassword->getPassword();
+}
+
+::com::sun::star::uno::Any SAL_CALL RequestMSDocumentPassword::getRequest()
+ throw( ::com::sun::star::uno::RuntimeException )
+{
+ return m_aRequest;
+}
+
+::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation > >
+ SAL_CALL RequestMSDocumentPassword::getContinuations()
+ throw( ::com::sun::star::uno::RuntimeException )
+{
+ return m_lContinuations;
+}
+
+
diff --git a/svtools/source/misc1/makefile.mk b/svtools/source/misc1/makefile.mk
index 0d1e67fd9021..3ca57ff36f92 100644
--- a/svtools/source/misc1/makefile.mk
+++ b/svtools/source/misc1/makefile.mk
@@ -50,6 +50,7 @@ SLOFILES=\
$(EXCEPTIONSFILES) \
$(SLO)$/adrparse.obj \
$(SLO)$/docpasswdrequest.obj \
+ $(SLO)$/docmspasswdrequest.obj \
$(SLO)$/filenotation.obj \
$(SLO)$/inethist.obj \
$(SLO)$/inettype.obj \