Update ooo320-m1
[ooovba.git] / connectivity / source / inc / mysql / YUser.hxx
blobe9f5fab8115ec1050cd7014388831a8d6d023933
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: YUser.hxx,v $
10 * $Revision: 1.4 $
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_MYSQL_USER_HXX_
32 #define _CONNECTIVITY_MYSQL_USER_HXX_
34 #include "connectivity/sdbcx/VUser.hxx"
35 #include "com/sun/star/sdbc/XConnection.hpp"
37 namespace connectivity
39 namespace mysql
41 typedef connectivity::sdbcx::OUser OUser_TYPEDEF;
43 class OMySQLUser : public OUser_TYPEDEF
45 ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > m_xConnection;
47 ::rtl::OUString getPrivilegeString(sal_Int32 nRights) const;
48 // return the privileges and additional the grant rights
49 void findPrivilegesAndGrantPrivileges(const ::rtl::OUString& objName, sal_Int32 objType,sal_Int32& nRights,sal_Int32& nRightsWithGrant) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
50 public:
51 virtual void refreshGroups();
52 public:
53 OMySQLUser( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _xConnection);
54 OMySQLUser( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _xConnection,const ::rtl::OUString& _Name);
56 // XUser
57 virtual void SAL_CALL changePassword( const ::rtl::OUString& objPassword, const ::rtl::OUString& newPassword ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
58 // XAuthorizable
59 virtual sal_Int32 SAL_CALL getPrivileges( const ::rtl::OUString& objName, sal_Int32 objType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
60 virtual sal_Int32 SAL_CALL getGrantablePrivileges( const ::rtl::OUString& objName, sal_Int32 objType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
61 virtual void SAL_CALL grantPrivileges( const ::rtl::OUString& objName, sal_Int32 objType, sal_Int32 objPrivileges ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
62 virtual void SAL_CALL revokePrivileges( const ::rtl::OUString& objName, sal_Int32 objType, sal_Int32 objPrivileges ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
65 class OUserExtend;
66 typedef ::comphelper::OPropertyArrayUsageHelper<OUserExtend> OUserExtend_PROP;
68 class OUserExtend : public OMySQLUser,
69 public OUserExtend_PROP
71 protected:
72 ::rtl::OUString m_Password;
73 // OPropertyArrayUsageHelper
74 virtual ::cppu::IPropertyArrayHelper* createArrayHelper() const;
75 // OPropertySetHelper
76 virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
77 public:
78 OUserExtend(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _xConnection);
80 virtual void construct();
84 #endif // _CONNECTIVITY_MYSQL_USER_HXX_