xref: /aoo42x/main/dbaccess/source/ui/dlg/UserAdmin.hxx (revision 2e2212a7)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef DBAUI_USERADMIN_HXX
24 #define DBAUI_USERADMIN_HXX
25 
26 #ifndef _SV_FIXED_HXX
27 #include <vcl/fixed.hxx>
28 #endif
29 #ifndef _SV_FIELD_HXX
30 #include <vcl/field.hxx>
31 #endif
32 #ifndef _SV_LSTBOX_HXX
33 #include <vcl/lstbox.hxx>
34 #endif
35 #ifndef _SV_BUTTON_HXX
36 #include <vcl/button.hxx>
37 #endif
38 #ifndef _SV_DIALOG_HXX
39 #include <vcl/dialog.hxx>
40 #endif
41 #ifndef _SV_GROUP_HXX
42 #include <vcl/group.hxx>
43 #endif
44 #ifndef DBAUI_TABLEGRANTCONTROL_HXX
45 #include "TableGrantCtrl.hxx"
46 #endif
47 #ifndef _DBAUI_ADMINPAGES_HXX_
48 #include "adminpages.hxx"
49 #endif
50 #ifndef _COMPHELPER_UNO3_HXX_
51 #include <comphelper/uno3.hxx>
52 #endif
53 
54 FORWARD_DECLARE_INTERFACE(beans,XPropertySet)
55 FORWARD_DECLARE_INTERFACE(sdbc,XConnection)
56 FORWARD_DECLARE_INTERFACE(lang,XMultiServiceFactory)
57 
58 namespace dbaui
59 {
60 
61 class OUserAdmin : public OGenericAdministrationPage
62 {
63 protected:
64 	FixedLine			m_FL_USER;
65 	FixedText			m_FT_USER;
66 	ListBox				m_LB_USER;
67 	PushButton			m_PB_NEWUSER;
68 	PushButton			m_PB_CHANGEPWD;
69 	PushButton			m_PB_DELETEUSER;
70 	FixedLine			m_FL_TABLE_GRANTS;
71 	OTableGrantControl	m_TableCtrl; // show the grant rights of one user
72 
73 	::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>			m_xConnection;
74 	::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >	m_xUsers;
75 	::com::sun::star::uno::Sequence< ::rtl::OUString>								m_aUserNames;
76 
77 	String				m_UserName;
78 
79 	// methods
80 	DECL_LINK( ListDblClickHdl, ListBox * );
81 	DECL_LINK( CloseHdl,		PushButton * );
82 	DECL_LINK( UserHdl,			PushButton * );
83 
84 	void		FillUserNames();
85 
86 	OUserAdmin( Window* pParent, const SfxItemSet& _rCoreAttrs);
87 public:
88 	static	SfxTabPage*	Create( Window* pParent, const SfxItemSet& _rAttrSet );
89 
90 	~OUserAdmin();
91 	String GetUser();
92 
93 	// must be overloaded by subclasses, but it isn't pure virtual
94 	virtual void implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue);
95 
96 	// <method>OGenericAdministrationPage::fillControls</method>
97 	virtual void fillControls(::std::vector< ISaveValueWrapper* >& _rControlList);
98 
99 	// <method>OGenericAdministrationPage::fillWindows</method>
100 	virtual void fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList);
101 };
102 }
103 #endif // DBAUI_USERADMIN_HXX
104