Version 4.3.0.0.beta1, tag libreoffice-4.3.0.0.beta1
[LibreOffice.git] / connectivity / source / drivers / firebird / Users.cxx
blobe95cbb7cbe0a056ec0de7e9f2defaa0950b5df93
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/.
8 */
10 #include "User.hxx"
11 #include "Users.hxx"
13 #include <connectivity/dbtools.hxx>
15 #include <com/sun/star/sdbc/XRow.hpp>
17 using namespace ::connectivity;
18 using namespace ::connectivity::firebird;
19 using namespace ::connectivity::sdbcx;
20 using namespace ::cppu;
21 using namespace ::osl;
22 using namespace ::rtl;
24 using namespace ::com::sun::star;
25 using namespace ::com::sun::star::beans;
26 using namespace ::com::sun::star::container;
27 using namespace ::com::sun::star::lang;
28 using namespace ::com::sun::star::sdbc;
29 using namespace ::com::sun::star::uno;
32 Users::Users(const uno::Reference< XDatabaseMetaData >& rMetaData,
33 OWeakObject& rParent,
34 Mutex& rMutex,
35 TStringVector& rNames) :
36 OCollection(rParent,
37 true,
38 rMutex,
39 rNames),
40 m_xMetaData(rMetaData)
44 //----- OCollection -----------------------------------------------------------
45 void Users::impl_refresh()
46 throw(RuntimeException)
48 // TODO: IMPLEMENT ME
51 ObjectType Users::createObject(const OUString& rName)
53 return new User(m_xMetaData->getConnection(), rName);
56 uno::Reference< XPropertySet > Users::createDescriptor()
58 // There is some internal magic so that the same class can be used as either
59 // a descriptor or as a normal user. See VUser.cxx for the details. In our
60 // case we just need to ensure we use the correct constructor.
61 return new User(m_xMetaData->getConnection());
64 //----- XAppend ---------------------------------------------------------------
65 ObjectType Users::appendObject(const OUString& rName,
66 const uno::Reference< XPropertySet >& rDescriptor)
68 // TODO: set sSql as appropriate
69 (void) rName;
70 (void) rDescriptor;
71 OUString sSql;
72 m_xMetaData->getConnection()->createStatement()->execute(sSql);
74 return createObject(rName);
77 //----- XDrop -----------------------------------------------------------------
78 void Users::dropObject(sal_Int32 nPosition, const OUString& sName)
80 uno::Reference< XPropertySet > xUser(getObject(nPosition));
82 if (!ODescriptor::isNew(xUser))
84 (void) sName;
85 // TODO: drop me
89 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */