summaryrefslogtreecommitdiff
path: root/dbaccess/source/ui
diff options
context:
space:
mode:
authorOcke Janssen <oj@openoffice.org>2001-07-06 08:57:16 +0000
committerOcke Janssen <oj@openoffice.org>2001-07-06 08:57:16 +0000
commit299cb94b8d6d5a41ea2e9b263c3e61fc56d66dbc (patch)
treed15f3e2bb892097075bb30b9c7022267fe221146 /dbaccess/source/ui
parent97f63da51efde8a0492a4dfc480991411698b78c (diff)
#89181# TF_SVDATA
Diffstat (limited to 'dbaccess/source/ui')
-rw-r--r--dbaccess/source/ui/inc/JoinTableView.hxx24
-rw-r--r--dbaccess/source/ui/inc/QueryTableView.hxx8
-rw-r--r--dbaccess/source/ui/querydesign/JoinTableView.cxx95
-rw-r--r--dbaccess/source/ui/querydesign/QueryTableView.cxx132
-rw-r--r--dbaccess/source/ui/querydesign/TableWindowListBox.cxx6
5 files changed, 46 insertions, 219 deletions
diff --git a/dbaccess/source/ui/inc/JoinTableView.hxx b/dbaccess/source/ui/inc/JoinTableView.hxx
index 08211a0ea74e..dafd30915a8c 100644
--- a/dbaccess/source/ui/inc/JoinTableView.hxx
+++ b/dbaccess/source/ui/inc/JoinTableView.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: JoinTableView.hxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: oj $ $Date: 2001-06-28 14:26:45 $
+ * last change: $Author: oj $ $Date: 2001-07-06 09:55:43 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -79,8 +79,12 @@
#ifndef _COMPHELPER_STLTYPES_HXX_
#include <comphelper/stl_types.hxx>
#endif
+#ifndef _DBACCESS_UI_CALLBACKS_HXX_
+#include "callbacks.hxx"
+#endif
-
+struct AcceptDropEvent;
+struct ExecuteDropEvent;
namespace dbaui
{
class OTableConnection;
@@ -123,7 +127,8 @@ namespace dbaui
};
- class OJoinTableView : public Window
+ class OJoinTableView : public Window
+ ,public IDragTransferableListener
{
public:
DECLARE_STL_USTRINGACCESS_MAP(OTableWindow*,OTableWindowMap);
@@ -218,6 +223,11 @@ namespace dbaui
virtual BOOL IsAddAllowed();
virtual long PreNotify(NotifyEvent& rNEvt);
+ // DnD stuff
+ virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel );
+ virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt );
+ virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt );
+
protected:
virtual void MouseButtonUp( const MouseEvent& rEvt );
virtual void MouseButtonDown( const MouseEvent& rEvt );
@@ -229,8 +239,10 @@ namespace dbaui
virtual void DataChanged( const DataChangedEvent& rDCEvt );
virtual void Resize();
- virtual BOOL Drop( const DropEvent& rEvt );
- virtual BOOL QueryDrop( DropEvent& rEvt );
+
+ virtual void dragFinished( );
+// virtual BOOL Drop( const DropEvent& rEvt );
+// virtual BOOL QueryDrop( DropEvent& rEvt );
// wird nach Verschieben/Groessenaenderung der TabWins aufgerufen (die Standardimplementation reicht die neuen Daten einfach
// an die Daten des Wins weiter)
diff --git a/dbaccess/source/ui/inc/QueryTableView.hxx b/dbaccess/source/ui/inc/QueryTableView.hxx
index c1f27aa3bcca..330005d0b37c 100644
--- a/dbaccess/source/ui/inc/QueryTableView.hxx
+++ b/dbaccess/source/ui/inc/QueryTableView.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: QueryTableView.hxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: oj $ $Date: 2001-04-30 13:03:02 $
+ * last change: $Author: oj $ $Date: 2001-07-06 09:55:43 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -158,10 +158,6 @@ namespace dbaui
// eine neu Connection bekanntgeben und einfuegen lassen, wenn nicht schon existent
void NotifyTabConnection(const OQueryTableConnection& rNewConn, BOOL _bCreateUndoAction = TRUE);
- // fuer Droppen von Tabellen
- BOOL Drop(const DropEvent& rEvt);
- BOOL QueryDrop(DropEvent& rEvt);
-
Link SetTabWinsChangeHandler(const Link& lnk) { Link lnkRet = m_lnkTabWinsChangeHandler; m_lnkTabWinsChangeHandler = lnk; return lnkRet; }
// der Handler bekommt einen Zeiger auf eine TabWinsChangeNotification-Struktur
diff --git a/dbaccess/source/ui/querydesign/JoinTableView.cxx b/dbaccess/source/ui/querydesign/JoinTableView.cxx
index e782ae596595..872474a1b5bb 100644
--- a/dbaccess/source/ui/querydesign/JoinTableView.cxx
+++ b/dbaccess/source/ui/querydesign/JoinTableView.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: JoinTableView.cxx,v $
*
- * $Revision: 1.10 $
+ * $Revision: 1.11 $
*
- * last change: $Author: oj $ $Date: 2001-06-28 14:22:47 $
+ * last change: $Author: oj $ $Date: 2001-07-06 09:55:40 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -100,9 +100,11 @@
#ifndef DBACCESS_UI_BROWSER_ID_HXX
#include "browserids.hxx"
#endif
+#ifndef TF_SVDATA
#ifndef _SV_DRAG_HXX
#include <vcl/drag.hxx>
#endif
+#endif // TF_SVDATA
#ifndef _URLBMK_HXX
#include <svtools/urlbmk.hxx>
#endif
@@ -280,80 +282,6 @@ void OJoinTableView::Resize()
pCurrent->SetPosPixel(aPos);
}
}
-
-//------------------------------------------------------------------------------
-BOOL OJoinTableView::Drop( const DropEvent& rEvt )
-{
- DBG_CHKTHIS(OJoinTableView,NULL);
- BOOL bDrop = FALSE;
-/*
- //////////////////////////////////////////////////////////////////////
- // Nach dem richtigen Format suchen
- for(USHORT i = 0; i < DragServer::GetItemCount(); ++i)
- {
- if (INetBookmark::DragServerHasFormat(i) )
- {
- INetBookmark aBmk;
- if (aBmk.PasteDragServer(i))
- {
- //////////////////////////////////////////////////////////////////////
- // Tabellenname aus URL-Obj holen
- INetURLObject aObj(aBmk.GetURL());
- aObj.SetSmartProtocol(INET_PROT_FILE);
- String aMark(aObj.GetMark());
- aMark.Erase(0, strlen(char(11)));
-
- //////////////////////////////////////////////////////////////////////
- // Stammt die Tabelle aus derselben Datenbank?
- String aDatabaseName = aObj.PathToFileName();
- DirEntry aDBEntry(aDatabaseName);
- SbaDatabase* pDatabase = GetDatabase();
- if (aDBEntry == DirEntry(pDatabase->Name()))
- {
- //////////////////////////////////////////////////////////////////////
- // Neue Tabelle hinzufuegen
- SbaDBDefRef xDef = pDatabase->OpenDBDef( dbTable, aMark );
- if (xDef.Is())
- {
- SdbTable* pTable = ((SbaTableDef*)&xDef)->GetTable();
- if (pTable && pTable->IsOpen())
- {
- AddTabWin( pTable->QualifierName(), pTable->Name() );
- bDrop = TRUE;
- }
- }
- }
-
- if (!bDrop)
- Sound::Beep();
- break;
- }
- }
- }
-*/
- return bDrop;
-}
-
-//------------------------------------------------------------------------------
-BOOL OJoinTableView::QueryDrop( DropEvent& rEvt )
-{
- DBG_CHKTHIS(OJoinTableView,NULL);
- //////////////////////////////////////////////////////////////////////
- // Wenn Bookmark-Format, Drop erlaubt
- BOOL bDrop = FALSE;
- DropAction eAction = rEvt.GetAction();
-
- for (USHORT i = 0; i < DragServer::GetItemCount(); ++i)
- {
- if (INetBookmark::DragServerHasFormat(i) && eAction != DROP_MOVE)
- {
- bDrop = TRUE;
- break;
- }
- }
- return bDrop;
-}
-
//------------------------------------------------------------------------------
ULONG OJoinTableView::GetTabWinCount()
{
@@ -1568,6 +1496,20 @@ void OJoinTableView::HideTabWins()
}
// -----------------------------------------------------------------------------
+sal_Int8 OJoinTableView::AcceptDrop( const AcceptDropEvent& _rEvt )
+{
+ return DND_ACTION_NONE;
+}
+// -----------------------------------------------------------------------------
+sal_Int8 OJoinTableView::ExecuteDrop( const ExecuteDropEvent& _rEvt )
+{
+ return DND_ACTION_NONE;
+}
+// -----------------------------------------------------------------------------
+void OJoinTableView::dragFinished( )
+{
+}
+//------------------------------------------------------------------------------
void OJoinTableView::clearLayoutInformation()
{
//////////////////////////////////////////////////////////////////////
@@ -1588,4 +1530,3 @@ void OJoinTableView::clearLayoutInformation()
-
diff --git a/dbaccess/source/ui/querydesign/QueryTableView.cxx b/dbaccess/source/ui/querydesign/QueryTableView.cxx
index d4f0a69070cb..70a6e5a7044a 100644
--- a/dbaccess/source/ui/querydesign/QueryTableView.cxx
+++ b/dbaccess/source/ui/querydesign/QueryTableView.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: QueryTableView.cxx,v $
*
- * $Revision: 1.11 $
+ * $Revision: 1.12 $
*
- * last change: $Author: oj $ $Date: 2001-06-28 14:22:47 $
+ * last change: $Author: oj $ $Date: 2001-07-06 09:57:16 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -193,7 +193,9 @@ OQueryTableView::OQueryTableView( Window* pParent,OQueryDesignView* pView)
{
DBG_CTOR(OQueryTableView,NULL);
SetHelpId(HID_CTL_QRYDGNTAB);
+#ifndef TF_SVDATA
EnableDrop();
+#endif // TF_SVDATA
}
//------------------------------------------------------------------------
@@ -1065,132 +1067,6 @@ void OQueryTableView::InsertField(const OTableFieldDesc& rInfo)
DBG_ASSERT(getDesignView() != NULL, "OQueryTableView::InsertField : habe kein Parent !");
static_cast<OQueryDesignView*>(getDesignView())->InsertField(rInfo);
}
-
-//------------------------------------------------------------------------------
-sal_Bool OQueryTableView::Drop(const DropEvent& rEvt)
-{
- DBG_CHKTHIS(OQueryTableView,NULL);
- sal_Bool bDrop = sal_False;
-/*
- SbaDatabaseRef xDatabase(GetDatabase());
- ::com::sun::star::uno::Reference< ::com::sun::star::data::XDatabaseDescriptor > rMetaData = xDatabase->GetMetaData();
- ::com::sun::star::uno::Any aJoin = rMetaData->getInfo(::com::sun::star::data::DatabaseInfo::OUTER_JOIN_SUPPORT);
-
- if (!xDatabase.Is() || !((::utl::getINT16(aJoin) & ::com::sun::star::data::DatabaseOuterJoinSupport::PARTIAL) || (::utl::getINT16(aJoin) & ::com::sun::star::data::DatabaseOuterJoinSupport::YES)) && GetTabWinMap()->size())
- {
- Sound::Beep();
- return sal_False;
- }
-
- sal_Bool bDrop = sal_False;
-
- for (sal_uInt16 i = 0; i < DragServer::GetItemCount(); ++i)
- {
- if (INetBookmark::DragServerHasFormat(i) )
- {
- INetBookmark aBmk;
- if (aBmk.PasteDragServer(i))
- {
- INetURLObject aObj(aBmk.GetURL());
- aObj.SetSmartProtocol(INET_PROT_FILE);
- String aMark(aObj.GetMark());
-
- if (aMark.GetTokenCount(';') > 1)
- {
- String sType = aMark.GetToken(0, ';');
- sType += ';';
- if (sType == String::CreateFromAscii(SDB_TABLEMARK_HEADER))
- {
- aMark.Erase(0, strlen(SDB_TABLEMARK_HEADER));
-
- String aDatabaseName = aObj.PathToFileName();
- DirEntry aDBEntry(aDatabaseName);
-
- if (aDBEntry == DirEntry(xDatabase->Name()))
- {
- SbaDBDefRef aDef = xDatabase->OpenDBDef(dbTable, aMark);
- if (aDef.Is())
- {
- if (aDef->Status().IsError())
- SBA_MOD()->ShowDbStatus(aDef->Status(), dbReadError,NULL);
-
- SdbTable* pTable = (static_cast< SbaTableDef*>(&aDef)->GetTable();
- if (pTable && pTable->IsOpen())
- {
- AddTabWin(pTable->QualifierName(),pTable->GetFullName());
- bDrop = sal_True;
- }
- }
- }
- }
- }
-
- if (!bDrop)
- Sound::Beep();
- break;
- }
- }
- }
-*/
- return bDrop;
-}
-
-//------------------------------------------------------------------------------
-sal_Bool OQueryTableView::QueryDrop(DropEvent& rEvt)
-{
- DBG_CHKTHIS(OQueryTableView,NULL);
- sal_Bool bDrop = sal_False;
-/*
- SbaDatabaseRef xDatabase(GetDatabase());
-
- ::com::sun::star::uno::Reference< ::com::sun::star::data::XDatabaseDescriptor > rMetaData = xDatabase->GetMetaData();
- ::com::sun::star::uno::Any aJoin = rMetaData->getInfo(::com::sun::star::data::DatabaseInfo::OUTER_JOIN_SUPPORT);
- if (!xDatabase.Is() || !((::utl::getINT16(aJoin) & ::com::sun::star::data::DatabaseOuterJoinSupport::PARTIAL) || (::utl::getINT16(aJoin) & ::com::sun::star::data::DatabaseOuterJoinSupport::YES)) && GetTabWinMap()->size())
- return sal_False;
-
- sal_Bool bDrop = sal_False;
- DropAction eAction = rEvt.GetAction();
-
- for (sal_uInt16 i = 0; i < DragServer::GetItemCount(); ++i)
- {
- if (INetBookmark::DragServerHasFormat(i))
- {
- INetBookmark aBmk;
- if (aBmk.PasteDragServer(i))
- { // it's a INetBookmark
- INetURLObject aObj(aBmk.GetURL());
- aObj.SetSmartProtocol(INET_PROT_FILE);
- String aMark(aObj.GetMark());
-
- // maybe it's a reference to a db object
- if (aMark.GetTokenCount(';') > 1)
- {
- String sType = aMark.GetToken(0, ';');
- sType += ';';
- if (sType == String::CreateFromAscii(SDB_TABLEMARK_HEADER))
- { // it's a reference to a table
- aMark.Erase(0, strlen(SDB_TABLEMARK_HEADER));
-
- String aDatabaseName = aObj.PathToFileName();
- DirEntry aDBEntry(aDatabaseName);
-
- if (aDBEntry == DirEntry(xDatabase->Name()))
- { // it's a reference to a table of our own database
- if (xDatabase->HasObjectByURL(aObj.GetMainURL()))
- {
- rEvt.SetAction(DROP_COPY);
- bDrop = sal_True;
- break;
- }
- }
- }
- }
- }
- }
- }
-*/
- return bDrop;
-}
//------------------------------------------------------------------------------
sal_Bool OQueryTableView::ExistsAVisitedConn(const OQueryTableWindow* pFrom) const
{
diff --git a/dbaccess/source/ui/querydesign/TableWindowListBox.cxx b/dbaccess/source/ui/querydesign/TableWindowListBox.cxx
index 040b75c8014c..95621008c073 100644
--- a/dbaccess/source/ui/querydesign/TableWindowListBox.cxx
+++ b/dbaccess/source/ui/querydesign/TableWindowListBox.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: TableWindowListBox.cxx,v $
*
- * $Revision: 1.8 $
+ * $Revision: 1.9 $
*
- * last change: $Author: oj $ $Date: 2001-06-28 14:22:47 $
+ * last change: $Author: oj $ $Date: 2001-07-06 09:55:40 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -117,7 +117,9 @@ OTableWindowListBox::OTableWindowListBox( OTableWindow* pParent, const String& r
,m_bDragSource( sal_False )
{
DBG_CTOR(OTableWindowListBox,NULL);
+#ifndef TF_SVDATA
EnableDrop();
+#endif // TF_SVDATA
m_aScrollTimer.SetTimeout( SCROLLING_TIMESPAN );
SetDoubleClickHdl( LINK(this, OTableWindowListBox, DoubleClickHdl) );