update emoji autocorrect entries from po-files
[LibreOffice.git] / connectivity / source / drivers / firebird / Catalog.cxx
blob613b6d2e970296cb0cf02f88f9d702d063fb8979
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 "Catalog.hxx"
11 #include "Tables.hxx"
12 #include "Users.hxx"
14 using namespace ::connectivity::firebird;
15 using namespace ::com::sun::star;
16 using namespace ::com::sun::star::sdbc;
17 using namespace ::com::sun::star::uno;
19 Catalog::Catalog(const uno::Reference< XConnection >& rConnection):
20 OCatalog(rConnection),
21 m_xConnection(rConnection)
25 //----- OCatalog -------------------------------------------------------------
26 void Catalog::refreshTables()
28 // TODO: set type -- currenty we also get system tables...
29 Sequence< OUString > aTypes(2);
30 aTypes[0] = "TABLE";
31 aTypes[1] = "VIEW";
33 uno::Reference< XResultSet > xTables = m_xMetaData->getTables(Any(),
34 "%",
35 "%",
36 aTypes);
38 if (!xTables.is())
39 return;
41 TStringVector aTableNames;
43 fillNames(xTables, aTableNames);
45 if (!m_pTables)
46 m_pTables = new Tables(m_xConnection->getMetaData(),
47 *this,
48 m_aMutex,
49 aTableNames);
50 else
51 m_pTables->reFill(aTableNames);
55 void Catalog::refreshViews()
57 // TODO: implement me.
58 // Sets m_pViews (OCatalog)
61 //----- IRefreshableGroups ---------------------------------------------------
62 void Catalog::refreshGroups()
64 // TODO: implement me
67 //----- IRefreshableUsers ----------------------------------------------------
68 void Catalog::refreshUsers()
70 OUString sSql("SELECT DISTINCT RDB$USER FROM RDB$USER_PRIVILEGES");
72 uno::Reference< XResultSet > xUsers = m_xMetaData->getConnection()
73 ->createStatement()->executeQuery(sSql);
75 if (!xUsers.is())
76 return;
78 TStringVector aUserNames;
80 uno::Reference< XRow > xRow(xUsers,UNO_QUERY);
81 while (xUsers->next())
83 aUserNames.push_back(xRow->getString(1));
86 if (!m_pUsers)
87 m_pUsers = new Users(m_xConnection->getMetaData(),
88 *this,
89 m_aMutex,
90 aUserNames);
91 else
92 m_pUsers->reFill(aUserNames);
94 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */