fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / dbaccess / source / ui / inc / TableGrantCtrl.hxx
bloba7c5af0540e256ff003edb7713135802ad89f9cd
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 .
19 #ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_TABLEGRANTCTRL_HXX
20 #define INCLUDED_DBACCESS_SOURCE_UI_INC_TABLEGRANTCTRL_HXX
22 #include <sal/config.h>
24 #include <map>
26 #include <svtools/editbrowsebox.hxx>
27 #include <com/sun/star/sdbcx/XTablesSupplier.hpp>
28 #include <com/sun/star/sdbcx/XAuthorizable.hpp>
29 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
30 #include "moduledbu.hxx"
32 class Edit;
33 namespace dbaui
36 class OTableGrantControl : public ::svt::EditBrowseBox
38 typedef struct
40 sal_Int32 nRights;
41 sal_Int32 nWithGrant;
42 } TPrivileges;
44 typedef std::map<OUString, TPrivileges> TTablePrivilegeMap;
46 OModuleClient m_aModuleClient;
48 ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > m_xUsers;
49 ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > m_xTables;
50 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext> m_xContext;
51 ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XAuthorizable> m_xGrantUser;
52 ::com::sun::star::uno::Sequence< OUString> m_aTableNames;
54 mutable TTablePrivilegeMap m_aPrivMap;
55 OUString m_sUserName;
56 VclPtr< ::svt::CheckBoxControl> m_pCheckCell;
57 VclPtr<Edit> m_pEdit;
58 long m_nDataPos;
59 ImplSVEvent * m_nDeactivateEvent;
61 public:
62 OTableGrantControl( vcl::Window* pParent, WinBits nBits);
63 virtual ~OTableGrantControl();
64 virtual void dispose() SAL_OVERRIDE;
65 void UpdateTables();
66 void setUserName(const OUString& _sUserName);
67 void setGrantUser(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XAuthorizable>& _xGrantUser);
69 void setTablesSupplier(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XTablesSupplier >& _xTablesSup);
70 void setComponentContext(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>& _rxContext);
72 virtual void Init() SAL_OVERRIDE;
74 // IAccessibleTableProvider
75 /** Creates the accessible object of a data table cell.
76 @param nRow The row index of the cell.
77 @param nColumnId The column ID of the cell.
78 @return The XAccessible interface of the specified cell. */
79 virtual ::com::sun::star::uno::Reference<
80 ::com::sun::star::accessibility::XAccessible >
81 CreateAccessibleCell( sal_Int32 nRow, sal_uInt16 nColumnId ) SAL_OVERRIDE;
83 protected:
84 virtual void Resize() SAL_OVERRIDE;
86 virtual bool PreNotify(NotifyEvent& rNEvt ) SAL_OVERRIDE;
88 virtual bool IsTabAllowed(bool bForward) const SAL_OVERRIDE;
89 virtual void InitController( ::svt::CellControllerRef& rController, long nRow, sal_uInt16 nCol ) SAL_OVERRIDE;
90 virtual ::svt::CellController* GetController( long nRow, sal_uInt16 nCol ) SAL_OVERRIDE;
91 virtual void PaintCell( OutputDevice& rDev, const Rectangle& rRect, sal_uInt16 nColId ) const SAL_OVERRIDE;
92 virtual bool SeekRow( long nRow ) SAL_OVERRIDE;
93 virtual bool SaveModified() SAL_OVERRIDE;
94 virtual OUString GetCellText( long nRow, sal_uInt16 nColId ) const SAL_OVERRIDE;
96 virtual void CellModified() SAL_OVERRIDE;
98 private:
99 DECL_LINK( AsynchActivate, void* );
100 DECL_LINK( AsynchDeactivate, void* );
102 static bool isAllowed(sal_uInt16 _nColumnId,sal_Int32 _nPrivilege);
103 void fillPrivilege(sal_Int32 _nRow) const;
104 TTablePrivilegeMap::const_iterator findPrivilege(sal_Int32 _nRow) const;
109 #endif // INCLUDED_DBACCESS_SOURCE_UI_INC_TABLEGRANTCTRL_HXX
111 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */