tdf#130857 qt weld: Implement QtInstanceWidget::strip_mnemonic
[LibreOffice.git] / connectivity / source / sdbcx / VGroup.cxx
blobc2a789a9057471423593c99dd86445289b1d1a57
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
21 #include <sdbcx/VGroup.hxx>
22 #include <comphelper/sequence.hxx>
23 #include <connectivity/dbexception.hxx>
26 using namespace ::connectivity::sdbcx;
27 using namespace ::connectivity;
28 using namespace ::dbtools;
29 using namespace ::com::sun::star::uno;
30 using namespace ::com::sun::star::container;
31 using namespace ::com::sun::star::lang;
32 using namespace ::com::sun::star::beans;
34 IMPLEMENT_SERVICE_INFO(OGroup,u"com.sun.star.sdbcx.VGroup"_ustr,u"com.sun.star.sdbcx.Group"_ustr);
36 OGroup::OGroup(bool _bCase) : OGroup_BASE(m_aMutex)
37 , ODescriptor(OGroup_BASE::rBHelper,_bCase)
41 OGroup::OGroup(const OUString& Name, bool _bCase) : OGroup_BASE(m_aMutex)
42 ,ODescriptor(OGroup_BASE::rBHelper,_bCase)
44 m_Name = Name;
47 OGroup::~OGroup()
51 Any SAL_CALL OGroup::queryInterface( const Type & rType )
53 Any aRet = ODescriptor::queryInterface( rType);
54 return aRet.hasValue() ? aRet : OGroup_BASE::queryInterface( rType);
57 Sequence< Type > SAL_CALL OGroup::getTypes( )
59 return ::comphelper::concatSequences(ODescriptor::getTypes(),OGroup_BASE::getTypes());
62 void OGroup::disposing()
64 OPropertySetHelper::disposing();
66 ::osl::MutexGuard aGuard(m_aMutex);
68 if(m_pUsers)
69 m_pUsers->disposing();
72 ::cppu::IPropertyArrayHelper* OGroup::createArrayHelper( ) const
74 Sequence< Property > aProps;
75 describeProperties(aProps);
76 return new ::cppu::OPropertyArrayHelper(aProps);
79 ::cppu::IPropertyArrayHelper & OGroup::getInfoHelper()
81 return *getArrayHelper();
84 Reference< XNameAccess > SAL_CALL OGroup::getUsers( )
86 ::osl::MutexGuard aGuard(m_aMutex);
87 checkDisposed(OGroup_BASE::rBHelper.bDisposed);
89 try
91 if ( !m_pUsers )
92 refreshUsers();
94 catch( const RuntimeException& )
96 // allowed to leave this method
97 throw;
99 catch( const Exception& )
101 // allowed
104 return m_pUsers.get();
108 sal_Int32 SAL_CALL OGroup::getPrivileges( const OUString& /*objName*/, sal_Int32 /*objType*/ )
110 ::osl::MutexGuard aGuard(m_aMutex);
111 checkDisposed(OGroup_BASE::rBHelper.bDisposed);
113 return 0;
116 sal_Int32 SAL_CALL OGroup::getGrantablePrivileges( const OUString& /*objName*/, sal_Int32 /*objType*/ )
118 ::osl::MutexGuard aGuard(m_aMutex);
119 checkDisposed(OGroup_BASE::rBHelper.bDisposed);
121 return 0;
124 void SAL_CALL OGroup::grantPrivileges( const OUString& /*objName*/, sal_Int32 /*objType*/, sal_Int32 /*objPrivileges*/ )
126 ::osl::MutexGuard aGuard(m_aMutex);
127 checkDisposed(OGroup_BASE::rBHelper.bDisposed);
128 throwFeatureNotImplementedSQLException( u"XAuthorizable::grantPrivileges"_ustr, *this );
131 void SAL_CALL OGroup::revokePrivileges( const OUString& /*objName*/, sal_Int32 /*objType*/, sal_Int32 /*objPrivileges*/ )
133 ::osl::MutexGuard aGuard(m_aMutex);
134 checkDisposed(OGroup_BASE::rBHelper.bDisposed);
135 throwFeatureNotImplementedSQLException( u"XAuthorizable::revokePrivileges"_ustr, *this );
138 css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL OGroup::getPropertySetInfo( )
140 return ::cppu::OPropertySetHelper::createPropertySetInfo(getInfoHelper());
143 OUString SAL_CALL OGroup::getName( )
145 return m_Name;
148 void SAL_CALL OGroup::setName( const OUString& /*aName*/ )
150 throwFeatureNotImplementedRuntimeException( u"XNamed::setName"_ustr, *this );
153 // XInterface
154 void SAL_CALL OGroup::acquire() noexcept
156 OGroup_BASE::acquire();
159 void SAL_CALL OGroup::release() noexcept
161 OGroup_BASE::release();
165 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */