LibreOffice Module connectivity (master) 1
Users.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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 */
9
10#include "User.hxx"
11#include "Users.hxx"
12
13using namespace ::connectivity;
14using namespace ::connectivity::firebird;
15using namespace ::connectivity::sdbcx;
16using namespace ::cppu;
17using namespace ::osl;
18using namespace ::com::sun::star;
19using namespace ::com::sun::star::beans;
20using namespace ::com::sun::star::container;
21using namespace ::com::sun::star::lang;
22using namespace ::com::sun::star::sdbc;
23using namespace ::com::sun::star::uno;
24
25
26Users::Users(const uno::Reference< XDatabaseMetaData >& rMetaData,
27 OWeakObject& rParent,
28 Mutex& rMutex,
29 ::std::vector< OUString> const & rNames) :
30 OCollection(rParent,
31 true,
32 rMutex,
33 rNames),
34 m_xMetaData(rMetaData)
35{
36}
37
38//----- OCollection -----------------------------------------------------------
39void Users::impl_refresh()
40{
41 // TODO: IMPLEMENT ME
42}
43
44ObjectType Users::createObject(const OUString& rName)
45{
46 return new User(m_xMetaData->getConnection(), rName);
47}
48
49uno::Reference< XPropertySet > Users::createDescriptor()
50{
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());
55}
56
57//----- XAppend ---------------------------------------------------------------
58ObjectType Users::appendObject(const OUString& rName,
59 const uno::Reference< XPropertySet >&)
60{
61 // TODO: set sSql as appropriate
62 m_xMetaData->getConnection()->createStatement()->execute(OUString());
63
64 return createObject(rName);
65}
66
67//----- XDrop -----------------------------------------------------------------
68void Users::dropObject(sal_Int32 nPosition, const OUString&)
69{
70 uno::Reference< XPropertySet > xUser(getObject(nPosition));
71
72 if (!ODescriptor::isNew(xUser))
73 {
74 // TODO: drop me
75 }
76}
77
78/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
struct _ADOUser User
Definition: Awrapadox.hxx:30
css::uno::Reference< css::beans::XPropertySet > ObjectType
Definition: VCollection.hxx:59