Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / dbaccess / source / ui / querydesign / QTableWindow.hxx
blob9947905f6794897659f5b7cd56c5a39f6a93cf4c
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_QUERYDESIGN_QTABLEWINDOW_HXX
20 #define INCLUDED_DBACCESS_SOURCE_UI_QUERYDESIGN_QTABLEWINDOW_HXX
22 #include "TableWindow.hxx"
23 #include "QTableWindowData.hxx"
24 #include "TableFieldDescription.hxx"
26 namespace dbaui
28 class OQueryTableWindow : public OTableWindow
30 sal_Int32 m_nAliasNum;
31 OUString m_strInitialAlias;
32 public:
33 OQueryTableWindow( vcl::Window* pParent, const TTableWindowData::value_type& pTabWinData, sal_Unicode* pszInitialAlias = nullptr );
35 OUString GetAliasName() const
37 return static_cast<OQueryTableWindowData*>(GetData().get())->GetAliasName();
39 void SetAliasName(const OUString& strNewAlias)
41 static_cast<OQueryTableWindowData*>(GetData().get())->SetAliasName(strNewAlias);
44 // late Constructor, the base class CREATES Listbox on first call
45 virtual bool Init() override;
47 bool ExistsField(const OUString& strFieldName, OTableFieldDescRef& rInfo);
48 bool ExistsAVisitedConn() const;
50 virtual OUString GetName() const override { return GetWinName(); }
52 protected:
53 virtual void KeyInput( const KeyEvent& rEvt ) override;
55 virtual void OnEntryDoubleClicked(SvTreeListEntry* pEntry) override;
56 // is called from DoubleClickHdl of the ListBox
57 /** delete the user data with the equal type as created within createUserData
58 @param _pUserData
59 The user data store in the listbox entries. Created with a call to createUserData.
60 _pUserData may be <NULL/>.
62 virtual void deleteUserData(void*& _pUserData) override;
64 /** creates user information that will be append at the ListBoxentry
65 @param _xColumn
66 The corresponding column, can be <NULL/>.
67 @param _bPrimaryKey
68 <TRUE/> when the column belongs to the primary key
69 @return
70 the user data which will be append at the listbox entry, may be <NULL/>
72 virtual void* createUserData(const css::uno::Reference<
73 css::beans::XPropertySet>& _xColumn,
74 bool _bPrimaryKey) override;
77 #endif // INCLUDED_DBACCESS_SOURCE_UI_QUERYDESIGN_QTABLEWINDOW_HXX
79 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */