User: obo Date: 2006/07/10 08:30:04 Modified: dba/dbaccess/source/ui/inc/adtabdlg.hxx
Log: INTEGRATION: CWS qiq (1.7.124); FILE MERGED 2006/06/19 09:26:26 fs 1.7.124.2: #i51143# 'Add Tables' or 'Add Table or Query' decision now publicly available 2006/05/12 11:09:18 fs 1.7.124.1: #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.8 Delta lines: +64 -20 --------------------- --- adtabdlg.hxx 8 Sep 2005 15:43:49 -0000 1.7 +++ adtabdlg.hxx 10 Jul 2006 15:30:01 -0000 1.8 @@ -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,84 @@ #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(); + void DetermineAddTable() { aAddButton.Enable( impl_isAddAllowed() ); } + void Update(); + + static String getDialogTitleForContext( + IAddTableDialogContext& _rContext ); + + private: virtual BOOL Close(); - void DetermineAddTable() { aAddButton.Enable( IsAddAllowed() ); } - void Update(); - protected: - void UpdateTableList(BOOL bViewsAllowed); + 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]
