merge the formfield patch from ooo-build
[ooovba.git] / connectivity / source / drivers / mozab / mozillasrc / MNSMozabProxy.hxx
blob3b6ccf94a1693cedd3cab00296f8fe9a582db231
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: MNSMozabProxy.hxx,v $
10 * $Revision: 1.5 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _CONNECTIVITY_MAB_MOZABHELPER_HXX_
32 #define _CONNECTIVITY_MAB_MOZABHELPER_HXX_
33 #include "MNSDeclares.hxx"
34 #include <osl/thread.hxx>
36 #include <MNSInclude.hxx>
37 #ifndef _CPPUHELPER_COMPBASE2_HXX_
38 #include <cppuhelper/compbase1.hxx>
39 #endif
40 #ifndef _COM_SUN_STAR_MOZILLA_XCODEPROXY_HDL_
41 #include <com/sun/star/mozilla/XCodeProxy.hpp>
42 #endif
43 #ifndef _COM_SUN_STAR_MOZILLA_XPROXYRUNNER_HDL_
44 #include "com/sun/star/mozilla/XProxyRunner.hdl"
45 #endif
47 namespace connectivity
49 namespace mozab
51 namespace ProxiedFunc
53 enum
55 FUNC_TESTLDAP_INIT_LDAP=1,
56 FUNC_TESTLDAP_IS_LDAP_CONNECTED,
57 FUNC_TESTLDAP_RELEASE_RESOURCE,
58 FUNC_GET_TABLE_STRINGS,
59 FUNC_EXECUTE_QUERY,
60 FUNC_QUERYHELPER_CREATE_NEW_CARD,
61 FUNC_QUERYHELPER_DELETE_CARD,
62 FUNC_QUERYHELPER_COMMIT_CARD,
63 FUNC_QUERYHELPER_RESYNC_CARD,
64 FUNC_NEW_ADDRESS_BOOK
68 struct RunArgs
70 sal_Int32 funcIndex; //Function Index
71 sal_Int32 argCount; //parameter count
72 void * arg1;
73 void * arg2;
74 void * arg3;
75 void * arg4;
76 void * arg5;
77 void * arg6;
78 RunArgs()
80 arg1 = NULL;
81 arg2 = NULL;
82 arg3 = NULL;
83 arg4 = NULL;
84 arg5 = NULL;
85 arg6 = NULL;
88 typedef RunArgs RunArgs;
89 typedef ::cppu::WeakImplHelper1< ::com::sun::star::mozilla::XCodeProxy > MNSMozabProxy_BASE;
92 class MNSMozabProxy : public MNSMozabProxy_BASE
94 public:
95 MNSMozabProxy();
96 virtual ~MNSMozabProxy();
98 //XCodeProxy
99 virtual sal_Int32 SAL_CALL run( ) throw (::com::sun::star::uno::RuntimeException);
100 virtual ::com::sun::star::mozilla::MozillaProductType SAL_CALL getProductType( ) throw (::com::sun::star::uno::RuntimeException);
101 virtual ::rtl::OUString SAL_CALL getProfileName( ) throw (::com::sun::star::uno::RuntimeException);
103 public:
104 sal_Int32 StartProxy(RunArgs * args,::com::sun::star::mozilla::MozillaProductType aProduct,const ::rtl::OUString &aProfile); //Call this to start proxy
106 protected:
107 nsresult testLDAPConnection();
108 nsresult InitLDAP(sal_Char* sUri, sal_Unicode* sBindDN, sal_Unicode* sPasswd,sal_Bool * nUseSSL);
109 nsresult QueryHelperStub();
110 private:
111 ::com::sun::star::uno::Reference< ::com::sun::star::mozilla::XProxyRunner > xRunner;
113 RunArgs * m_Args;
114 ::com::sun::star::mozilla::MozillaProductType m_Product;
115 ::rtl::OUString m_Profile;
116 #if OSL_DEBUG_LEVEL > 0
117 oslThreadIdentifier m_oThreadID;
118 #endif
122 #endif //_CONNECTIVITY_MAB_MOZABHELPER_HXX_