1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
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/.
13 using namespace ::connectivity
;
14 using namespace ::connectivity::firebird
;
15 using namespace ::connectivity::sdbcx
;
16 using namespace ::cppu
;
17 using namespace ::osl
;
18 using namespace ::com::sun::star
;
19 using namespace ::com::sun::star::beans
;
20 using namespace ::com::sun::star::container
;
21 using namespace ::com::sun::star::lang
;
22 using namespace ::com::sun::star::sdbc
;
23 using namespace ::com::sun::star::uno
;
26 Users::Users(const uno::Reference
< XDatabaseMetaData
>& rMetaData
,
29 ::std::vector
< OUString
> const & rNames
) :
34 m_xMetaData(rMetaData
)
38 //----- OCollection -----------------------------------------------------------
39 void Users::impl_refresh()
44 ObjectType
Users::createObject(const OUString
& rName
)
46 return new User(m_xMetaData
->getConnection(), rName
);
49 uno::Reference
< XPropertySet
> Users::createDescriptor()
51 // There is some internal magic so that the same class can be used as either
52 // a descriptor or as a normal user. See VUser.cxx for the details. In our
53 // case we just need to ensure we use the correct constructor.
54 return new User(m_xMetaData
->getConnection());
57 //----- XAppend ---------------------------------------------------------------
58 ObjectType
Users::appendObject(const OUString
& rName
,
59 const uno::Reference
< XPropertySet
>&)
61 // TODO: set sSql as appropriate
62 m_xMetaData
->getConnection()->createStatement()->execute(OUString());
64 return createObject(rName
);
67 //----- XDrop -----------------------------------------------------------------
68 void Users::dropObject(sal_Int32 nPosition
, const OUString
&)
70 uno::Reference
< XPropertySet
> xUser(getObject(nPosition
));
72 if (!ODescriptor::isNew(xUser
))
78 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */