Tag: cws_src680_qiq User: fs Date: 06/05/12 04:09:20 Modified: /dba/dbaccess/source/ui/inc/ adtabdlg.hxx
Log: #i51143# allow queries in this dialog, too File Changes: Directory: /dba/dbaccess/source/ui/inc/ ======================================= File [changed]: adtabdlg.hxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/inc/adtabdlg.hxx?r1=1.7&r2=1.7.124.1 Delta lines: +63 -22 --------------------- --- adtabdlg.hxx 8 Sep 2005 15:43:49 -0000 1.7 +++ adtabdlg.hxx 12 May 2006 11:09:18 -0000 1.7.124.1 @@ -4,9 +4,9 @@ * * $RCSfile: adtabdlg.hxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.7.124.1 $ * - * last change: $Author: rt $ $Date: 2005/09/08 15:43:49 $ + * last change: $Author: fs $ $Date: 2006/05/12 11:09:18 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -47,6 +47,10 @@ #include <vcl/fixed.hxx> #endif +#ifndef _COM_SUN_STAR_SDBC_XCONNECTION_HPP_ +#include <com/sun/star/sdbc/XConnection.hpp> +#endif + #ifndef _LSTBOX_HXX //autogen #include <vcl/lstbox.hxx> #endif @@ -61,44 +65,81 @@ #include "tabletree.hxx" #endif +#include <memory> namespace dbaui { //======================================================================== - class OJoinTableView; + /** unifies the access to a list of table/query objects + */ + class TableObjectListFacade + { + public: + virtual void updateTableObjectList( bool _bAllowViews ) = 0; + virtual String getSelectedName( String& _out_rAliasName ) const = 0; + virtual bool isLeafSelected() const = 0; + + virtual ~TableObjectListFacade(); + }; + + //======================================================================== + class IAddTableDialogContext + { + public: + virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > + getConnection() const = 0; + virtual bool allowViews() const = 0; + virtual bool allowQueries() const = 0; + virtual bool allowAddition() const = 0; + virtual void addTableWindow( const String& _rQualifiedTableName, const String& _rAliasName ) = 0; + virtual void onWindowClosing( const Window* _pWindow ) = 0; + }; + + //======================================================================== class OAddTableDlg : public ModelessDialog { - FixedText aFTTable; - OTableTreeListBox aTableList; + RadioButton m_aCaseTables; + RadioButton m_aCaseQueries; + + OTableTreeListBox m_aTableList; + SvTreeListBox m_aQueryList; + ::std::auto_ptr< TableObjectListFacade > + m_pCurrentList; + PushButton aAddButton; CancelButton aCloseButton; HelpButton aHelpButton; - FixedLine aFixedLineTable; - String aDefaultString; - - OJoinTableView* m_pTableView; - sal_Bool m_bInitialized; - - BOOL IsAddAllowed(); - void AddTable(); + IAddTableDialogContext& + m_rContext; DECL_LINK( AddClickHdl, Button* ); DECL_LINK( CloseClickHdl, Button* ); - DECL_LINK( TableListDoubleClickHdl, ListBox* ); - DECL_LINK( TableListSelectHdl, ListBox* ); + DECL_LINK( TableListDoubleClickHdl, void* ); + DECL_LINK( TableListSelectHdl, void* ); + DECL_LINK( OnTypeSelected, void* ); + public: - OAddTableDlg(Window* pParent,OJoinTableView* _pTableView); + OAddTableDlg( + Window* _pParent, + IAddTableDialogContext& _rContext ); virtual ~OAddTableDlg(); virtual BOOL Close(); - void DetermineAddTable() { aAddButton.Enable( IsAddAllowed() ); } + void DetermineAddTable() { aAddButton.Enable( impl_isAddAllowed() ); } void Update(); - protected: - void UpdateTableList(BOOL bViewsAllowed); + + private: + bool impl_isAddAllowed(); + void impl_addTable(); + + enum ObjectList + { + Tables, + Queries + }; + void impl_switchTo( ObjectList _eList ); }; } #endif // DBAUI_QYDLGTAB_HXX - - --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
