diff options
author | Ocke Janssen <oj@openoffice.org> | 2002-02-06 06:23:39 +0000 |
---|---|---|
committer | Ocke Janssen <oj@openoffice.org> | 2002-02-06 06:23:39 +0000 |
commit | b915d86f205af10fd1e6b4d48d3cdda7a68a61b4 (patch) | |
tree | 3ca3cdb7a94c631ebe389484b1921dc046c252c6 /dbaccess/source/ui/inc | |
parent | d02c9195489043ff671a8df47b49409b8e7e862b (diff) |
#96957# new handling inserted for context menu and accessibility
Diffstat (limited to 'dbaccess/source/ui/inc')
-rw-r--r-- | dbaccess/source/ui/inc/ConnectionLine.hxx | 15 | ||||
-rw-r--r-- | dbaccess/source/ui/inc/ConnectionLineData.hxx | 29 | ||||
-rw-r--r-- | dbaccess/source/ui/inc/JoinController.hxx | 10 | ||||
-rw-r--r-- | dbaccess/source/ui/inc/JoinDesignView.hxx | 6 | ||||
-rw-r--r-- | dbaccess/source/ui/inc/JoinTableView.hxx | 61 | ||||
-rw-r--r-- | dbaccess/source/ui/inc/QueryDesignView.hxx | 67 | ||||
-rw-r--r-- | dbaccess/source/ui/inc/QueryTableView.hxx | 9 | ||||
-rw-r--r-- | dbaccess/source/ui/inc/RTableConnectionData.hxx | 14 | ||||
-rw-r--r-- | dbaccess/source/ui/inc/RefFunctor.hxx | 8 | ||||
-rw-r--r-- | dbaccess/source/ui/inc/RelationDlg.hxx | 113 | ||||
-rw-r--r-- | dbaccess/source/ui/inc/TableConnection.hxx | 55 | ||||
-rw-r--r-- | dbaccess/source/ui/inc/TableConnectionData.hxx | 24 | ||||
-rw-r--r-- | dbaccess/source/ui/inc/browserids.hxx | 5 | ||||
-rw-r--r-- | dbaccess/source/ui/inc/dbu_resource.hrc | 13 |
14 files changed, 213 insertions, 216 deletions
diff --git a/dbaccess/source/ui/inc/ConnectionLine.hxx b/dbaccess/source/ui/inc/ConnectionLine.hxx index 52e3ddd5b23d..d091c1abd26c 100644 --- a/dbaccess/source/ui/inc/ConnectionLine.hxx +++ b/dbaccess/source/ui/inc/ConnectionLine.hxx @@ -2,9 +2,9 @@ * * $RCSfile: ConnectionLine.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: oj $ $Date: 2001-10-08 07:26:30 $ + * last change: $Author: oj $ $Date: 2002-02-06 07:23:39 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -70,10 +70,7 @@ #ifndef DBAUI_CONNECTIONLINEDATA_HXX #include "ConnectionLineData.hxx" #endif -#ifndef INCLUDED_FUNCTIONAL -#define INCLUDED_FUNCTIONAL #include <functional> -#endif class SvLBoxEntry; class OutputDevice; @@ -92,6 +89,7 @@ namespace dbaui **/ class OConnectionLineData; class OTableConnection; + class OTableWindow; class OConnectionLine { OTableConnection* m_pTabConn; @@ -104,7 +102,6 @@ namespace dbaui m_aDestConnPos; Point m_aSourceDescrLinePos, m_aDestDescrLinePos; - public: OConnectionLine( OTableConnection* pConn, const String& rSourceFieldName = String(), const String& rDestFieldName = String() ); @@ -124,12 +121,14 @@ namespace dbaui void SetSourceFieldName( const String& rSourceFieldName ); void SetDestFieldName( const String& rDestFieldName ); BOOL Connect( const String& rSourceFieldName, const String& rDestFieldName ); - BOOL IsValid(); + BOOL IsValid() const; Rectangle GetSourceTextPos() const; Rectangle GetDestTextPos() const; OConnectionLineDataRef GetData() const { return m_pData; } + + Point getMidPoint() const; }; /// unary_function Functor object for class OConnectionLine returntype is void /// draws a connectionline object on outputdevice @@ -151,7 +150,7 @@ namespace dbaui { inline bool operator()(const OConnectionLine* lhs,const Point& rhs) const { - return lhs->CheckHit(rhs); + return lhs->IsValid() && lhs->CheckHit(rhs); } }; diff --git a/dbaccess/source/ui/inc/ConnectionLineData.hxx b/dbaccess/source/ui/inc/ConnectionLineData.hxx index 457ae41e3259..c3708893e2ab 100644 --- a/dbaccess/source/ui/inc/ConnectionLineData.hxx +++ b/dbaccess/source/ui/inc/ConnectionLineData.hxx @@ -2,9 +2,9 @@ * * $RCSfile: ConnectionLineData.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: oj $ $Date: 2001-10-08 07:26:30 $ + * last change: $Author: oj $ $Date: 2002-02-06 07:23:39 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -61,22 +61,24 @@ #ifndef DBAUI_CONNECTIONLINEDATA_HXX #define DBAUI_CONNECTIONLINEDATA_HXX -#ifndef _STRING_HXX -#include <tools/string.hxx> -#endif #ifndef DBAUI_ENUMTYPES_HXX #include "QEnumTypes.hxx" #endif -#ifndef _VOS_REF_HXX_ -#include <vos/ref.hxx> +#ifndef _VOS_REFERNCE_HXX_ +#include <vos/refernce.hxx> #endif -#ifndef INCLUDED_VECTOR -#define INCLUDED_VECTOR #include <vector> + +#ifndef _VOS_REF_HXX_ +#include <vos/ref.hxx> #endif + #ifndef DBAUI_REFFUNCTOR_HXX #include "RefFunctor.hxx" #endif +#ifndef _RTL_USTRING_HXX_ +#include <rtl/ustring.hxx> +#endif namespace dbaui { @@ -106,9 +108,8 @@ namespace dbaui OConnectionLineData( const ::rtl::OUString& rSourceFieldName, const ::rtl::OUString& rDestFieldName ); OConnectionLineData( const OConnectionLineData& rConnLineData ); - // eine Kopie der eigenen Instanz liefern (das ist mir irgendwie angenehmer als ein virtueller Zuweisungsoperator) - virtual void CopyFrom(const OConnectionLineData& rSource); + void CopyFrom(const OConnectionLineData& rSource); // Memberzugriff (schreiben) void SetFieldName(EConnectionSide nWhich, const ::rtl::OUString& strFieldName) @@ -129,9 +130,9 @@ namespace dbaui ::rtl::OUString GetSourceFieldName() const { return GetFieldName(JTCS_FROM); } ::rtl::OUString GetDestFieldName() const { return GetFieldName(JTCS_TO); } - virtual BOOL IsValid(); - virtual void Reset(); - virtual OConnectionLineData& operator=( const OConnectionLineData& rConnLineData ); + bool IsValid() const; + bool Reset(); + OConnectionLineData& operator=( const OConnectionLineData& rConnLineData ); }; //------------------------------------------------------------------ diff --git a/dbaccess/source/ui/inc/JoinController.hxx b/dbaccess/source/ui/inc/JoinController.hxx index 54a2b284e6d5..cbcb4ddcdb2c 100644 --- a/dbaccess/source/ui/inc/JoinController.hxx +++ b/dbaccess/source/ui/inc/JoinController.hxx @@ -2,9 +2,9 @@ * * $RCSfile: JoinController.hxx,v $ * - * $Revision: 1.11 $ + * $Revision: 1.12 $ * - * last change: $Author: fs $ $Date: 2002-01-24 17:38:31 $ + * last change: $Author: oj $ $Date: 2002-02-06 07:23:39 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -142,6 +142,12 @@ namespace dbaui // need for undo's and redo's SfxUndoManager* getUndoMgr(); + /** addUndoActionAndInvalidate adds an undo action to the undoManager, + additionally invalidates the UNDO and REDO slot + @param pAction the undo action to add + */ + void addUndoActionAndInvalidate(SfxUndoAction *pAction); + // XEventListener virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException); diff --git a/dbaccess/source/ui/inc/JoinDesignView.hxx b/dbaccess/source/ui/inc/JoinDesignView.hxx index e7a79eef92bb..ab2fc7e9e779 100644 --- a/dbaccess/source/ui/inc/JoinDesignView.hxx +++ b/dbaccess/source/ui/inc/JoinDesignView.hxx @@ -2,9 +2,9 @@ * * $RCSfile: JoinDesignView.hxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: oj $ $Date: 2001-10-26 07:57:11 $ + * last change: $Author: oj $ $Date: 2002-02-06 07:23:39 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -119,7 +119,7 @@ namespace dbaui // called when a table from tabeview was deleted void TableDeleted(const ::rtl::OUString& rAliasName); - OJoinTableView* getTableView() { return m_pTableView; } + OJoinTableView* getTableView() const { return m_pTableView; } void zoomTableView(const Fraction& _rFraction); void SaveUIConfig(); protected: diff --git a/dbaccess/source/ui/inc/JoinTableView.hxx b/dbaccess/source/ui/inc/JoinTableView.hxx index 00ece08dad6d..6626d89dd002 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.12 $ + * $Revision: 1.13 $ * - * last change: $Author: oj $ $Date: 2001-10-26 07:57:11 $ + * last change: $Author: oj $ $Date: 2002-02-06 07:23:39 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -88,6 +88,7 @@ struct AcceptDropEvent; struct ExecuteDropEvent; +class SfxUndoAction; namespace dbaui { class OTableConnection; @@ -171,6 +172,8 @@ namespace dbaui virtual void StateChanged( StateChangedType nStateChange ); virtual void GetFocus(); virtual void KeyInput( const KeyEvent& rEvt ); + // Accessibility + virtual ::com::sun::star::uno::Reference< ::drafts::com::sun::star::accessibility::XAccessible > CreateAccessible(); // own methods ScrollBar* GetHScrollBar() { return static_cast<OScrollWindowHelper*>(GetParent())->GetHScrollBar(); } @@ -198,7 +201,7 @@ namespace dbaui ULONG GetTabWinCount(); Point GetScrollOffset() const { return m_aScrollOffset; } - OJoinDesignView* getDesignView() { return m_pView; } + OJoinDesignView* getDesignView() const { return m_pView; } OTableWindow* GetWindow( const String& rName ); OTableConnection* GetSelectedConn() { return m_pSelectedConn; } @@ -211,7 +214,22 @@ namespace dbaui BOOL ExistsAConn(const OTableWindow* pFromWin) const; - OTableConnection* GetTabConn(OTableWindow* pLhs,OTableWindow* pRhs, OTableConnection* _rpFirstAfter = NULL); + + /** getTableConnections searchs for all connections of a table + @param _pFromWin the table for which connections should be found + + @return an iterator which can be used to travel all connections of the table + */ + ::std::vector<OTableConnection*>::const_iterator getTableConnections(const OTableWindow* _pFromWin) const; + + /** getConnectionCount returns how many connection belongs to single table + @param _pFromWin the table for which connections should be found + + @return the count of connections wich belongs to this table + */ + sal_Int32 getConnectionCount(const OTableWindow* _pFromWin) const; + + OTableConnection* GetTabConn(const OTableWindow* pLhs,const OTableWindow* pRhs,const OTableConnection* _rpFirstAfter = NULL) const; // clears the window map and connection vector without destroying it // that means teh data of the windows and connection will be untouched @@ -241,6 +259,15 @@ namespace dbaui */ virtual void lookForUiActivities(); + // wird nach Verschieben/Groessenaenderung der TabWins aufgerufen (die Standardimplementation reicht die neuen Daten einfach + // an die Daten des Wins weiter) + virtual void TabWinMoved(OTableWindow* ptWhich, const Point& ptOldPosition); + // die Position ist "virtuell" : der Container hat sozusagen eine virtuelle Flaeche, von der immer nur ein bestimmter Bereich + // - der mittels der Scrollbar veraendert werden kann - zu sehen ist. Insbesondere hat ptOldPosition immer positive Koordinaten, + // auch wenn er einen Punkt oberhalb des aktuell sichtbaren Bereichs bezeichnet, dessen physische Ordinate eigentlich + // negativ ist. + virtual void TabWinSized(OTableWindow* ptWhich, const Point& ptOldPosition, const Size& szOldSize); + protected: virtual void MouseButtonUp( const MouseEvent& rEvt ); virtual void MouseButtonDown( const MouseEvent& rEvt ); @@ -253,27 +280,29 @@ namespace dbaui virtual void Resize(); 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) - virtual void TabWinMoved(OTableWindow* ptWhich, const Point& ptOldPosition); - // die Position ist "virtuell" : der Container hat sozusagen eine virtuelle Flaeche, von der immer nur ein bestimmter Bereich - // - der mittels der Scrollbar veraendert werden kann - zu sehen ist. Insbesondere hat ptOldPosition immer positive Koordinaten, - // auch wenn er einen Punkt oberhalb des aktuell sichtbaren Bereichs bezeichnet, dessen physische Ordinate eigentlich - // negativ ist. - virtual void TabWinSized(OTableWindow* ptWhich, const Point& ptOldPosition, const Size& szOldSize); - // hier ist die Position (die sich waehrend des Sizings aendern kann) physisch, da waehrend des Sizens nicht gescrollt wird + // hier ist die Position (die sich waehrend des Sizings aendern kann) physisch, da waehrend des Sizens nicht gescrollt wird virtual void Command(const CommandEvent& rEvt); virtual void EnsureVisible(const OTableWindow* _pWin); virtual OTableWindowData* CreateImpl(const ::rtl::OUString& _rComposedName, const ::rtl::OUString& _rWinName); + private: void InitColors(); BOOL ScrollWhileDragging(); + + /** executePopup opens the context menu to delate a connection + @param _aPos the position where the popup menu should appear + @param _pSelConnection the connection which should be deleted + */ + void executePopup(const Point& _aPos,OTableConnection* _pSelConnection); + + /** invalidateAndModify invalidates this window without children and + set the controller modified + @param _pAction a possible undo action to add at the controller + */ + void invalidateAndModify(SfxUndoAction *_pAction=NULL); }; } #endif // DBAUI_JOINTABLEVIEW_HXX diff --git a/dbaccess/source/ui/inc/QueryDesignView.hxx b/dbaccess/source/ui/inc/QueryDesignView.hxx index 2ae66f61cebb..5792c6a99309 100644 --- a/dbaccess/source/ui/inc/QueryDesignView.hxx +++ b/dbaccess/source/ui/inc/QueryDesignView.hxx @@ -2,9 +2,9 @@ * * $RCSfile: QueryDesignView.hxx,v $ * - * $Revision: 1.11 $ + * $Revision: 1.12 $ * - * last change: $Author: oj $ $Date: 2001-10-23 12:30:27 $ + * last change: $Author: oj $ $Date: 2002-02-06 07:23:39 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -70,9 +70,6 @@ #ifndef _STRING_HXX #include <tools/string.hxx> #endif -#ifndef DBAUI_QUERYTABLEVIEW_HXX -#include "QueryTableView.hxx" -#endif #ifndef DBAUI_ENUMTYPES_HXX #include "QEnumTypes.hxx" #endif @@ -104,8 +101,6 @@ namespace dbaui class OQueryDesignView : public OQueryView { - friend class OQueryViewSwitch; - enum ChildFocusState { SELECTION, @@ -121,61 +116,6 @@ namespace dbaui OSelectionBrowseBox* m_pSelectionBox; // presents the lower window ChildFocusState m_eChildFocus; - ::rtl::OUString QuoteField( const ::rtl::OUString& rValue, sal_Int32 aType ); - void InitFromParseNode(); - void GetTable( ::rtl::OUString& rDatabase, ::rtl::OUString& rTable, ::rtl::OUString& rAlias, ::connectivity::OSQLParseNode* pNode ); - - void GenerateInnerJoinCriterias(::rtl::OUString& _rJoinCrit,const ::std::vector<OTableConnection*>* _pConnList); - // erzeugt das Group Argument, falls vorhanden - ::rtl::OUString GenerateGroupBy(OTableFields& _rFieldList, sal_Bool bMulti ); - // erzeugt Where und Having Argument, falls vorhanden - sal_Bool GenerateCriterias(::rtl::OUString& aRetStr,::rtl::OUString& rHavingStr/*,::rtl::OUString& rOrderStr*/, OTableFields& _rFieldList, sal_Bool bMulti ); - ::rtl::OUString GenerateOrder( OTableFields& _rFieldList , sal_Bool bMulti); - // Erzeugt die SelectList. bAlias mu"s gesetzt sein, wenn mehr als 1 Tabelle vorhanden ist - ::rtl::OUString GenerateSelectList(OTableFields& _rFieldList,sal_Bool bAlias); - // Erzeugt die Tabellenliste mit Joins aus pConnList, wenn bJoin == True. pConnList kann == NULL wenn bJoin == sal_False - ::rtl::OUString GenerateFromClause(const OJoinTableView::OTableWindowMap* pTabMap,::std::vector<OTableConnection*>* pConnList); - - ::rtl::OUString BuildACriteria( const ::rtl::OUString& rVal, sal_Int32 aType ); - int InstallFields( const ::connectivity::OSQLParseNode* pNode, OJoinTableView::OTableWindowMap* pTabList ); - - // nLevel gibt die Zeile an in der die Bedingungen eingetragen werden sollen - int GetSelectionCriteria(const ::connectivity::OSQLParseNode* pNode ,int &nLevel, sal_Bool bJoinWhere=sal_False); - void GetHavingCriteria(const ::connectivity::OSQLParseNode* pNode ,int &nLevel); - - int GetORCriteria(const ::connectivity::OSQLParseNode * pCondition, int& nLevel, sal_Bool bHaving = sal_False ); - int GetANDCriteria(const ::connectivity::OSQLParseNode * pCondition, const int nLevel, sal_Bool bHaving); - int ComparsionPredicate( const ::connectivity::OSQLParseNode * pCondition, const int nLevel, sal_Bool bHaving ); - - void GetOrderCriteria( const ::connectivity::OSQLParseNode* pNode ); - void GetGroupCriteria( const ::connectivity::OSQLParseNode* pNode ); - - sal_Bool GetInnerJoinCriteria(const ::connectivity::OSQLParseNode *pCondition); - void FillOuterJoins(const ::connectivity::OSQLParseNode* pParseNode); - sal_Bool InsertJoin(const ::connectivity::OSQLParseNode *pNode); - sal_Bool InsertJoinConnection(const ::connectivity::OSQLParseNode *pNode, const EJoinType& _eJoinType); - - sal_Bool FillDragInfo(const ::connectivity::OSQLParseNode* pTableRef,OTableFieldDescRef& aDragInfo); - - sal_Bool HasFields(); - ::rtl::OUString BuildTable(const OQueryTableWindow* pEntryTab); - - ::rtl::OUString BuildJoin(OQueryTableWindow* pLh, OQueryTableWindow* pRh, OQueryTableConnectionData* pData); - ::rtl::OUString BuildJoin(const ::rtl::OUString &rLh, OQueryTableWindow* pRh, OQueryTableConnectionData* pData); - ::rtl::OUString BuildJoin(OQueryTableWindow* pLh, const ::rtl::OUString &rRh, OQueryTableConnectionData* pData); - ::rtl::OUString BuildJoin(const ::rtl::OUString& rLh, const ::rtl::OUString& rRh, OQueryTableConnectionData* pData); - - ::rtl::OUString BuildJoinCriteria(OConnectionLineDataVec* pLineDataList,OQueryTableConnectionData* pData); - - void GetNextJoin(OQueryTableConnection* pEntryConn,::rtl::OUString &aJoin,OQueryTableWindow* pEntryTabTo); - void JoinCycle(OQueryTableConnection* pEntryConn,::rtl::OUString &rJoin,OQueryTableWindow* pEntryTabTo); - - int InsertColumnRef(const ::connectivity::OSQLParseNode * pColumnRef, - ::rtl::OUString& aColumnName,const ::rtl::OUString& aColumnAlias, - ::rtl::OUString& aTableRange,OTableFieldDescRef& aInfo, - OJoinTableView::OTableWindowMap* pTabList); - - sal_Int32 GetColumnFormatKey(const ::connectivity::OSQLParseNode* pColumnRef); public: OQueryDesignView(OQueryContainerWindow* pParent, OQueryController* _pController,const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& ); virtual ~OQueryDesignView(); @@ -211,7 +151,7 @@ namespace dbaui ::com::sun::star::lang::Locale getLocale() const { return m_aLocale;} ::rtl::OUString getDecimalSeparator() const { return m_sDecimalSep;} - sal_Bool HasTable() const {return m_pTableView->GetTabWinMap()->size() != 0;} + sal_Bool HasTable() const; sal_Bool InsertField( const OTableFieldDescRef& rInfo, sal_Bool bVis=sal_True, sal_Bool bActivate = sal_True); // save the position of the table window and the pos of the splitters void SaveTabWinUIConfig(OQueryTableWindow* pWin); @@ -228,6 +168,7 @@ namespace dbaui void stopTimer(); void startTimer(); void reset(); + void InitFromParseNode(); ::connectivity::OSQLParseNode* getPredicateTreeFromEntry( OTableFieldDescRef pEntry, const String& _sCriteria, diff --git a/dbaccess/source/ui/inc/QueryTableView.hxx b/dbaccess/source/ui/inc/QueryTableView.hxx index 69df99c71ca3..b7e9064cbf5e 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.8 $ + * $Revision: 1.9 $ * - * last change: $Author: oj $ $Date: 2001-10-05 06:49:21 $ + * last change: $Author: oj $ $Date: 2002-02-06 07:23:39 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -94,7 +94,6 @@ namespace dbaui { Link m_lnkTabWinsChangeHandler; - void addConnections(const OQueryTableWindow* _pSource,const OQueryTableWindow* _pDest,const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess>& _rxForeignKeyColumns); protected: virtual void ConnDoubleClicked(OTableConnection* pConnection); virtual void KeyInput(const KeyEvent& rEvt); @@ -161,6 +160,10 @@ namespace dbaui virtual OTableWindowData* CreateImpl(const ::rtl::OUString& _rComposedName, const ::rtl::OUString& _rWinName); + + /** createNewConnection opens the join dialog and allows to create a new join connection + */ + void createNewConnection(); }; } #endif // DBAUI_QUERYTABLEVIEW_HXX diff --git a/dbaccess/source/ui/inc/RTableConnectionData.hxx b/dbaccess/source/ui/inc/RTableConnectionData.hxx index fd4383845168..0b9054b6def2 100644 --- a/dbaccess/source/ui/inc/RTableConnectionData.hxx +++ b/dbaccess/source/ui/inc/RTableConnectionData.hxx @@ -2,9 +2,9 @@ * * $RCSfile: RTableConnectionData.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: oj $ $Date: 2001-10-08 07:26:30 $ + * last change: $Author: oj $ $Date: 2002-02-06 07:23:39 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -110,6 +110,7 @@ namespace dbaui virtual OConnectionLineDataRef CreateLineDataObj(); virtual OConnectionLineDataRef CreateLineDataObj( const OConnectionLineData& rConnLineData ); + ORelationTableConnectionData& operator=( const ORelationTableConnectionData& rConnData ); public: ORelationTableConnectionData(); ORelationTableConnectionData( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess>& _xTables); @@ -123,7 +124,7 @@ namespace dbaui virtual void CopyFrom(const OTableConnectionData& rSource); virtual OTableConnectionData* NewInstance() const { return new ORelationTableConnectionData(); } - ORelationTableConnectionData& operator=( const ORelationTableConnectionData& rConnData ); + ::rtl::OUString GetDatabaseName() const { return m_sDatabaseName; } @@ -133,6 +134,12 @@ namespace dbaui virtual void SetSourceWinName( const String& rSourceWinName ); virtual void SetDestWinName( const String& rDestWinName ); + /** Update create a new relation + + @return true if successful + */ + virtual BOOL Update(); + void SetCardinality(); void SetUpdateRules( sal_Int32 nAttr ){ m_nUpdateRules = nAttr; } @@ -142,7 +149,6 @@ namespace dbaui sal_Int32 GetDeleteRules() const { return m_nDeleteRules; } sal_Int32 GetCardinality() const { return m_nCardinality; } - BOOL Update(); BOOL IsConnectionPossible(); void ChangeOrientation(); BOOL DropRelation(); diff --git a/dbaccess/source/ui/inc/RefFunctor.hxx b/dbaccess/source/ui/inc/RefFunctor.hxx index 87a02f1d64e7..d004afd35465 100644 --- a/dbaccess/source/ui/inc/RefFunctor.hxx +++ b/dbaccess/source/ui/inc/RefFunctor.hxx @@ -2,9 +2,9 @@ * * $RCSfile: RefFunctor.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: obo $ $Date: 2001-10-09 08:24:25 $ + * last change: $Author: oj $ $Date: 2002-02-06 07:23:39 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -82,6 +82,10 @@ namespace dbaui { m_aFunction(_aType.getBodyPtr()); } +// inline void operator()(const ::vos::ORef<T>& _aType) +// { +// m_aFunction(_aType.getBodyPtr()); +// } }; // ----------------------------------------------------------------------------- } // namespace dbaui diff --git a/dbaccess/source/ui/inc/RelationDlg.hxx b/dbaccess/source/ui/inc/RelationDlg.hxx index 26fdfc054c3b..b758afcc36c7 100644 --- a/dbaccess/source/ui/inc/RelationDlg.hxx +++ b/dbaccess/source/ui/inc/RelationDlg.hxx @@ -2,9 +2,9 @@ * * $RCSfile: RelationDlg.hxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: fs $ $Date: 2001-10-16 15:12:29 $ + * last change: $Author: oj $ $Date: 2002-02-06 07:23:39 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -68,92 +68,35 @@ #ifndef _BUTTON_HXX //autogen #include <vcl/button.hxx> #endif - #ifndef _FIXED_HXX //autogen #include <vcl/fixed.hxx> #endif - -#ifndef _EDIT_HXX //autogen -#include <vcl/edit.hxx> -#endif - -#ifndef _SV_LSTBOX_HXX //autogen -#include <vcl/lstbox.hxx> -#endif - -#ifndef _SVTOOLS_EDITBROWSEBOX_HXX_ -#include <svtools/editbrowsebox.hxx> -#endif - +//#ifndef _EDIT_HXX //autogen +//#include <vcl/edit.hxx> +//#endif #ifndef _SV_MSGBOX_HXX #include <vcl/msgbox.hxx> #endif -#ifndef DBAUI_RTABLECONNECTIONDATA_HXX -#include "RTableConnectionData.hxx" +#ifndef DBAUI_JOINTABLEVIEW_HXX +#include "JoinTableView.hxx" #endif -#ifndef _COM_SUN_STAR_SDBC_XCONNECTION_HPP_ -#include <com/sun/star/sdbc/XConnection.hpp> +#ifndef DBAUI_RELCONTROLIFACE_HXX +#include "RelControliFace.hxx" #endif namespace dbaui { - //======================================================================== - class ORelationDialog; - typedef ::svt::EditBrowseBox ORelationControl_Base; - class ORelationControl : public ORelationControl_Base - { - friend class ORelationDialog; - - ULONG m_nDeActivateEvent; - ::svt::ListBoxControl* m_pListCell; - ORelationTableConnectionData* m_pConnData; - long m_nDataPos; - ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> m_xSourceDef; - ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> m_xDestDef; - - void SetDef(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& xDest,sal_Int32 _nPos); - void fillListBox(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _xDest,long nRow,USHORT nColumnId); - public: - ORelationControl( ORelationDialog* pParent ); - virtual ~ORelationControl(); - - void SetSourceDef(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _xNewSource); - void SetDestDef(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _xNewDest); - - protected: - virtual void Resize(); - - virtual long PreNotify(NotifyEvent& rNEvt ); - - virtual BOOL IsTabAllowed(BOOL bForward) const; - - virtual void Init(ORelationTableConnectionData* _pConnData); - virtual void Init() { ORelationControl_Base::Init(); } - virtual void InitController( ::svt::CellControllerRef& rController, long nRow, USHORT nCol ); - virtual ::svt::CellController* GetController( long nRow, USHORT nCol ); - virtual void PaintCell( OutputDevice& rDev, const Rectangle& rRect, USHORT nColId ) const; - virtual BOOL SeekRow( long nRow ); - virtual BOOL SaveModified(); - virtual String GetCellText( long nRow, USHORT nColId ); - - virtual void CellModified(); - - private: - - DECL_LINK( AsynchActivate, void* ); - DECL_LINK( AsynchDeactivate, void* ); - }; - class OJoinTableView; + class OTableListBoxControl; + class ORelationTableConnectionData; //======================================================================== class ORelationDialog : public ModalDialog + ,public IRelationControlInterface { - FixedLine aFL_InvolvedTables; - ListBox m_lmbLeftTable, - m_lmbRightTable; - FixedLine aFL_InvolvedFields; + OTableListBoxControl* m_pTableControl; + OJoinTableView::OTableWindowMap* m_pTableMap; FixedLine aFL_CascUpd; RadioButton aRB_NoCascUpd, @@ -170,13 +113,11 @@ namespace dbaui CancelButton aPB_CANCEL; HelpButton aPB_HELP; - ORelationControl* m_pRC_Tables; + ORelationTableConnectionData* m_pConnData; ORelationTableConnectionData* m_pOrigConnData; ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > m_xConnection; - String m_strCurrentLeft; - String m_strCurrentRight; BOOL m_bTriedOneUpdate; public: @@ -185,18 +126,34 @@ namespace dbaui BOOL bAllowTableSelect = FALSE ); virtual ~ORelationDialog(); - ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > getConnection(){ return m_xConnection; } - - void NotifyCellChange(); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > getConnection(){ return m_xConnection; } virtual short Execute(); + /** getTableMap gives acces to the table window map + @retrun the table window from the join view + */ + OJoinTableView::OTableWindowMap* getTableMap() const { return m_pTableMap; } + + /** getConnectionData returns the current connection data + @return the current connectiondata + */ + virtual OTableConnectionData* getConnectionData() const; + + /** setValid set the valid inside, can be used for OK buttons + @param _bValid true when the using control allows an update + */ + virtual void setValid(sal_Bool _bValid); + + /** notifyConnectionChange is callback which is called when the table selection has changed and a new connection exists + @param _pConnectionData the connection which exists between the new tables + */ + virtual void notifyConnectionChange(OTableConnectionData* _pConnectionData); protected: void Init(ORelationTableConnectionData* _pConnData); private: DECL_LINK( OKClickHdl, Button* ); - DECL_LINK( OnTableChanged, ListBox* ); }; } #endif // DBAUI_RELATIONDIALOG_HXX diff --git a/dbaccess/source/ui/inc/TableConnection.hxx b/dbaccess/source/ui/inc/TableConnection.hxx index c7d773521aa8..892c6ab19247 100644 --- a/dbaccess/source/ui/inc/TableConnection.hxx +++ b/dbaccess/source/ui/inc/TableConnection.hxx @@ -2,9 +2,9 @@ * * $RCSfile: TableConnection.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: oj $ $Date: 2001-08-27 06:57:23 $ + * last change: $Author: oj $ $Date: 2002-02-06 07:23:39 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -61,33 +61,52 @@ #ifndef DBAUI_TABLECONNECTION_HXX #define DBAUI_TABLECONNECTION_HXX -#ifndef _SV_GEN_HXX -#include <tools/gen.hxx> -#endif -#ifndef DBAUI_CONNECTIONLINE_HXX -#include "ConnectionLine.hxx" -#endif -#ifndef _VECTOR_ +//#ifndef _SV_GEN_HXX +//#include <tools/gen.hxx> +//#endif +//#ifndef DBAUI_CONNECTIONLINE_HXX +//#include "ConnectionLine.hxx" +//#endif #include <vector> +#ifndef _TOOLS_DEBUG_HXX +#include <tools/debug.hxx> #endif #ifndef _RTTI_HXX #include <tools/rtti.hxx> #endif +#ifndef _COM_SUN_STAR_UNO_REFERENCE_H_ +#include <com/sun/star/uno/Reference.h> +#endif + +namespace drafts { namespace com { namespace sun { namespace star { namespace accessibility +{ + class XAccessible; +}}}}} + +class Point; +class Rectangle; namespace dbaui { class OTableConnectionData; class OTableWindow; class OJoinTableView; + class OConnectionLine; + + DBG_NAMEEX(OTableConnection); class OTableConnection { ::std::vector<OConnectionLine*> m_vConnLine; OTableConnectionData* m_pData; - OJoinTableView* m_pParent; + OJoinTableView* m_pParent; + mutable ::com::sun::star::uno::Reference< ::drafts::com::sun::star::accessibility::XAccessible > m_xAccessible; BOOL m_bSelected; void Init(); + /** clearLineData loops through the vector and deletes all lines + */ + void clearLineData(); protected: OConnectionLine* CreateConnLine( const OConnectionLine& rConnLine ); @@ -108,7 +127,7 @@ namespace dbaui void Select(); void Deselect(); BOOL IsSelected() const { return m_bSelected; } - BOOL CheckHit( const Point& rMousePos ); + BOOL CheckHit( const Point& rMousePos ) const; bool Invalidate(); void UpdateLineList(); @@ -116,13 +135,23 @@ namespace dbaui OTableWindow* GetDestWin() const; bool RecalcLines(); + /** isTableConnection + @param _pTable the table where we should check if we belongs to it + + @return true when the source or the destination window are equal + */ + bool isTableConnection(const OTableWindow* _pTable) + { + return (_pTable == GetSourceWin() || _pTable == GetDestWin()); + } - Rectangle GetBoundingRect(); + Rectangle GetBoundingRect() const; OTableConnectionData* GetData() const { return m_pData; } const ::std::vector<OConnectionLine*>* GetConnLineList() const { return &m_vConnLine; } - OJoinTableView* GetParent(){ return m_pParent; } + OJoinTableView* GetParent() const { return m_pParent; } virtual void Draw( const Rectangle& rRect ); + ::com::sun::star::uno::Reference< ::drafts::com::sun::star::accessibility::XAccessible > getAccessible() const; }; } #endif // DBAUI_TABLECONNECTION_HXX diff --git a/dbaccess/source/ui/inc/TableConnectionData.hxx b/dbaccess/source/ui/inc/TableConnectionData.hxx index bdf7b8aab400..de17e3734cf8 100644 --- a/dbaccess/source/ui/inc/TableConnectionData.hxx +++ b/dbaccess/source/ui/inc/TableConnectionData.hxx @@ -2,9 +2,9 @@ * * $RCSfile: TableConnectionData.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: oj $ $Date: 2001-10-08 07:26:30 $ + * last change: $Author: oj $ $Date: 2002-02-06 07:23:39 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -64,12 +64,13 @@ #ifndef DBAUI_CONNECTIONLINEDATA_HXX #include "ConnectionLineData.hxx" #endif -#ifndef _VECTOR_ #include <vector> -#endif #ifndef _RTTI_HXX #include <tools/rtti.hxx> #endif +#ifndef _STRING_HXX +#include <tools/string.hxx> +#endif namespace dbaui { @@ -84,10 +85,11 @@ namespace dbaui //================================================================== /* - the class OTableConnectionData contains all connectiondata which exists between two windows + the class OTableConnectionData contains all connection data which exists between two windows **/ class OTableConnectionData { + protected: String m_aSourceWinName; String m_aDestWinName; @@ -103,6 +105,7 @@ namespace dbaui virtual OConnectionLineDataRef CreateLineDataObj(); virtual OConnectionLineDataRef CreateLineDataObj( const OConnectionLineData& rConnLineData ); + OTableConnectionData& operator=( const OTableConnectionData& rConnData ); public: TYPEINFO(); OTableConnectionData(); @@ -117,11 +120,15 @@ namespace dbaui virtual OTableConnectionData* NewInstance() const; // (von OTableConnectionData abgeleitete Klasse muessen entsprechend eine Instanz ihrer Klasse liefern) - OTableConnectionData& operator=( const OTableConnectionData& rConnData ); + BOOL SetConnLine( USHORT nIndex, const String& rSourceFieldName, const String& rDestFieldName ); BOOL AppendConnLine( const ::rtl::OUString& rSourceFieldName, const ::rtl::OUString& rDestFieldName ); void ResetConnLines( BOOL bUseDefaults = TRUE ); + + /** normalizeLines moves the empty lines to the back + */ + void normalizeLines(); // loescht die Liste der ConnLines, bei bUseDefaults == TRUE werden danach MAX_CONN_COUNT neue Dummy-Linien eingefuegt OConnectionLineDataVec* GetConnLineDataList(){ return &m_vConnLineData; } @@ -133,6 +140,11 @@ namespace dbaui virtual void SetSourceWinName( const String& rSourceWinName ){ m_aSourceWinName = rSourceWinName; } virtual void SetDestWinName( const String& rDestWinName ){ m_aDestWinName = rDestWinName; } virtual void SetConnName( const String& rConnName ){ m_aConnName = rConnName; } + /** Update create a new connection + + @return true if successful + */ + virtual BOOL Update(){ return TRUE; } }; } diff --git a/dbaccess/source/ui/inc/browserids.hxx b/dbaccess/source/ui/inc/browserids.hxx index a6f51a35f042..2fcae32a77a4 100644 --- a/dbaccess/source/ui/inc/browserids.hxx +++ b/dbaccess/source/ui/inc/browserids.hxx @@ -2,9 +2,9 @@ * * $RCSfile: browserids.hxx,v $ * - * $Revision: 1.20 $ + * $Revision: 1.21 $ * - * last change: $Author: oj $ $Date: 2001-09-25 13:24:37 $ + * last change: $Author: oj $ $Date: 2002-02-06 07:23:39 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -158,6 +158,7 @@ #define ID_QUERY_TABLENAME (SID_SBA_START + 42) // Tabellennamen anzeigen #define ID_QUERY_ALIASNAME (SID_SBA_START + 43) // Aliasnamen anzeigen #define ID_QUERY_DISTINCT (SID_SBA_START + 44) // Distinct anzeigen +#define ID_QUERY_EDIT_JOINCONNECTION (SID_SBA_START + 45) // show-edit Join #define ID_QUERY_ZOOM_IN SID_ZOOM_IN #define ID_QUERY_ZOOM_OUT SID_ZOOM_OUT diff --git a/dbaccess/source/ui/inc/dbu_resource.hrc b/dbaccess/source/ui/inc/dbu_resource.hrc index 02901427e025..2b623ab10007 100644 --- a/dbaccess/source/ui/inc/dbu_resource.hrc +++ b/dbaccess/source/ui/inc/dbu_resource.hrc @@ -2,9 +2,9 @@ * * $RCSfile: dbu_resource.hrc,v $ * - * $Revision: 1.65 $ + * $Revision: 1.66 $ * - * last change: $Author: fs $ $Date: 2002-01-24 17:38:31 $ + * last change: $Author: oj $ $Date: 2002-02-06 07:23:39 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -465,12 +465,21 @@ #define RSC_CHARSETS RID_UNTYPED_START + 2 #define PB_FORMAT RID_UNTYPED_START + 3 #define FIXED_NO_CONNECTION RID_UNTYPED_START + 4 +#define LB_LEFT_TABLE RID_UNTYPED_START + 5 +#define LB_RIGHT_TABLE RID_UNTYPED_START + 6 +#define LB_CONTROL RID_UNTYPED_START + 7 +#define FL_INVOLVED_TABLES RID_UNTYPED_START + 8 +#define FL_INVOLVED_FIELDS RID_UNTYPED_START + 9 + #endif // _DBU_RESOURCE_HRC_ /************************************************************************* * history: * $Log: not supported by cvs2svn $ + * Revision 1.65 2002/01/24 17:38:31 fs + * incorporate the improvements suggested during code review of genericcontroller.* + * * Revision 1.64 2001/10/05 06:57:19 oj * #84000# impl multiselction for queries and link docs * |