1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifndef DBAUI_QUERY_TABLEWINDOW_HXX
28 #define DBAUI_QUERY_TABLEWINDOW_HXX
29 
30 #ifndef DBAUI_TABLEWINDOW_HXX
31 #include "TableWindow.hxx"
32 #endif
33 #ifndef DBAUI_QUERY_TABLEWINDOWDATA_HXX
34 #include "QTableWindowData.hxx"
35 #endif
36 #ifndef DBAUI_TABLEFIELDDESC_HXX
37 #include "TableFieldDescription.hxx"
38 #endif
39 #ifndef _RTTI_HXX
40 #include <tools/rtti.hxx>
41 #endif
42 
43 namespace dbaui
44 {
45 	//==================================================================
46 	class OQueryTableWindow : public OTableWindow
47 	{
48 		sal_Int32			m_nAliasNum;
49 		::rtl::OUString		m_strInitialAlias;
50 	public:
51 		OQueryTableWindow( Window* pParent, const TTableWindowData::value_type& pTabWinData, sal_Unicode* pszInitialAlias = NULL );
52 		virtual ~OQueryTableWindow();
53 
54 		::rtl::OUString	GetAliasName() const
55 		{
56 			return static_cast<OQueryTableWindowData*>(GetData().get())->GetAliasName();
57 		}
58 		void			SetAliasName(const ::rtl::OUString& strNewAlias)
59 		{
60 			static_cast<OQueryTableWindowData*>(GetData().get())->SetAliasName(strNewAlias);
61 		}
62 
63 		// spaeter Constructor, die Basisklasse ERZEUGT beim ersten Aufruf die Listbox
64 		virtual sal_Bool	Init();
65 
66 		inline sal_Int32		GetAliasNum() const	{ return m_nAliasNum; }
67 
68 		sal_Bool			ExistsField(const ::rtl::OUString& strFieldName, OTableFieldDescRef& rInfo);
69 		sal_Bool			ExistsAVisitedConn() const;
70 
71 		virtual ::rtl::OUString		GetName() const { return GetWinName(); }
72 
73 	protected:
74 		virtual void	KeyInput( const KeyEvent& rEvt );
75 
76 		virtual void	OnEntryDoubleClicked(SvLBoxEntry* pEntry);
77 			// wird aus dem DoubleClickHdl der ListBox heraus aufgerufen
78 		/** delete the user data with the equal type as created within createUserData
79 			@param	_pUserData
80 				The user data store in the listbox entries. Created with a call to createUserData.
81 				_pUserData may be <NULL/>.
82 		*/
83 		virtual void deleteUserData(void*& _pUserData);
84 
85 		/** creates user information that will be append at the ListBoxentry
86 			@param	_xColumn
87 				The corresponding column, can be <NULL/>.
88 			@param	_bPrimaryKey
89 				<TRUE/> when the column belongs to the primary key
90 			@return
91 				the user data which will be append at the listbox entry, may be <NULL/>
92 		*/
93 		virtual void* createUserData(const ::com::sun::star::uno::Reference<
94 									::com::sun::star::beans::XPropertySet>& _xColumn,
95 									bool _bPrimaryKey);
96 	};
97 }
98 #endif // DBAUI_QUERY_TABLEWINDOW_HXX
99 
100 
101