2010-10-27 12:33:13 +01:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2001-02-28 09:09:17 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-10 14:19:25 +00:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2001-02-28 09:09:17 +00:00
|
|
|
*
|
2010-02-12 15:01:35 +01:00
|
|
|
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
2001-02-28 09:09:17 +00:00
|
|
|
*
|
2008-04-10 14:19:25 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2001-02-28 09:09:17 +00:00
|
|
|
*
|
2008-04-10 14:19:25 +00:00
|
|
|
* This file is part of OpenOffice.org.
|
2001-02-28 09:09:17 +00:00
|
|
|
*
|
2008-04-10 14:19:25 +00:00
|
|
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
* only, as published by the Free Software Foundation.
|
2001-02-28 09:09:17 +00:00
|
|
|
*
|
2008-04-10 14:19:25 +00:00
|
|
|
* OpenOffice.org is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License version 3 for more details
|
|
|
|
* (a copy is included in the LICENSE file that accompanied this code).
|
2001-02-28 09:09:17 +00:00
|
|
|
*
|
2008-04-10 14:19:25 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* version 3 along with OpenOffice.org. If not, see
|
|
|
|
* <http://www.openoffice.org/license.html>
|
|
|
|
* for a copy of the LGPLv3 License.
|
2001-02-28 09:09:17 +00:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
#ifndef DBAUI_TABLEWINDOW_HXX
|
|
|
|
#define DBAUI_TABLEWINDOW_HXX
|
|
|
|
|
|
|
|
#include <com/sun/star/container/XNameAccess.hpp>
|
|
|
|
#include <com/sun/star/beans/XPropertySet.hpp>
|
|
|
|
#include "TableWindowTitle.hxx"
|
|
|
|
#include <tools/rtti.hxx>
|
2008-10-01 12:28:29 +00:00
|
|
|
#include <rtl/ref.hxx>
|
2001-02-28 09:09:17 +00:00
|
|
|
#include "TableWindowData.hxx"
|
|
|
|
#include <vector>
|
|
|
|
#include <vcl/window.hxx>
|
2008-10-01 12:28:29 +00:00
|
|
|
|
|
|
|
#include <comphelper/containermultiplexer.hxx>
|
|
|
|
#include "cppuhelper/basemutex.hxx"
|
2001-02-28 09:09:17 +00:00
|
|
|
|
|
|
|
class SvLBoxEntry;
|
|
|
|
namespace dbaui
|
|
|
|
{
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
// Flags fuer die Groessenanpassung der SbaJoinTabWins
|
2011-01-14 15:00:11 +01:00
|
|
|
const sal_uInt16 SIZING_NONE = 0x0000;
|
|
|
|
const sal_uInt16 SIZING_TOP = 0x0001;
|
|
|
|
const sal_uInt16 SIZING_BOTTOM = 0x0002;
|
|
|
|
const sal_uInt16 SIZING_LEFT = 0x0004;
|
|
|
|
const sal_uInt16 SIZING_RIGHT = 0x0008;
|
2001-02-28 09:09:17 +00:00
|
|
|
|
|
|
|
class OTableWindowListBox;
|
|
|
|
class OJoinDesignView;
|
|
|
|
class OJoinTableView;
|
2003-06-25 10:03:39 +00:00
|
|
|
class OTableWindowAccess;
|
2001-02-28 09:09:17 +00:00
|
|
|
|
2008-10-01 12:28:29 +00:00
|
|
|
class OTableWindow : public ::cppu::BaseMutex
|
|
|
|
,public ::comphelper::OContainerListener
|
|
|
|
,public Window
|
2001-02-28 09:09:17 +00:00
|
|
|
{
|
|
|
|
friend class OTableWindowTitle;
|
|
|
|
friend class OTableWindowListBox;
|
|
|
|
protected:
|
|
|
|
// und die Tabelle selber (brauche ich, da ich sie locken will, solange das Fenster lebt)
|
2006-12-13 15:51:37 +00:00
|
|
|
FixedImage m_aTypeImage;
|
2001-02-28 09:09:17 +00:00
|
|
|
OTableWindowTitle m_aTitle;
|
|
|
|
OTableWindowListBox* m_pListBox;
|
2003-06-25 10:03:39 +00:00
|
|
|
OTableWindowAccess* m_pAccessible;
|
2002-06-27 07:23:50 +00:00
|
|
|
|
2001-02-28 09:09:17 +00:00
|
|
|
private:
|
2007-11-01 14:19:13 +00:00
|
|
|
TTableWindowData::value_type
|
|
|
|
m_pData;
|
2008-10-01 12:28:29 +00:00
|
|
|
::rtl::Reference< comphelper::OContainerListenerAdapter>
|
|
|
|
m_pContainerListener;
|
2002-02-06 06:44:03 +00:00
|
|
|
sal_Int32 m_nMoveCount; // how often the arrow keys was pressed
|
|
|
|
sal_Int32 m_nMoveIncrement; // how many pixel we should move
|
2011-01-14 15:00:11 +01:00
|
|
|
sal_uInt16 m_nSizingFlags;
|
|
|
|
sal_Bool m_bActive;
|
2001-02-28 09:09:17 +00:00
|
|
|
|
|
|
|
void Draw3DBorder( const Rectangle& rRect );
|
2008-10-01 12:28:29 +00:00
|
|
|
// OContainerListener
|
|
|
|
virtual void _elementInserted( const ::com::sun::star::container::ContainerEvent& _rEvent ) throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
virtual void _elementRemoved( const ::com::sun::star::container::ContainerEvent& _rEvent ) throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
virtual void _elementReplaced( const ::com::sun::star::container::ContainerEvent& _rEvent ) throw(::com::sun::star::uno::RuntimeException);
|
2001-02-28 09:09:17 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void Resize();
|
|
|
|
virtual void Paint( const Rectangle& rRect );
|
|
|
|
virtual void MouseMove( const MouseEvent& rEvt );
|
|
|
|
virtual void MouseButtonDown( const MouseEvent& rEvt );
|
|
|
|
virtual void DataChanged( const DataChangedEvent& rDCEvt );
|
|
|
|
|
|
|
|
virtual OTableWindowListBox* CreateListBox();
|
|
|
|
// wird im ERSTEN Init aufgerufen
|
2011-01-14 15:00:11 +01:00
|
|
|
sal_Bool FillListBox();
|
2001-02-28 09:09:17 +00:00
|
|
|
// wird in JEDEM Init aufgerufen
|
|
|
|
|
2006-06-20 02:14:23 +00:00
|
|
|
virtual void OnEntryDoubleClicked(SvLBoxEntry* /*pEntry*/) { }
|
2001-02-28 09:09:17 +00:00
|
|
|
// wird aus dem DoubleClickHdl der ListBox heraus aufgerufen
|
|
|
|
|
2002-05-22 10:16:34 +00:00
|
|
|
/** HandleKeyInput triues to handle the KeyEvent. Movement or deletion
|
|
|
|
@param rEvt
|
|
|
|
The KEyEvent
|
|
|
|
@return
|
|
|
|
<TRUE/> when the table could handle the keyevent.
|
|
|
|
*/
|
2011-01-14 15:00:11 +01:00
|
|
|
sal_Bool HandleKeyInput( const KeyEvent& rEvt );
|
2002-06-27 07:23:50 +00:00
|
|
|
|
|
|
|
/** delete the user data with the equal type as created within createUserData
|
|
|
|
@param _pUserData
|
|
|
|
The user data store in the listbox entries. Created with a call to createUserData.
|
|
|
|
_pUserData may be <NULL/>. _pUserData will be set to <NULL/> after call.
|
|
|
|
*/
|
|
|
|
virtual void deleteUserData(void*& _pUserData);
|
|
|
|
|
|
|
|
/** creates user information that will be append at the ListBoxentry
|
|
|
|
@param _xColumn
|
|
|
|
The corresponding column, can be <NULL/>.
|
|
|
|
@param _bPrimaryKey
|
|
|
|
<TRUE/> when the column belongs to the primary key
|
|
|
|
@return
|
|
|
|
the user data which will be append at the listbox entry, may be <NULL/>
|
|
|
|
*/
|
|
|
|
virtual void* createUserData(const ::com::sun::star::uno::Reference<
|
|
|
|
::com::sun::star::beans::XPropertySet>& _xColumn,
|
|
|
|
bool _bPrimaryKey);
|
2002-11-08 08:27:59 +00:00
|
|
|
|
2006-12-13 15:51:37 +00:00
|
|
|
/** updates m_aTypeImage
|
|
|
|
*/
|
|
|
|
void impl_updateImage();
|
|
|
|
|
2007-11-01 14:19:13 +00:00
|
|
|
OTableWindow( Window* pParent, const TTableWindowData::value_type& pTabWinData );
|
2006-07-10 14:29:38 +00:00
|
|
|
|
2001-02-28 09:09:17 +00:00
|
|
|
public:
|
|
|
|
virtual ~OTableWindow();
|
|
|
|
|
|
|
|
// spaeter Constructor, siehe auch CreateListbox und FillListbox
|
2011-01-14 15:00:11 +01:00
|
|
|
virtual sal_Bool Init();
|
2001-02-28 09:09:17 +00:00
|
|
|
|
|
|
|
OJoinTableView* getTableView();
|
|
|
|
const OJoinTableView* getTableView() const;
|
|
|
|
OJoinDesignView* getDesignView();
|
|
|
|
void SetPosPixel( const Point& rNewPos );
|
|
|
|
void SetSizePixel( const Size& rNewSize );
|
|
|
|
void SetPosSizePixel( const Point& rNewPos, const Size& rNewSize );
|
|
|
|
|
2002-02-08 07:56:33 +00:00
|
|
|
String getTitle() const;
|
2011-01-14 15:00:11 +01:00
|
|
|
void SetBoldTitle( sal_Bool bBold );
|
2001-11-09 11:20:17 +00:00
|
|
|
void setActive(sal_Bool _bActive = sal_True);
|
2001-02-28 09:09:17 +00:00
|
|
|
|
|
|
|
void Remove();
|
2011-01-14 15:00:11 +01:00
|
|
|
sal_Bool IsActiveWindow(){ return m_bActive; }
|
2001-02-28 09:09:17 +00:00
|
|
|
|
|
|
|
::rtl::OUString GetTableName() const { return m_pData->GetTableName(); }
|
|
|
|
::rtl::OUString GetWinName() const { return m_pData->GetWinName(); }
|
|
|
|
::rtl::OUString GetComposedName() const { return m_pData->GetComposedName(); }
|
|
|
|
OTableWindowListBox* GetListBox() const { return m_pListBox; }
|
2007-11-01 14:19:13 +00:00
|
|
|
TTableWindowData::value_type GetData() const { return m_pData; }
|
2002-11-26 11:47:48 +00:00
|
|
|
OTableWindowTitle* GetTitleCtrl() { return &m_aTitle; }
|
2002-11-08 08:27:59 +00:00
|
|
|
|
|
|
|
/** returns the name which should be used when displaying join or relations
|
|
|
|
@return
|
|
|
|
The composed name or the window name.
|
|
|
|
*/
|
|
|
|
virtual ::rtl::OUString GetName() const = 0;
|
2006-07-10 14:29:38 +00:00
|
|
|
|
2007-11-01 14:19:13 +00:00
|
|
|
inline ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > GetOriginalColumns() const { return m_pData->getColumns(); }
|
|
|
|
inline ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > GetTable() const { return m_pData->getTable(); }
|
2001-02-28 09:09:17 +00:00
|
|
|
|
2011-01-14 15:00:11 +01:00
|
|
|
sal_uInt16 GetSizingFlags() const { return m_nSizingFlags; }
|
2002-06-24 06:49:59 +00:00
|
|
|
/** set the sizing flag to the direction
|
|
|
|
@param _rPos
|
|
|
|
The EndPosition after resizing.
|
|
|
|
*/
|
|
|
|
void setSizingFlag(const Point& _rPos);
|
|
|
|
/** set the rsizing flag to NONE.
|
|
|
|
*/
|
|
|
|
void resetSizingFlag() { m_nSizingFlags = SIZING_NONE; }
|
|
|
|
|
|
|
|
/** returns the new sizing
|
|
|
|
*/
|
|
|
|
Rectangle getSizingRect(const Point& _rPos,const Size& _rOutputSize) const;
|
2001-02-28 09:09:17 +00:00
|
|
|
|
|
|
|
// window override
|
|
|
|
virtual void StateChanged( StateChangedType nStateChange );
|
|
|
|
virtual void GetFocus();
|
2002-02-06 06:44:03 +00:00
|
|
|
virtual long PreNotify( NotifyEvent& rNEvt );
|
|
|
|
virtual void Command(const CommandEvent& rEvt);
|
|
|
|
|
|
|
|
// Accessibility
|
2003-04-24 16:21:23 +00:00
|
|
|
virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible();
|
2001-02-28 09:09:17 +00:00
|
|
|
|
|
|
|
// habe ich Connections nach aussen ?
|
2011-01-14 15:00:11 +01:00
|
|
|
sal_Bool ExistsAConn() const;
|
2001-02-28 09:09:17 +00:00
|
|
|
|
2006-07-10 14:29:38 +00:00
|
|
|
void EnumValidFields(::std::vector< ::rtl::OUString>& arrstrFields);
|
2001-06-28 13:26:45 +00:00
|
|
|
|
2002-06-27 07:23:50 +00:00
|
|
|
/** clears the listbox inside. Must be called be the dtor is called.
|
|
|
|
*/
|
|
|
|
void clearListBox();
|
2006-06-20 02:14:23 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
using Window::SetPosSizePixel;
|
2001-02-28 09:09:17 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
#endif //DBAUI_TABLEWINDOW_HXX
|
|
|
|
|
|
|
|
|
2010-10-27 12:33:13 +01:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|