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_QUERY_TABLEWINDOW_HXX 24 #define DBAUI_QUERY_TABLEWINDOW_HXX 25 26 #ifndef DBAUI_TABLEWINDOW_HXX 27 #include "TableWindow.hxx" 28 #endif 29 #ifndef DBAUI_QUERY_TABLEWINDOWDATA_HXX 30 #include "QTableWindowData.hxx" 31 #endif 32 #ifndef DBAUI_TABLEFIELDDESC_HXX 33 #include "TableFieldDescription.hxx" 34 #endif 35 #ifndef _RTTI_HXX 36 #include <tools/rtti.hxx> 37 #endif 38 39 namespace dbaui 40 { 41 //================================================================== 42 class OQueryTableWindow : public OTableWindow 43 { 44 sal_Int32 m_nAliasNum; 45 ::rtl::OUString m_strInitialAlias; 46 public: 47 OQueryTableWindow( Window* pParent, const TTableWindowData::value_type& pTabWinData, sal_Unicode* pszInitialAlias = NULL ); 48 virtual ~OQueryTableWindow(); 49 GetAliasName() const50 ::rtl::OUString GetAliasName() const 51 { 52 return static_cast<OQueryTableWindowData*>(GetData().get())->GetAliasName(); 53 } SetAliasName(const::rtl::OUString & strNewAlias)54 void SetAliasName(const ::rtl::OUString& strNewAlias) 55 { 56 static_cast<OQueryTableWindowData*>(GetData().get())->SetAliasName(strNewAlias); 57 } 58 59 // spaeter Constructor, die Basisklasse ERZEUGT beim ersten Aufruf die Listbox 60 virtual sal_Bool Init(); 61 GetAliasNum() const62 inline sal_Int32 GetAliasNum() const { return m_nAliasNum; } 63 64 sal_Bool ExistsField(const ::rtl::OUString& strFieldName, OTableFieldDescRef& rInfo); 65 sal_Bool ExistsAVisitedConn() const; 66 GetName() const67 virtual ::rtl::OUString GetName() const { return GetWinName(); } 68 69 protected: 70 virtual void KeyInput( const KeyEvent& rEvt ); 71 72 virtual void OnEntryDoubleClicked(SvLBoxEntry* pEntry); 73 // wird aus dem DoubleClickHdl der ListBox heraus aufgerufen 74 /** delete the user data with the equal type as created within createUserData 75 @param _pUserData 76 The user data store in the listbox entries. Created with a call to createUserData. 77 _pUserData may be <NULL/>. 78 */ 79 virtual void deleteUserData(void*& _pUserData); 80 81 /** creates user information that will be append at the ListBoxentry 82 @param _xColumn 83 The corresponding column, can be <NULL/>. 84 @param _bPrimaryKey 85 <TRUE/> when the column belongs to the primary key 86 @return 87 the user data which will be append at the listbox entry, may be <NULL/> 88 */ 89 virtual void* createUserData(const ::com::sun::star::uno::Reference< 90 ::com::sun::star::beans::XPropertySet>& _xColumn, 91 bool _bPrimaryKey); 92 }; 93 } 94 #endif // DBAUI_QUERY_TABLEWINDOW_HXX 95 96 97