diff options
author | Ocke Janssen <oj@openoffice.org> | 2001-01-09 15:11:54 +0000 |
---|---|---|
committer | Ocke Janssen <oj@openoffice.org> | 2001-01-09 15:11:54 +0000 |
commit | d790738d6dee3d80db779d367ccae65911fa2a14 (patch) | |
tree | 379bdf76934a9f648d5e9f5e5b58c38eba62ea5c /dbaccess/source/ui | |
parent | 006032082bfcf39e327cf943f6320e4896cac075 (diff) |
#81232#
Diffstat (limited to 'dbaccess/source/ui')
22 files changed, 1827 insertions, 254 deletions
diff --git a/dbaccess/source/ui/control/makefile.mk b/dbaccess/source/ui/control/makefile.mk index 17983ab70630..38d7bc163cd4 100644 --- a/dbaccess/source/ui/control/makefile.mk +++ b/dbaccess/source/ui/control/makefile.mk @@ -2,9 +2,9 @@ # # $RCSfile: makefile.mk,v $ # -# $Revision: 1.1 $ +# $Revision: 1.2 $ # -# last change: $Author: fs $ $Date: 2000-10-05 10:00:35 $ +# last change: $Author: oj $ $Date: 2001-01-09 16:07:59 $ # # The Contents of this file are made available subject to the terms of # either of the following licenses @@ -76,12 +76,15 @@ ENABLE_EXCEPTIONS=TRUE # ... resource files ............................ SRCFILES = \ + undosqledit.src \ tabletree.src \ marktree.src # ... object files ............................ SLOFILES= \ + $(SLO)$/undosqledit.obj \ + $(SLO)$/sqledit.obj \ $(SLO)$/tabletree.obj \ $(SLO)$/marktree.obj \ $(SLO)$/curledit.obj diff --git a/dbaccess/source/ui/control/sqledit.cxx b/dbaccess/source/ui/control/sqledit.cxx new file mode 100644 index 000000000000..3e7d7b89685b --- /dev/null +++ b/dbaccess/source/ui/control/sqledit.cxx @@ -0,0 +1,209 @@ +/************************************************************************* + * + * $RCSfile: sqledit.cxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: oj $ $Date: 2001-01-09 16:07:27 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the License); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an AS IS basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef DBAUI_SQLEDIT_HXX +#include "sqledit.hxx" +#endif +#ifndef DBAUI_QUERYVIEW_TEXT_HXX +#include "QueryTextView.hxx" +#endif +#ifndef _TOOLS_DEBUG_HXX +#include <tools/debug.hxx> +#endif +#include "dbaccess_helpid.hrc" +#ifndef DBACCESS_UI_BROWSER_ID_HXX +#include "browserids.hxx" +#endif +#ifndef DBAUI_QUERYCONTROLLER_HXX +#include "querycontroller.hxx" +#endif +#ifndef DBAUI_UNDOSQLEDIT_HXX +#include "undosqledit.hxx" +#endif +////////////////////////////////////////////////////////////////////////// +// OSqlEdit +//------------------------------------------------------------------------------ +using namespace dbaui; + +DBG_NAME(OSqlEdit); +OSqlEdit::OSqlEdit( OQueryTextView* pParent, WinBits nWinStyle ) : + MultiLineEdit( pParent, nWinStyle ) + ,m_bAccelAction( sal_False ) + ,m_pView(pParent) +{ + DBG_CTOR(OSqlEdit,NULL); + SetHelpId( HID_CTL_QRYSQLEDIT ); + SetModifyHdl( LINK(this, OSqlEdit, ModifyHdl) ); + + m_timerUndoActionCreation.SetTimeout(1000); + m_timerUndoActionCreation.SetTimeoutHdl(LINK(this, OSqlEdit, OnUndoActionTimer)); + + m_timerInvalidate.SetTimeout(200); + m_timerInvalidate.SetTimeoutHdl(LINK(this, OSqlEdit, OnInvalidateTimer)); + m_timerInvalidate.Start(); +} + +//------------------------------------------------------------------------------ +OSqlEdit::~OSqlEdit() +{ + if (m_timerUndoActionCreation.IsActive()) + m_timerUndoActionCreation.Stop(); + DBG_DTOR(OSqlEdit,NULL); +} +//------------------------------------------------------------------------------ +void OSqlEdit::KeyInput( const KeyEvent& rKEvt ) +{ + DBG_CHKTHIS(OSqlEdit,NULL); + m_pView->getController()->InvalidateFeature(SID_CUT); + m_pView->getController()->InvalidateFeature(SID_COPY); + + // Ist dies ein Cut, Copy, Paste Event? + KeyFuncType aKeyFunc = rKEvt.GetKeyCode().GetFunction(); + if( (aKeyFunc==KEYFUNC_CUT)||(aKeyFunc==KEYFUNC_COPY)||(aKeyFunc==KEYFUNC_PASTE) ) + m_bAccelAction = sal_True; + + MultiLineEdit::KeyInput( rKEvt ); + + if( m_bAccelAction ) + m_bAccelAction = sal_False; +} + +//------------------------------------------------------------------------------ +sal_Bool OSqlEdit::IsInAccelAct() +{ + DBG_CHKTHIS(OSqlEdit,NULL); + // Das Cut, Copy, Paste per Accel. fuehrt neben der Aktion im Edit im View + // auch die entsprechenden Slots aus. Die Aktionen finden also zweimal statt. + // Um dies zu verhindern, kann im View beim SlotExec diese Funktion + // aufgerufen werden. + + return m_bAccelAction; +} + +//------------------------------------------------------------------------------ +void OSqlEdit::GetFocus() +{ + DBG_CHKTHIS(OSqlEdit,NULL); + m_strOrigText = GetText(); + MultiLineEdit::GetFocus(); +} + +//------------------------------------------------------------------------------ +IMPL_LINK(OSqlEdit, OnUndoActionTimer, void*, EMPTYARG) +{ + String aText = GetText(); + if(aText != m_strOrigText) + { + SfxUndoManager* pUndoMgr = m_pView->getController()->getUndoMgr(); + OSqlEditUndoAct* pUndoAct = new OSqlEditUndoAct( this ); + + pUndoAct->SetOriginalText( m_strOrigText ); + pUndoMgr->AddUndoAction( pUndoAct ); + + m_pView->getController()->InvalidateFeature(SID_UNDO); + m_pView->getController()->InvalidateFeature(SID_REDO); + + m_strOrigText = aText; + } + + return 0L; +} +//------------------------------------------------------------------------------ +IMPL_LINK(OSqlEdit, OnInvalidateTimer, void*, EMPTYARG) +{ + m_pView->getController()->InvalidateFeature(SID_CUT); + m_pView->getController()->InvalidateFeature(SID_COPY); + m_timerInvalidate.Start(); + return 0L; +} +//------------------------------------------------------------------------------ +IMPL_LINK(OSqlEdit, ModifyHdl, void*, EMPTYTAG) +{ + if (m_timerUndoActionCreation.IsActive()) + m_timerUndoActionCreation.Stop(); + m_timerUndoActionCreation.Start(); + + if (!m_pView->getController()->isModified()) + m_pView->getController()->setModified( sal_True ); + + m_pView->getController()->InvalidateFeature(SID_SBA_QRY_EXECUTE); + m_pView->getController()->InvalidateFeature(SID_CUT); + m_pView->getController()->InvalidateFeature(SID_COPY); + + m_lnkTextModifyHdl.Call(NULL); + return 0; +} + +//------------------------------------------------------------------------------ +void OSqlEdit::OverloadedSetText(const String& rNewText) +{ + DBG_CHKTHIS(OSqlEdit,NULL); + if (m_timerUndoActionCreation.IsActive()) + { // die noch anstehenden Undo-Action erzeugen + m_timerUndoActionCreation.Stop(); + LINK(this, OSqlEdit, OnUndoActionTimer).Call(NULL); + } + + MultiLineEdit::SetText(rNewText); + m_strOrigText = rNewText; + m_pView->getController()->setModified(sal_True); +} + +//============================================================================== diff --git a/dbaccess/source/ui/control/undosqledit.cxx b/dbaccess/source/ui/control/undosqledit.cxx new file mode 100644 index 000000000000..bf62fdf21336 --- /dev/null +++ b/dbaccess/source/ui/control/undosqledit.cxx @@ -0,0 +1,81 @@ +/************************************************************************* + * + * $RCSfile: undosqledit.cxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: oj $ $Date: 2001-01-09 16:07:35 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the License); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an AS IS basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef DBAUI_GENERALUNDO_HXX +#include "undosqledit.hxx" +#endif +#ifndef DBAUI_SQLEDIT_HXX +#include "sqledit.hxx" +#endif + +namespace dbaui +{ +//------------------------------------------------------------------------------ +void OSqlEditUndoAct::ToggleText() +{ + String strNext = m_pOwner->GetText(); + m_pOwner->OverloadedSetText(m_strNextText); + m_strNextText = strNext; +} +// ----------------------------------------------------------------------------- +} // namespace +// ----------------------------------------------------------------------------- + diff --git a/dbaccess/source/ui/control/undosqledit.src b/dbaccess/source/ui/control/undosqledit.src new file mode 100644 index 000000000000..01286b4b0568 --- /dev/null +++ b/dbaccess/source/ui/control/undosqledit.src @@ -0,0 +1,91 @@ +/************************************************************************* + * + * $RCSfile: undosqledit.src,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: oj $ $Date: 2001-01-09 16:07:44 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the License); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an AS IS basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef _DBU_RESOURCE_HRC_ +#include "dbu_resource.hrc" +#endif + +String STR_QUERY_UNDO_MODIFYSQLEDIT +{ + Text = "SQL modifizieren" ; + Text [ ENGLISH ] = "Modify SQL" ; + Text [ english_us ] = "Modify SQL statement(s)" ; + Text [ portuguese_brazilian ] = "SQL modifizieren" ; + Text [ swedish ] = "Modifiera SQL" ; + Text [ danish ] = "Modificer SQL" ; + Text [ italian ] = "Modifica SQL" ; + Text [ spanish ] = "Modificar SQL" ; + Text [ french ] = "Modifier le SQL" ; + Text [ dutch ] = "SQL modificeren" ; + Text [ portuguese ] = "Modificar SQL" ; + Text[ chinese_simplified ] = " SQL"; + Text[ russian ] = " SQL"; + Text[ polish ] = "Modyfikuj SQL"; + Text[ japanese ] = "SQL ̕ύX"; + Text[ chinese_traditional ] = "ק SQL"; + Text[ dutch ] = "SQL modificeren"; + Text[ chinese_simplified ] = " SQL"; + Text[ greek ] = " SQL"; + Text[ korean ] = "SQL "; + Text[ arabic ] = "SQL "; + Text[ turkish ] = "SQL deyimini deitir"; + Text[ language_user1 ] = " "; +}; diff --git a/dbaccess/source/ui/dlg/dlgsave.cxx b/dbaccess/source/ui/dlg/dlgsave.cxx new file mode 100644 index 000000000000..e31818197959 --- /dev/null +++ b/dbaccess/source/ui/dlg/dlgsave.cxx @@ -0,0 +1,148 @@ +/************************************************************************* + * + * $RCSfile: dlgsave.cxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: oj $ $Date: 2001-01-09 16:05:47 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the License); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an AS IS basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef DBAUI_DLGSAVE_HXX +#include "dlgsave.hxx" +#endif +#ifndef DBAUI_DLGSAVE_HRC +#include "dlgsave.hrc" +#endif +#ifndef _SV_MSGBOX_HXX //autogen +#include <vcl/msgbox.hxx> +#endif +#ifndef _DBU_RESOURCE_HRC_ +#include "dbu_resource.hrc" +#endif +#ifndef _DBAUI_MODULE_DBU_HXX_ +#include "moduledbu.hxx" +#endif +#ifndef _COM_SUN_STAR_SDB_COMMANDTYPE_HPP_ +#include <com/sun/star/sdb/CommandType.hpp> +#endif +#ifndef DBAUI_DLGERR_HXX +#include "dlgerr.hxx" +#endif + + +using namespace dbaui; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::container; +using namespace ::com::sun::star::sdb; + +//================================================================== +OSaveAsDlg::OSaveAsDlg( Window * pParent, + const sal_Int32& _rType, + const Reference<XNameAccess>& _rxNames, + const String& rDefault) + :ModalDialog( pParent, ModuleRes(DLG_SAVE_AS)) + ,m_aLabel(this, ResId (FT_TITLE)) + ,m_aTitle(this, ResId (ET_TITLE)) + ,m_aPB_OK(this, ResId( PB_OK ) ) + ,m_aPB_CANCEL(this, ResId( PB_CANCEL )) + ,m_aPB_HELP(this, ResId( PB_HELP)) + ,m_aQryLabel(ResId(STR_QRY_LABEL)) + ,m_aExists(ResId(STR_OBJECT_EXISTS_ALREADY)) + ,m_aName(rDefault) + ,m_xNames(_rxNames) +{ + switch (_rType) + { + case CommandType::QUERY: + m_aLabel.SetText(m_aQryLabel); + break; + default: + OSL_ENSURE(0,"Type not supported yet!"); + } + + m_aTitle.SetText(m_aName); + m_aPB_OK.SetClickHdl(LINK(this,OSaveAsDlg,ButtonClickHdl)); + m_aTitle.SetModifyHdl(LINK(this,OSaveAsDlg,EditModifyHdl)); + FreeResource(); +} + +IMPL_LINK(OSaveAsDlg, ButtonClickHdl, Button *, pButton) +{ + if (pButton == &m_aPB_OK) + { + m_aName = m_aTitle.GetText(); + + if(m_xNames->hasByName(m_aName)) + { + m_aTitle.GrabFocus(); + String aText(m_aExists); + aText.SearchAndReplace(String::CreateFromAscii("'$Name: not supported by cvs2svn $'"),m_aName); + OMsgBox aDlg(this,String(),aText,WB_YES_NO,OMsgBox::Query); + if(aDlg.Execute() == RET_NO) + EndDialog(RET_OK); + } + else + EndDialog(RET_OK); + } + return 0; +} + +IMPL_LINK(OSaveAsDlg, EditModifyHdl, Edit *, pEdit ) +{ + if (pEdit == &m_aTitle) + m_aPB_OK.Enable(m_aTitle.GetText().Len()); + return 0; +} + diff --git a/dbaccess/source/ui/dlg/dlgsave.hrc b/dbaccess/source/ui/dlg/dlgsave.hrc new file mode 100644 index 000000000000..451dc06cd915 --- /dev/null +++ b/dbaccess/source/ui/dlg/dlgsave.hrc @@ -0,0 +1,80 @@ +/************************************************************************* + * + * $RCSfile: dlgsave.hrc,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: oj $ $Date: 2001-01-09 16:05:30 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the License); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an AS IS basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef DBAUI_DLGSAVE_HRC +#define DBAUI_DLGSAVE_HRC + +// defines ------------------------------------------------------------------ + +#define PB_OK 1 +#define PB_CANCEL 1 +#define PB_HELP 1 +#define ET_TITLE 1 +#define FT_TITLE 1 +#define STR_TBL_LABEL 1 +#define STR_VW_LABEL 2 +#define STR_QRY_LABEL 3 +#define STR_FRM_LABEL 4 +#define STR_RPT_LABEL 5 +#define STR_OBJECT_EXISTS_ALREADY 6 + +#endif // DBAUI_DLGSAVE_HRC + diff --git a/dbaccess/source/ui/dlg/dlgsave.src b/dbaccess/source/ui/dlg/dlgsave.src new file mode 100644 index 000000000000..88431eb64a64 --- /dev/null +++ b/dbaccess/source/ui/dlg/dlgsave.src @@ -0,0 +1,256 @@ +/************************************************************************* + * + * $RCSfile: dlgsave.src,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: oj $ $Date: 2001-01-09 16:05:38 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the License); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an AS IS basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef DBAUI_DLGSAVE_HRC +#include "dlgsave.hrc" +#endif +#ifndef _DBU_RESOURCE_HRC_ +#include "dbu_resource.hrc" +#endif +#ifndef _DBA_DBACCESS_HELPID_HRC_ +#include "dbaccess_helpid.hrc" +#endif + +ModalDialog DLG_SAVE_AS +{ + OutputSize = TRUE ; + SVLook = TRUE ; + HelpId = HID_DLG_SAVE_AS ; + Size = MAP_APPFONT ( 174 , 45 ) ; + Moveable = TRUE ; + Closeable = TRUE ; + Text = "Speichern unter" ; + Text [ ENGLISH ] = "Save as" ; + Text [ english_us ] = "Save As" ; + FixedText FT_TITLE + { + Pos = MAP_APPFONT ( 6 , 7 ) ; + Size = MAP_APPFONT ( 70 , 10 ) ; + Text = "" ; + }; + Edit ET_TITLE + { + Border = TRUE ; + Pos = MAP_APPFONT ( 77 , 6 ) ; + Size = MAP_APPFONT ( 89 , 12 ) ; + Text = "" ; + TabStop = TRUE ; + }; + OKButton PB_OK + { + Pos = MAP_APPFONT ( 6 , 25 ) ; + Size = MAP_APPFONT ( 50 , 14 ) ; + TabStop = TRUE ; + DefButton = TRUE ; + }; + CancelButton PB_CANCEL + { + Pos = MAP_APPFONT ( 62 , 25 ) ; + Size = MAP_APPFONT ( 50 , 14 ) ; + TabStop = TRUE ; + }; + HelpButton PB_HELP + { + Pos = MAP_APPFONT ( 118 , 25 ) ; + Size = MAP_APPFONT ( 50 , 14 ) ; + TabStop = TRUE ; + }; + // String Resourcen ------------------------------------------------------------------ + String STR_TBL_LABEL + { + Text = "~Name der Tabelle" ; + Text [ ENGLISH ] = "Table name" ; + Text [ english_us ] = "Table name" ; + Text [ portuguese ] = "~Nome da tabela" ; + Text [ portuguese_brazilian ] = "Name der Tabelle" ; + Text [ swedish ] = "~Namn p tabell" ; + Text [ danish ] = "Tabellens navn" ; + Text [ italian ] = "~Nome della tabella" ; + Text [ spanish ] = "~Nombre de la tabla" ; + Text [ french ] = "Nom de la table" ; + Text [ dutch ] = "~Naam van de tabel" ; + Text[ chinese_simplified ] = ""; + Text[ russian ] = " "; + Text[ polish ] = "Nazwa tabeli"; + Text[ japanese ] = "ðٖ"; + Text[ chinese_traditional ] = "W"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "̺ ̸"; + Text[ turkish ] = "Tablo ad"; + }; + String STR_VW_LABEL + { + Text = "~Name der Tabellensicht" ; + Text [ ENGLISH ] = "View name" ; + Text [ english_us ] = "Name of table view" ; + Text [ portuguese ] = "Nome da ~vista da tabela" ; + Text [ portuguese_brazilian ] = "Name der Tabellensicht" ; + Text [ swedish ] = "~Namn p tabellvisning" ; + Text [ danish ] = "Tabelvisningens navn" ; + Text [ italian ] = "Nome della ~vista tabella" ; + Text [ spanish ] = "Nombre del ~modo tabla" ; + Text [ french ] = "~Nom de la vue" ; + Text [ dutch ] = "~Naam van de tabelweergave" ; + Text[ chinese_simplified ] = "ͼ"; + Text[ russian ] = " "; + Text[ polish ] = "Nazwa widoku tabeli"; + Text[ japanese ] = "ðޭ̖O"; + Text[ chinese_traditional ] = "˵W"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "̺ ̸"; + Text[ turkish ] = "Tablo grnm ad"; + }; + String STR_QRY_LABEL + { + Text = "~Name der Abfrage" ; + Text [ ENGLISH ] = "Query name" ; + Text [ english_us ] = "Query name" ; + Text [ portuguese ] = "Nome da ~consulta" ; + Text [ portuguese_brazilian ] = "Name der Abfrage" ; + Text [ swedish ] = "~Namn p skning" ; + Text [ danish ] = "Foresprgslens navn" ; + Text [ italian ] = "Nome della ~ricerca" ; + Text [ spanish ] = "Nombre de la ~consulta" ; + Text [ french ] = "Nom de la requte" ; + Text [ dutch ] = "~Naam van de query" ; + Text[ chinese_simplified ] = "ѯ"; + Text[ russian ] = " "; + Text[ polish ] = "Nazwa kwerendy"; + Text[ japanese ] = "ذ"; + Text[ chinese_traditional ] = "dߦW"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = " ̸"; + Text[ turkish ] = "Sorgu ad"; + }; + String STR_FRM_LABEL + { + Text = "~Name des Formulars" ; + Text [ ENGLISH ] = "Form name" ; + Text [ english_us ] = "Form name" ; + Text [ portuguese ] = "Nome do ~formulrio" ; + Text [ portuguese_brazilian ] = "Name des Formulars" ; + Text [ swedish ] = "~Namn p formulr" ; + Text [ danish ] = "Formularens navn" ; + Text [ italian ] = "Nome del ~formulario" ; + Text [ spanish ] = "Nombre del form~ulario" ; + Text [ french ] = "Nom du formulaire" ; + Text [ dutch ] = "~Naam van het formulier" ; + Text[ chinese_simplified ] = ""; + Text[ russian ] = " "; + Text[ polish ] = "Nazwa formularza"; + Text[ japanese ] = "̫і"; + Text[ chinese_traditional ] = "W"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = " ̸"; + Text[ turkish ] = "Form ad"; + }; + String STR_RPT_LABEL + { + Text = "~Name des Berichts" ; + Text [ ENGLISH ] = "Report name" ; + Text [ english_us ] = "Report name" ; + Text [ portuguese ] = "Nome do ~relatrio" ; + Text [ portuguese_brazilian ] = "Name des Berichts" ; + Text [ swedish ] = "~Namn p rapport" ; + Text [ danish ] = "Rapportens navn" ; + Text [ italian ] = "Nome del ra~pporto" ; + Text [ spanish ] = "Nombre del inform~e" ; + Text [ french ] = "Nom de l'tat" ; + Text [ dutch ] = "~Naam van het bericht" ; + Text[ chinese_simplified ] = ""; + Text[ russian ] = " "; + Text[ polish ] = "Nazwa raportu"; + Text[ japanese ] = "߰Ė"; + Text[ chinese_traditional ] = "W"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = " ̸"; + Text[ turkish ] = "Rapor ad"; + }; + String STR_OBJECT_EXISTS_ALREADY + { + Text = "Der Name '$Name: not supported by cvs2svn $' existiert bereits.\nBitte geben Sie einen neuen Namen an." ; + Text [ ENGLISH ] = "The name '$Name: not supported by cvs2svn $' does already exist.\nPlease enter a new name." ; + Text [ english_us ] = "The name '$Name: not supported by cvs2svn $' already exists.\nPlease enter a new name." ; + Text[ language_user1 ] = " "; + }; + Text [ portuguese_brazilian ] = "Speichern unter" ; + Text [ swedish ] = "Spara som" ; + Text [ danish ] = "Gem som" ; + Text [ italian ] = "Salva con nome" ; + Text [ spanish ] = "Guardar como" ; + Text [ french ] = "Enregistrer sous" ; + Text [ dutch ] = "Opslaan als" ; + Text [ portuguese ] = "Guardar como" ; + Text[ chinese_simplified ] = "Ϊ"; + Text[ russian ] = " "; + Text[ polish ] = "Zapisz jako"; + Text[ japanese ] = "Otĕۑ"; + Text[ chinese_traditional ] = "tss"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "ٸ ̸ "; + Text[ turkish ] = "Farkl kaydet"; +}; diff --git a/dbaccess/source/ui/dlg/makefile.mk b/dbaccess/source/ui/dlg/makefile.mk index 38930152ed57..2ca50a6b2f92 100644 --- a/dbaccess/source/ui/dlg/makefile.mk +++ b/dbaccess/source/ui/dlg/makefile.mk @@ -2,9 +2,9 @@ # # $RCSfile: makefile.mk,v $ # - # $Revision: 1.7 $ + # $Revision: 1.8 $ # - # last change: $Author: oj $ $Date: 2000-12-12 12:47:56 $ + # last change: $Author: oj $ $Date: 2001-01-09 16:06:51 $ # # The Contents of this file are made available subject to the terms of # either of the following licenses @@ -77,6 +77,9 @@ ENABLE_EXCEPTIONS=TRUE BMP_IN=$(PRJ)$/res SRCFILES = \ + dlgtext.src \ + dlgerr.src \ + dlgsave.src \ queryorder.src \ queryfilter.src \ paramdialog.src \ @@ -90,6 +93,9 @@ SRCFILES = \ # ... object files ............................ SLOFILES= \ + $(SLO)$/dlgtext.obj \ + $(SLO)$/dlgerr.obj \ + $(SLO)$/dlgsave.obj \ $(SLO)$/dlgsize.obj \ $(SLO)$/dlgattr.obj \ $(SLO)$/queryorder.obj \ @@ -110,6 +116,9 @@ SLOFILES= \ ######################################################################### # history: # $Log: not supported by cvs2svn $ + # Revision 1.7 2000/12/12 12:47:56 oj + # #80933# some new files + # # Revision 1.6 2000/11/10 16:12:36 oj # new files # diff --git a/dbaccess/source/ui/inc/GeneralUndo.hxx b/dbaccess/source/ui/inc/GeneralUndo.hxx new file mode 100644 index 000000000000..1b204cc01c2e --- /dev/null +++ b/dbaccess/source/ui/inc/GeneralUndo.hxx @@ -0,0 +1,90 @@ +/************************************************************************* + * + * $RCSfile: GeneralUndo.hxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: oj $ $Date: 2001-01-09 16:01:33 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the License); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an AS IS basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef DBAUI_GENERALUNDO_HXX +#define DBAUI_GENERALUNDO_HXX + +#ifndef _UNDO_HXX +#include <svtools/undo.hxx> +#endif +#ifndef _DBAUI_MODULE_DBU_HXX_ +#include "moduledbu.hxx" +#endif + +namespace dbaui +{ + // ================================================================================================ + // SbaCommentUndoAction - Undo-Basisklasse fuer Aktionen, deren GetComment einen aus einer Sba-Ressource + // geladenen String liefert + + class OCommentUndoAction : public SfxUndoAction + { + protected: + String m_strComment; // undo, redo comment + + public: + OCommentUndoAction(USHORT nCommentID) { m_strComment = String(ModuleRes(nCommentID)); } + + String getComment() const { return m_strComment; } + }; +} +#endif // DBAUI_GENERALUNDO_HXX + + diff --git a/dbaccess/source/ui/inc/QueryTextView.hxx b/dbaccess/source/ui/inc/QueryTextView.hxx new file mode 100644 index 000000000000..9b0b35694265 --- /dev/null +++ b/dbaccess/source/ui/inc/QueryTextView.hxx @@ -0,0 +1,132 @@ +/************************************************************************* + * + * $RCSfile: QueryTextView.hxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: oj $ $Date: 2001-01-09 16:02:43 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the License); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an AS IS basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef DBAUI_QUERYVIEW_TEXT_HXX +#define DBAUI_QUERYVIEW_TEXT_HXX + +#ifndef DBAUI_QUERYVIEW_HXX +#include "queryview.hxx" +#endif +#ifndef _COM_SUN_STAR_FRAME_XFRAME_HPP_ +#include <com/sun/star/frame/XFrame.hpp> +#endif + +class Splitter; + +namespace dbaui +{ + // tempoaray class until the beamer is implemented + class OBeamer : public Window + { + public: + OBeamer(Window* _pParent) : Window(_pParent){} + }; + + class OQueryTextView; + class OQueryContainerWindow : public Window + { + OQueryTextView* m_pView; + OBeamer* m_pBeamer; + Splitter* m_pSplitter; + ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > m_xBeamer; + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer > m_xMe; // our own UNO representation + + DECL_LINK( SplitHdl, void* ); + public: + OQueryContainerWindow(Window* pParent, OQueryController* _pController,const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&); + ~OQueryContainerWindow(); + + virtual void Resize(); + void showBeamer(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _xFrame); + void hideBeamer(); + void initialize(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _xFrame); + OQueryTextView * getView() { return m_pView; } + }; + // end of temp classes + + class OSqlEdit; + class OQueryTextView : public OQueryView + { + OSqlEdit* m_pEdit; + public: + OQueryTextView(Window* pParent, OQueryController* _pController,const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& ); + virtual ~OQueryTextView(); + + virtual sal_Bool isCutAllowed(); + virtual void copy(); + virtual void cut(); + virtual void paste(); + // clears the whole query + virtual void clear(); + // set the view readonly or not + virtual void setReadOnly(sal_Bool _bReadOnly); + // set the statement for representation + virtual void setStatement(const ::rtl::OUString& _rsStatement); + virtual ::rtl::OUString getStatement(); + /// late construction + virtual void Construct(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& xModel); + protected: + // return the Rectangle where I can paint myself + virtual void resizeControl(Rectangle& rRect); + }; +} +#endif // DBAUI_QUERYVIEW_TEXT_HXX + + diff --git a/dbaccess/source/ui/inc/browserids.hxx b/dbaccess/source/ui/inc/browserids.hxx new file mode 100644 index 000000000000..f07864f5ebd7 --- /dev/null +++ b/dbaccess/source/ui/inc/browserids.hxx @@ -0,0 +1,120 @@ +/************************************************************************* + * + * $RCSfile: browserids.hxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: oj $ $Date: 2001-01-09 16:02:22 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the License); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an AS IS basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef DBACCESS_UI_BROWSER_ID_HXX +#define DBACCESS_UI_BROWSER_ID_HXX + +#ifndef _SBASLTID_HRC +#include <offmgr/sbasltid.hrc> +#endif + +#define ID_BROWSER_COPY SID_COPY +#define ID_BROWSER_CUT SID_CUT +#define ID_BROWSER_EDITDOC SID_EDITDOC +#define ID_BROWSER_UNDORECORD SID_UNDO +#define ID_BROWSER_PASTE SID_PASTE +#define ID_BROWSER_REDO SID_REDO +#define ID_BROWSER_SAVEDOC SID_SAVEDOC +#define ID_BROWSER_TITLE SID_DOCINFO_TITLE +#define ID_BROWSER_UNDO SID_UNDO +#define ID_BROWSER_INSERTCOLUMNS SID_SBA_BRW_INSERT +#define ID_BROWSER_FORMLETTER SID_SBA_BRW_MERGE +#define ID_BROWSER_INSERTCONTENT SID_SBA_BRW_UPDATE + +#define ID_BROWSER_SEARCH SID_FM_SEARCH +#define ID_BROWSER_SORTUP SID_FM_SORTUP +#define ID_BROWSER_SORTDOWN SID_FM_SORTDOWN +#define ID_BROWSER_AUTOFILTER SID_FM_AUTOFILTER +#define ID_BROWSER_FILTERCRIT SID_FM_FILTERCRIT +#define ID_BROWSER_ORDERCRIT SID_FM_ORDERCRIT +#define ID_BROWSER_REMOVEFILTER SID_FM_REMOVE_FILTER_SORT +#define ID_BROWSER_FILTERED SID_FM_FORM_FILTERED +#define ID_BROWSER_REFRESH SID_FM_REFRESH +#define ID_BROWSER_EXPL_PREVLEVEL SID_EXPLORER_PREVLEVEL +#define ID_BROWSER_COLATTRSET 1 // Spaltenformatierung +#define ID_BROWSER_COLWIDTH 2 // Spaltenbreite +#define ID_BROWSER_TABLEATTR 3 // table format attributes +#define ID_BROWSER_ROWHEIGHT 4 // Zeilenhoehe +#define ID_BROWSER_COUNTALL SID_FM_COUNTALL // count all +#define ID_BROWSER_SQL SID_SOURCEVIEW +#define ID_BROWSER_ADDTABLE SID_FM_ADDTABLE +#define ID_BROWSER_DESIGN (SID_SBA_START+120) +#define ID_BROWSER_EXPLORER SID_DSBROWSER_EXPLORER + +// menu MENU_BROWSERTREE_CONTEXT +#define ID_TREE_ADMINISTRATE 1 +#define ID_TREE_CLOSE_CONN 2 +#define ID_TREE_REBUILD_CONN 3 +#define ID_TREE_QUERY_CREATE 4 +#define ID_TREE_QUERY_EDIT 5 +#define ID_TREE_QUERY_DELETE 6 + +#define ID_BROWSER_QUERY_EXECUTE SID_FM_EXECUTE +#define ID_BROWSER_CLEAR_QUERY (SID_SBA_START+130) +#define ID_BROWSER_QUERY_VIEW_FUNCTIONS (SID_SBA_START+134) +#define ID_BROWSER_QUERY_VIEW_TABLES (SID_SBA_START+135) +#define ID_BROWSER_QUERY_VIEW_ALIASES (SID_SBA_START+136) +#define ID_BROWSER_QUERY_DISTINCT_VALUES (SID_SBA_START+137) +#define ID_BROWSER_CLOSE SID_CLOSEDOC +#define ID_BROWSER_ESACPEPROCESSING SID_FM_NATIVESQL + + + +#endif // DBACCESS_UI_BROWSER_ID_HXX diff --git a/dbaccess/source/ui/inc/brwctrlr.hxx b/dbaccess/source/ui/inc/brwctrlr.hxx index 5c6947b01f7b..e2046291f69f 100644 --- a/dbaccess/source/ui/inc/brwctrlr.hxx +++ b/dbaccess/source/ui/inc/brwctrlr.hxx @@ -2,9 +2,9 @@ * * $RCSfile: brwctrlr.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: fs $ $Date: 2000-11-07 18:37:50 $ + * last change: $Author: oj $ $Date: 2001-01-09 16:03:40 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -77,15 +77,6 @@ #ifndef _COM_SUN_STAR_FORM_XRESETLISTENER_HPP_ #include <com/sun/star/form/XResetListener.hpp> #endif -#ifndef _COM_SUN_STAR_UTIL_XURLTRANSFORMER_HPP_ -#include <com/sun/star/util/XURLTransformer.hpp> -#endif -#ifndef _COM_SUN_STAR_FRAME_XCONTROLLER_HPP_ -#include <com/sun/star/frame/XController.hpp> -#endif -#ifndef _COM_SUN_STAR_FRAME_XFRAMEACTIONLISTENER_HPP_ -#include <com/sun/star/frame/XFrameActionListener.hpp> -#endif #ifndef _COM_SUN_STAR_FORM_XDATABASEPARAMETERLISTENER_HPP_ #include <com/sun/star/form/XDatabaseParameterListener.hpp> #endif @@ -95,9 +86,6 @@ #ifndef _COM_SUN_STAR_FORM_XFORMCOMPONENT_HPP_ #include <com/sun/star/form/XFormComponent.hpp> #endif -#ifndef _COM_SUN_STAR_LANG_XINITIALIZATION_HPP_ -#include <com/sun/star/lang/XInitialization.hpp> -#endif #ifndef _SV_TIMER_HXX //autogen #include <vcl/timer.hxx> #endif @@ -110,111 +98,42 @@ #ifndef _SFXCANCEL_HXX //autogen #include <svtools/cancel.hxx> #endif -#ifndef _CPPUHELPER_IMPLBASE12_HXX_ -#include <cppuhelper/implbase12.hxx> -#endif -#ifndef _CPPUHELPER_IMPLBASE2_HXX_ -#include <cppuhelper/implbase2.hxx> +#ifndef _CPPUHELPER_IMPLBASE5_HXX_ +#include <cppuhelper/implbase5.hxx> #endif #ifndef _COMPHELPER_PROPERTY_ARRAY_HELPER_HXX_ #include <comphelper/proparrhlp.hxx> #endif -#ifndef _DBAUI_MODULE_DBU_HXX_ -#include "moduledbu.hxx" -#endif -#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_ -#include <com/sun/star/lang/XServiceInfo.hpp> -#endif #ifndef _COMPHELPER_PROPERTYCONTAINER_HXX_ #include <comphelper/propertycontainer.hxx> #endif +#ifndef DBAUI_GENERICCONTROLLER_HXX +#include "genericcontroller.hxx" +#endif -class ToolBox; class ResMgr; struct FmFoundRecordInformation; struct FmSearchContext; namespace dbaui { - // ========================================================================= - // a helper for multi-threaded handling of async events - // ------------------------------------------------------------------------- - /** handles asynchronous links which may be called in multi-threaded environments - If you use an instance of this class as member of your own class, it will handle - several crucial points for you (for instance the case that somebody posts the - event while another thread tries to delete this event in the _destructor_ of the - class). - */ - class OAsyncronousLink - { - Link m_aHandler; - - protected: - NAMESPACE_VOS(OMutex)* m_pEventSafety; - NAMESPACE_VOS(OMutex)* m_pDestructionSafety; - BOOL m_bOwnMutexes; - ULONG m_nEventId; - - public: - /** constructs the object - @param _rHandler The link to be called asyncronously - @param _pEventSafety A pointer to a mutex to be used for event safety. See below. - @param _pDestructionSafety A pointer to a mutex to be used for destruction safety. See below. - - For a really safe behaviour two mutexes are required. In case your class needs more than one - OAsyncronousLink instance, you may want to share these mutexes (and hold them as members of - your class). Thus, if _pEventSafety and _pDestructionSafety are both non-NULL, they will be - used for the thread-safety of the link. Otherwise the instance will create it's own mutexes. - <BR> - If you use this "mutex feature" be aware of the lifetime of all involved objects : the mutexes - you specify upon construction should live (at least) as long as the OAsyncronousLink object does. - */ - OAsyncronousLink(const Link& _rHandler, NAMESPACE_VOS(OMutex)* _pEventSafety = NULL, NAMESPACE_VOS(OMutex)* _pDestructionSafety = NULL); - virtual ~OAsyncronousLink(); - - void Call(void* _pArgument = NULL); - void CancelCall(); - - protected: - DECL_LINK(OnAsyncCall, void*); - }; - // a smaller version of the FeatureEvent to be broadcasted by an ::com::sun::star::frame::XController - // ------------------------------------------------------------------------- - struct FeatureState - { - ::com::sun::star::uno::Any aState; - sal_Bool bEnabled; - sal_Bool bRequery; - - FeatureState() : bEnabled(sal_False), bRequery(sal_False) { } - }; // ========================================================================= - typedef ::cppu::WeakImplHelper12< ::com::sun::star::frame::XController - , ::com::sun::star::frame::XDispatch - , ::com::sun::star::frame::XDispatchProviderInterceptor - , ::com::sun::star::beans::XPropertyChangeListener - , ::com::sun::star::util::XModifyListener - , ::com::sun::star::container::XContainerListener - , ::com::sun::star::frame::XFrameActionListener - , ::com::sun::star::sdb::XSQLErrorListener - , ::com::sun::star::form::XDatabaseParameterListener - , ::com::sun::star::form::XConfirmDeleteListener - , ::com::sun::star::form::XLoadListener - , ::com::sun::star::form::XResetListener > SbaXDataBrowserController_Base; - - typedef ::cppu::ImplHelper2< ::com::sun::star::lang::XInitialization - ,::com::sun::star::lang::XServiceInfo > SbaXDataBrowserController_Base2; + typedef ::cppu::ImplHelper5< ::com::sun::star::sdb::XSQLErrorListener + , ::com::sun::star::form::XDatabaseParameterListener + , ::com::sun::star::form::XConfirmDeleteListener + , ::com::sun::star::form::XLoadListener + , ::com::sun::star::form::XResetListener + > SbaXDataBrowserController_Base; class SbaXDataBrowserController - :public SbaXDataBrowserController_Base + :public OGenericUnoController + ,public SbaXDataBrowserController_Base ,public ::comphelper::OPropertyContainer ,public SbaGridListener ,public ::comphelper::OPropertyArrayUsageHelper < SbaXDataBrowserController> - ,public dbaui::OModuleClient - ,public SbaXDataBrowserController_Base2 { // ========== // attributes @@ -224,7 +143,6 @@ namespace dbaui ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter > m_xFormatter; // a number formatter working with the connection's NumberFormatsSupplier ::osl::Mutex m_aAsyncLoadSafety; // for multi-thread access to our members - UnoDataBrowserView* m_pContent; // our (VCL) "main window" // members for asynchronous load operations ::vos::OThread* m_pLoadThread; // the thread wherein the form is loaded sal_uInt32 m_nPendingLoadFinished; // the event used to tell ourself that the load is finished @@ -232,26 +150,8 @@ namespace dbaui OAsyncronousLink m_aAsynClose; OAsyncronousLink m_aAsyncGetCellFocus; - OAsyncronousLink m_aAsyncInvalidateAll; ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSQLQueryComposer > m_xParser; // for sorting 'n filtering - ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider > m_xSlaveDispatcher; // for intercepting dispatches of the grid control - ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider > m_xMasterDispatcher; // dito - - // ------------------ - struct DispatchTarget - { - ::com::sun::star::util::URL aURL; - ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener > xListener; - - DispatchTarget() { } - DispatchTarget(const ::com::sun::star::util::URL& rURL, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener > xRef) : aURL(rURL), xListener(xRef) { } - }; - - // all our listeners where we dispatch status changes - DECLARE_STL_VECTOR(DispatchTarget,Dispatch); - Dispatch m_arrStatusListener; - String m_sStateSaveRecord; String m_sStateUndoRecord; @@ -261,19 +161,9 @@ namespace dbaui ::cppu::OBroadcastHelper m_aPropertyBroadcastHelper; protected: - DECLARE_STL_MAP(::rtl::OUString, sal_Int32, ::std::less< ::rtl::OUString >, SupportedFeatures); - SupportedFeatures m_aSupportedFeatures; - ::osl::Mutex m_aPropertyMutex; - ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > m_xCurrentFrame; // the frame we're residing in - - ::cppu::OInterfaceContainerHelper m_aDisposeListeners; // clear enough - - sal_Bool m_bCurrentlyModified : 1; // the RecordStatus of the form is insufficient for deciding whether the current record is modified // because it doesn't reflect the state of the current cell sal_Bool m_bLoadCanceled : 1; // the load was canceled somehow - sal_Bool m_bFrameUiActive : 1; // updated in ::frameAction - sal_Bool m_bSuspending : 1; // we're within suspend String m_sLoadStopperCaption; // If the data source is loaded asynchronously a stopper is created (which will result in activation of @@ -281,12 +171,6 @@ namespace dbaui AutoTimer m_aInvalidateClipboard; // for testing the state of the CUT/COPY/PASTE-slots - ::com::sun::star::uno::Reference< ::com::sun::star::util::XURLTransformer > m_xUrlTransformer; // needed sometimes - - DECLARE_STL_MAP(sal_uInt16,FeatureState,::std::less<sal_uInt16> ,StateCache); - StateCache m_aStateCache; - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xMultiServiceFacatory; - class FormErrorHelper { SbaXDataBrowserController* m_pOwner; @@ -307,8 +191,6 @@ namespace dbaui sal_Bool isValid() const { return m_xRowSet.is() && m_xGridModel.is(); } sal_Bool isValidCursor() const; // checks the ::com::sun::star::data::XDatabaseCursor-interface of m_xRowSet - UnoDataBrowserView* getContent() const { return m_pContent; } - protected: ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSQLQueryComposer > getParser() const { return m_xParser; } @@ -320,6 +202,7 @@ namespace dbaui public: SbaXDataBrowserController(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rM); + UnoDataBrowserView* getBrowserView() const { return static_cast< UnoDataBrowserView*>(m_pView); } // late construction virtual sal_Bool Construct(Window* pParent); @@ -340,34 +223,32 @@ namespace dbaui virtual void SAL_CALL elementRemoved(const ::com::sun::star::container::ContainerEvent& Event) throw( ::com::sun::star::uno::RuntimeException ); virtual void SAL_CALL elementReplaced(const ::com::sun::star::container::ContainerEvent& Event) throw( ::com::sun::star::uno::RuntimeException ); - // ::com::sun::star::frame::XController - virtual void SAL_CALL attachFrame(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > & xFrame) throw( ::com::sun::star::uno::RuntimeException ); - virtual sal_Bool SAL_CALL attachModel(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > & xModel) throw( ::com::sun::star::uno::RuntimeException ){ return sal_False; }; +// // ::com::sun::star::frame::XController + // virtual void SAL_CALL attachFrame(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > & xFrame) throw( ::com::sun::star::uno::RuntimeException ); +// virtual sal_Bool SAL_CALL attachModel(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > & xModel) throw( ::com::sun::star::uno::RuntimeException ){ return sal_False; }; virtual sal_Bool SAL_CALL suspend(sal_Bool bSuspend) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Any SAL_CALL getViewData(void) throw( ::com::sun::star::uno::RuntimeException ){ return ::com::sun::star::uno::Any(); }; - virtual void SAL_CALL restoreViewData(const ::com::sun::star::uno::Any& Data) throw( ::com::sun::star::uno::RuntimeException ){}; - virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > SAL_CALL getModel(void) throw( ::com::sun::star::uno::RuntimeException ){ return ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > (); }; - virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > SAL_CALL getFrame(void) throw( ::com::sun::star::uno::RuntimeException ){ return m_xCurrentFrame; }; - - // ::com::sun::star::frame::XDispatch - virtual void SAL_CALL dispatch(const ::com::sun::star::util::URL& aURL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& aArgs); - virtual void SAL_CALL addStatusListener(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener > & aListener, const ::com::sun::star::util::URL& aURL); - virtual void SAL_CALL removeStatusListener(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener > & aListener, const ::com::sun::star::util::URL& aURL); - - // ::com::sun::star::frame::XDispatchProviderInterceptor - virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider > SAL_CALL getSlaveDispatchProvider(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL setSlaveDispatchProvider(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider > & _xNewProvider) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider > SAL_CALL getMasterDispatchProvider(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL setMasterDispatchProvider(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider > & _xNewProvider) throw( ::com::sun::star::uno::RuntimeException ); - - // ::com::sun::star::frame::XDispatchProvider - virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > SAL_CALL queryDispatch(const ::com::sun::star::util::URL& aURL, const ::rtl::OUString& aTargetFrameName, sal_Int32 nSearchFlags) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > > SAL_CALL queryDispatches(const ::com::sun::star::uno::Sequence< ::com::sun::star::frame::DispatchDescriptor >& aDescripts) throw( ::com::sun::star::uno::RuntimeException ); - +// virtual ::com::sun::star::uno::Any SAL_CALL getViewData(void) throw( ::com::sun::star::uno::RuntimeException ){ return ::com::sun::star::uno::Any(); }; +// virtual void SAL_CALL restoreViewData(const ::com::sun::star::uno::Any& Data) throw( ::com::sun::star::uno::RuntimeException ){}; +// virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > SAL_CALL getModel(void) throw( ::com::sun::star::uno::RuntimeException ){ return ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > (); }; +// virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > SAL_CALL getFrame(void) throw( ::com::sun::star::uno::RuntimeException ){ return m_xCurrentFrame; }; +// +// // ::com::sun::star::frame::XDispatch +// virtual void SAL_CALL dispatch(const ::com::sun::star::util::URL& aURL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& aArgs); +// virtual void SAL_CALL addStatusListener(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener > & aListener, const ::com::sun::star::util::URL& aURL); +// virtual void SAL_CALL removeStatusListener(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener > & aListener, const ::com::sun::star::util::URL& aURL); +// +// // ::com::sun::star::frame::XDispatchProviderInterceptor +// virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider > SAL_CALL getSlaveDispatchProvider(void) throw( ::com::sun::star::uno::RuntimeException ); +// virtual void SAL_CALL setSlaveDispatchProvider(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider > & _xNewProvider) throw( ::com::sun::star::uno::RuntimeException ); +// virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider > SAL_CALL getMasterDispatchProvider(void) throw( ::com::sun::star::uno::RuntimeException ); +// virtual void SAL_CALL setMasterDispatchProvider(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider > & _xNewProvider) throw( ::com::sun::star::uno::RuntimeException ); +// +// // ::com::sun::star::frame::XDispatchProvider +// virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > SAL_CALL queryDispatch(const ::com::sun::star::util::URL& aURL, const ::rtl::OUString& aTargetFrameName, sal_Int32 nSearchFlags) throw( ::com::sun::star::uno::RuntimeException ); +// virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > > SAL_CALL queryDispatches(const ::com::sun::star::uno::Sequence< ::com::sun::star::frame::DispatchDescriptor >& aDescripts) throw( ::com::sun::star::uno::RuntimeException ); +// // ::com::sun::star::lang::XComponent virtual void SAL_CALL dispose(); - virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener); - virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener); // ::com::sun::star::frame::XFrameActionListener virtual void SAL_CALL frameAction(const ::com::sun::star::frame::FrameActionEvent& aEvent) throw( ::com::sun::star::uno::RuntimeException ); @@ -391,12 +272,6 @@ namespace dbaui // ::com::sun::star::form::XResetListener virtual sal_Bool SAL_CALL approveReset(const ::com::sun::star::lang::EventObject& rEvent) throw( ::com::sun::star::uno::RuntimeException ); virtual void SAL_CALL resetted(const ::com::sun::star::lang::EventObject& rEvent) throw( ::com::sun::star::uno::RuntimeException ); - // lang::XInitialization - virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw(::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException); - // XServiceInfo - virtual ::rtl::OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException) = 0; - virtual sal_Bool SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw(::com::sun::star::uno::RuntimeException); - virtual ::comphelper::StringSequence SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException) = 0; // XPropertySet virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException) @@ -415,6 +290,12 @@ namespace dbaui virtual ~SbaXDataBrowserController(); // -------------------- // our own overridables + // all the features which should be handled by this class + virtual void AddSupportedFeatures(); + // state of a feature. 'feature' may be the handle of a ::com::sun::star::util::URL somebody requested a dispatch interface for OR a toolbar slot. + virtual FeatureState GetState(sal_uInt16 nId); + // execute a feature + virtual void Execute(sal_uInt16 nId); virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet > CreateForm(); // our default implementation simply instantiates a stardiv.one.form.component.Form service @@ -437,10 +318,6 @@ namespace dbaui // // the form returned by getDataSource() is already valid so you may want to use it ... - virtual ToolBox* CreateToolBox(Window* pParent) { return NULL; } - // If you want a toolbar to be displayed at the top of the grid overload this function. - // The ToolBox returned here has to be fully initialized (you get no further chance ;) - // the default implementation of disposing distributes the events to the following disposingXXX functions virtual void disposingGridControl(const ::com::sun::star::lang::EventObject& Source); // calls removeControlListeners virtual void disposingGridModel(const ::com::sun::star::lang::EventObject& Source); // calls removeModelListeners @@ -459,24 +336,7 @@ namespace dbaui virtual void AddColumnListener(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & xCol); virtual void RemoveColumnListener(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & xCol); - // all the features which should be handled by this class - virtual void AddSupportedFeatures(); - // the features have to be sorted alphabetically ! - // (and please keep in mind that a _reference_ to a sequence is returned !) - - // state of a feature. 'feature' may be the handle of a ::com::sun::star::util::URL somebody requested a dispatch interface for OR a toolbar slot. - virtual FeatureState GetState(sal_uInt16 nId); - // execute a feature - virtual void Execute(sal_uInt16 nId); - virtual void InvalidateFeature(const ::rtl::OUString& rURLPath, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener > & xListener = ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener > (), sal_Bool _bForceBroadcast = sal_False); - // if xListener is NULL the change will be forwarded to all listeners to the given ::com::sun::star::util::URL - // if _bForceBroadcast is sal_True, the current feature state is broadcasted no matter if it is the same as the cached state - virtual void InvalidateFeature(sal_uInt16 nId, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener > & xListener = ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener > (), sal_Bool _bForceBroadcast = sal_False); - // if there is an ::com::sun::star::util::URL translation for the id ('handle') the preceding InvalidateFeature is used. - // if there is a toolbar slot with the given id it is updated (the new state is determined via GetState) - // if _bForceBroadcast is sal_True, the current feature state is broadcasted no matter if it is the same as the cached state - virtual void InvalidateAll(sal_Bool bAsync = sal_False); // call after "major changes" (e.g. the completion of the async load). // invalidates all toolbox slots and all supported features. @@ -491,7 +351,7 @@ namespace dbaui // called if the loading is done (no matter if synchron or asynchron). // -------------------- - virtual void EmptyWindow(); + // empty the frame where our view resides virtual sal_Bool CommitCurrent(); // commit the current column (i.e. cell) @@ -515,24 +375,13 @@ namespace dbaui // So for error recognition the above methods may be used. // init the formatter if form changes void initFormatter(); - - // gets the URL which the given id is assigned to - ::com::sun::star::util::URL getURLForId(sal_Int32 _nId) const; - private: - // invalidate features - implementation - sal_Bool ImplInvalidateTBItem(sal_uInt16 nId, const FeatureState& rState); - void ImplBroadcastFeatureState(const ::rtl::OUString& _rFeature, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener > & xListener, sal_Bool _bIgnoreCache); - // execute the filter or sort slot void ExecuteFilterSortCrit(sal_Bool bFilter); // execute the search slot void ExecuteSearch(); - // click a TB slot - DECL_LINK(OnToolBoxSelected, ToolBox*); - // time to check the CUT/COPY/PASTE-slot-states DECL_LINK(OnInvalidateClipboard, void*); @@ -550,7 +399,6 @@ namespace dbaui // but playing with this mutex seems very hazardous to me ....) DECL_LINK(OnAsyncClose, void*); DECL_LINK(OnAsyncGetCellFocus, void*); - DECL_LINK(OnAsyncInvalidateAll, void*); }; //================================================================== diff --git a/dbaccess/source/ui/inc/brwview.hxx b/dbaccess/source/ui/inc/brwview.hxx index 40c1b7372c77..6146ffa25b9a 100644 --- a/dbaccess/source/ui/inc/brwview.hxx +++ b/dbaccess/source/ui/inc/brwview.hxx @@ -2,9 +2,9 @@ * * $RCSfile: brwview.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: fs $ $Date: 2000-12-08 21:12:31 $ + * last change: $Author: oj $ $Date: 2001-01-09 16:03:40 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -74,20 +74,13 @@ #include <tools/resid.hxx> #endif -#ifndef _COM_SUN_STAR_AWT_XCONTROLCONTAINER_HPP_ -#include <com/sun/star/awt/XControlContainer.hpp> -#endif #ifndef _COM_SUN_STAR_AWT_POSSIZE_HPP_ #include <com/sun/star/awt/PosSize.hpp> #endif -#ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_ -#include <com/sun/star/lang/XMultiServiceFactory.hpp> -#endif -#ifndef _COM_SUN_STAR_UNO_REFERENCE_HXX_ -#include <com/sun/star/uno/Reference.hxx> +#ifndef DBAUI_DATAVIEW_HXX +#include "dataview.hxx" #endif - // ========================================================================= class ResMgr; class Splitter; @@ -98,17 +91,12 @@ namespace dbaui class DBTreeView; class SbaGridControl; - class UnoDataBrowserView : public Window + class UnoDataBrowserView : public ODataView { protected: - ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer > m_xMe; // our own UNO representation ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > m_xGrid; // our grid's UNO representation - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceFactory; // the service factory to work with - - DBTreeView* m_pTreeView; Splitter* m_pSplitter; - ToolBox* m_pToolBox; // our toolbox (may be NULL) SbaGridControl* m_pVclControl; // our grid's VCL representation DECL_LINK( SplitHdl, void* ); @@ -116,9 +104,6 @@ namespace dbaui public: ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > getGridControl() const { return m_xGrid; } SbaGridControl* getVclControl() const { return m_pVclControl; } - ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer > getContainer() const { return m_xMe; } - - ToolBox* getToolBox() const { return m_pToolBox; } public: UnoDataBrowserView(Window* pParent, const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& ); @@ -135,20 +120,12 @@ namespace dbaui /// for the same reason the view column count isn't the same as the model column count sal_uInt16 ViewColumnCount() const; - /** use this if you want to have a ToolBox to be displayed at the top of the grid control - The ownership of the window specified by pTB is transfered to this view object itself, - i.e. it is deleted in the destructor (or in the next call to setToolBox). - Specify a NULL pointer if you want to remove an existing ToolBox. - */ - void setToolBox(ToolBox* pTB); void setSplitter(Splitter* _pSplitter); void setTreeView(DBTreeView* _pTreeView); - // window overridables - virtual void Resize(); - protected: virtual void GetFocus(); + virtual void resizeControl(Rectangle& rRect); }; } #endif // _SBX_BRWVIEW_HXX diff --git a/dbaccess/source/ui/inc/dbu_resource.hrc b/dbaccess/source/ui/inc/dbu_resource.hrc index d047d5d8fc74..59eb6fe54663 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.16 $ + * $Revision: 1.17 $ * - * last change: $Author: fs $ $Date: 2001-01-04 11:19:55 $ + * last change: $Author: oj $ $Date: 2001-01-09 16:03:40 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -91,6 +91,9 @@ #define DLG_ROWHEIGHT RID_DIALOG_START + 8 #define DLG_COLWIDTH RID_DIALOG_START + 9 #define DLG_ATTR RID_DIALOG_START + 10 +#define DLG_SAVE_AS RID_DIALOG_START + 11 +#define DLG_ERROR RID_DIALOG_START + 12 +#define DLG_TEXT RID_DIALOG_START + 13 //======================================================================== // tab pages @@ -115,6 +118,9 @@ #define QUERY_BRW_DELETE_ROWS RID_QUERYBOX_START + 0 #define QUERY_BRW_SAVEMODIFIED RID_QUERYBOX_START + 1 +#define QUERY_BRW_DELETE_QUERY RID_QUERYBOX_START + 2 +#define QUERY_CONNECTION_LOST RID_QUERYBOX_START + 3 +#define QUERY_BRW_DELETE_QUERY_CONFIRM RID_QUERYBOX_START + 4 //======================================================================== // toolboxes @@ -122,6 +128,7 @@ #define RID_BRW_TAB_TOOLBOX RID_TOOLBOX_START + 0 #define RID_BRW_QRY_TOOLBOX RID_TOOLBOX_START + 1 #define RID_QRY_TOOLBOX_SQL RID_TOOLBOX_START + 2 +#define RID_BRW_QUERYDESIGN_TOOLBOX RID_TOOLBOX_START + 3 //======================================================================== // bitmaps @@ -216,6 +223,9 @@ /************************************************************************* * history: * $Log: not supported by cvs2svn $ + * Revision 1.16 2001/01/04 11:19:55 fs + * #81485# +PAGE_ADO + * * Revision 1.15 2000/12/12 12:30:16 oj * #80933# new dialog ids * diff --git a/dbaccess/source/ui/inc/dlgsave.hxx b/dbaccess/source/ui/inc/dlgsave.hxx new file mode 100644 index 000000000000..0cf427a12ad0 --- /dev/null +++ b/dbaccess/source/ui/inc/dlgsave.hxx @@ -0,0 +1,114 @@ +/************************************************************************* + * + * $RCSfile: dlgsave.hxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: oj $ $Date: 2001-01-09 16:01:42 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the License); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an AS IS basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef DBAUI_DLGSAVE_HXX +#define DBAUI_DLGSAVE_HXX + +#ifndef _DIALOG_HXX //autogen +#include <vcl/dialog.hxx> +#endif +#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 _COM_SUN_STAR_CONTAINER_XNAMEACCESS_HPP_ +#include <com/sun/star/container/XNameAccess.hpp> +#endif +#ifndef _SV_MSGBOX_HXX +#include <vcl/msgbox.hxx> +#endif + +namespace dbaui +{ + class OSaveAsDlg : public ModalDialog + { + private: + FixedText m_aLabel; + Edit m_aTitle; + OKButton m_aPB_OK; + CancelButton m_aPB_CANCEL; + HelpButton m_aPB_HELP; + String m_aQryLabel; + String m_aName; + String m_aExists; + ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess> m_xNames; + + + public: + OSaveAsDlg( Window * pParent,const sal_Int32& _rType, + const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess>& _rxNames, + const String& rDefault); + + String getName() const { return m_aName; } + private: + DECL_LINK(ButtonClickHdl, Button *); + DECL_LINK(EditModifyHdl, Edit * ); + }; +} + +#endif // DBAUI_DLGSAVE_HXX + + + diff --git a/dbaccess/source/ui/inc/exsrcbrw.hxx b/dbaccess/source/ui/inc/exsrcbrw.hxx index 1c9e2ed80cb8..95728cd8c680 100644 --- a/dbaccess/source/ui/inc/exsrcbrw.hxx +++ b/dbaccess/source/ui/inc/exsrcbrw.hxx @@ -2,9 +2,9 @@ * * $RCSfile: exsrcbrw.hxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: oj $ $Date: 2000-10-26 14:45:18 $ + * last change: $Author: oj $ $Date: 2001-01-09 16:03:40 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -152,7 +152,7 @@ namespace dbaui SAL_CALL Create(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&); // UNO - DECLARE_UNO3_DEFAULTS(SbaExternalSourceBrowser, SbaXDataBrowserController_Base); + DECLARE_UNO3_DEFAULTS(SbaExternalSourceBrowser, OGenericUnoController); virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(const ::com::sun::star::uno::Type& _rType) throw (::com::sun::star::uno::RuntimeException); // virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XIdlClass > > getIdlClasses(void); diff --git a/dbaccess/source/ui/inc/querycontroller.hxx b/dbaccess/source/ui/inc/querycontroller.hxx new file mode 100644 index 000000000000..0d178fb0ee9d --- /dev/null +++ b/dbaccess/source/ui/inc/querycontroller.hxx @@ -0,0 +1,103 @@ +#ifndef DBAUI_QUERYCONTROLLER_HXX +#define DBAUI_QUERYCONTROLLER_HXX + +#ifndef DBAUI_GENERICCONTROLLER_HXX +#include "genericcontroller.hxx" +#endif +#ifndef _COM_SUN_STAR_SDBC_XCONNECTION_HPP_ +#include <com/sun/star/sdbc/XConnection.hpp> +#endif +#ifndef _COM_SUN_STAR_SDB_XSQLQUERYCOMPOSER_HPP_ +#include <com/sun/star/sdb/XSQLQueryComposer.hpp> +#endif +#ifndef DBAUI_QUERYVIEW_HXX +#include "queryview.hxx" +#endif +#ifndef _UNDO_HXX +#include <svtools/undo.hxx> +#endif + +class VCLXWindow; +namespace dbaui +{ + class OQueryView; + class OQueryContainerWindow; + class OQueryController : public OGenericUnoController + { + SfxUndoManager m_aUndoManager; + ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > m_xConnection; + ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSQLQueryComposer > m_xComposer; + + ::rtl::OUString m_sDataSourceName; // is set in initialze + ::rtl::OUString m_sStatement; // contains the sql statement + ::rtl::OUString m_sUpdateCatalogName; // catalog for update data + ::rtl::OUString m_sUpdateSchemaName; // schema for update data + ::rtl::OUString m_sUpdateTableName; // table for update data + ::rtl::OUString m_sName; // name of the query + + OQueryContainerWindow* m_pWindow; // temporary window + + sal_Bool m_bEditable; // is the control readonly or not + sal_Bool m_bDesign; // if design is true then we show the complete design otherwise only the text format + sal_Bool m_bDistinct; // true when you want "select distinct" otherwise false + sal_Bool m_bViewAlias; // show the alias row in the design view + sal_Bool m_bViewTable; // show the table row in the design view + sal_Bool m_bViewFunction; // show the function row in the design view + sal_Bool m_bModified; // is the data modified + sal_Bool m_bEsacpeProcessing;// is true when we shouldn't parse the statement + sal_Bool m_bOwnConnection; // is true when we created our own connection + + // creates the querycomposer + void setQueryComposer(); + protected: + // all the features which should be handled by this class + virtual void AddSupportedFeatures(); + // state of a feature. 'feature' may be the handle of a ::com::sun::star::util::URL somebody requested a dispatch interface for OR a toolbar slot. + virtual FeatureState GetState(sal_uInt16 nId); + // execute a feature + virtual void Execute(sal_uInt16 nId); + virtual ToolBox* CreateToolBox(Window* pParent); + + OQueryView* getQueryView() { return static_cast<OQueryView*>(m_pView); } + public: + OQueryController(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rM); + + ~OQueryController(); + // temp + virtual VCLXWindow* getWindowPeer(); + + void setModified(sal_Bool _bModified); + sal_Bool isModified() const { return m_bModified; } + // need for undo's and redo's + SfxUndoManager* getUndoMgr(); + + virtual sal_Bool Construct(Window* pParent); + + // XEventListener + virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException); + // ::com::sun::star::beans::XPropertyChangeListener + virtual void SAL_CALL propertyChange(const ::com::sun::star::beans::PropertyChangeEvent& evt); + // ::com::sun::star::container::XContainerListener + virtual void SAL_CALL elementInserted(const ::com::sun::star::container::ContainerEvent& Event) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL elementRemoved(const ::com::sun::star::container::ContainerEvent& Event) throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL elementReplaced(const ::com::sun::star::container::ContainerEvent& Event) throw( ::com::sun::star::uno::RuntimeException ); + + // ::com::sun::star::frame::XController + virtual sal_Bool SAL_CALL suspend(sal_Bool bSuspend) throw( ::com::sun::star::uno::RuntimeException ); + // ::com::sun::star::lang::XComponent + virtual void SAL_CALL dispose(); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString> SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); + // need by registration + static ::rtl::OUString getImplementationName_Static() throw( ::com::sun::star::uno::RuntimeException ); + static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static(void) throw( ::com::sun::star::uno::RuntimeException ); + static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > + SAL_CALL Create(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&); + // lang::XInitialization + virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw(::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException); + }; +} +#endif // DBAUI_QUERYCONTROLLER_HXX + diff --git a/dbaccess/source/ui/inc/queryview.hxx b/dbaccess/source/ui/inc/queryview.hxx new file mode 100644 index 000000000000..77693132b61c --- /dev/null +++ b/dbaccess/source/ui/inc/queryview.hxx @@ -0,0 +1,100 @@ +/************************************************************************* + * + * $RCSfile: queryview.hxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: oj $ $Date: 2001-01-09 16:02:01 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the License); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an AS IS basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef DBAUI_QUERYVIEW_HXX +#define DBAUI_QUERYVIEW_HXX + +#ifndef DBAUI_DATAVIEW_HXX +#include "dataview.hxx" +#endif + +namespace dbaui +{ + class OQueryController; + class OQueryView : public ODataView + { + OQueryController* m_pController; + public: + OQueryView(Window* pParent, OQueryController* _pController,const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& ); + virtual ~OQueryView(); + + OQueryController* getController() { return m_pController; } + + virtual sal_Bool isCutAllowed() = 0; + virtual void copy() = 0; + virtual void cut() = 0; + virtual void paste() = 0; + // clears the whole query + virtual void clear() = 0; + // set the view readonly or not + virtual void setReadOnly(sal_Bool _bReadOnly) = 0; + // set the statement for representation + virtual void setStatement(const ::rtl::OUString& _rsStatement) = 0; + // returns the current sql statement + virtual ::rtl::OUString getStatement() = 0; + /// late construction + virtual void Construct(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& xModel); + protected: + // return the Rectangle where I can paint myself + virtual void resizeControl(Rectangle& rRect); + // + }; +} +#endif // DBAUI_QUERYVIEW_HXX diff --git a/dbaccess/source/ui/inc/sqledit.hxx b/dbaccess/source/ui/inc/sqledit.hxx new file mode 100644 index 000000000000..43d1ad898469 --- /dev/null +++ b/dbaccess/source/ui/inc/sqledit.hxx @@ -0,0 +1,109 @@ +/************************************************************************* + * + * $RCSfile: sqledit.hxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: oj $ $Date: 2001-01-09 16:01:14 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the License); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an AS IS basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef DBAUI_SQLEDIT_HXX +#define DBAUI_SQLEDIT_HXX + +#ifndef _SVEDIT_HXX +#include <svtools/svmedit.hxx> +#endif + +namespace dbaui +{ + class OQueryTextView; + class OSqlEdit : public MultiLineEdit + { + private: + Timer m_timerInvalidate; + Timer m_timerUndoActionCreation; + Link m_lnkTextModifyHdl; + String m_strOrigText; // wird beim Undo wiederhergestellt + OQueryTextView* m_pView; + BOOL m_bAccelAction; // Wird bei Cut, Copy, Paste gesetzt + + DECL_LINK(OnUndoActionTimer, void*); + DECL_LINK(OnInvalidateTimer, void*); + + protected: + virtual void KeyInput( const KeyEvent& rKEvt ); + virtual void GetFocus(); + + DECL_LINK(ModifyHdl, void*); + + public: + OSqlEdit( OQueryTextView* pParent, WinBits nWinStyle = WB_LEFT | WB_VSCROLL |WB_BORDER); + virtual ~OSqlEdit(); + + void OverloadedSetText(const String& rNewText); + // mieser name, ich weiss .... leider muss ich das SetText, dass die UndoActions an mir ausfuehren koennen, abfangen + // die Alternative waere gewesen, allen oder nur den UndoActions Zugriff auf m_strOrigText zu geben ... + + BOOL IsInAccelAct(); + + void SetTextModifyHdl(const Link& lnk) { m_lnkTextModifyHdl = lnk; } + // bitte nicht SetModifyHdl benutzen, den brauche ich selber, der hier wird von dem damit gesetzten Handler + // gerufen + // der Link bekommt einen Pointer-to-string, der nach dem Link nicht mehr gueltig ist + }; +} + +#endif // DBAUI_SQLEDIT_HXX + + diff --git a/dbaccess/source/ui/inc/undosqledit.hxx b/dbaccess/source/ui/inc/undosqledit.hxx new file mode 100644 index 000000000000..b50de7ff4bc2 --- /dev/null +++ b/dbaccess/source/ui/inc/undosqledit.hxx @@ -0,0 +1,93 @@ +/************************************************************************* + * + * $RCSfile: undosqledit.hxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: oj $ $Date: 2001-01-09 16:02:33 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the License); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an AS IS basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef DBAUI_UNDOSQLEDIT_HXX +#define DBAUI_UNDOSQLEDIT_HXX + +#ifndef DBAUI_GENERALUNDO_HXX +#include "generalundo.hxx" +#endif +#ifndef _DBU_RESOURCE_HRC_ +#include "dbu_resource.hrc" +#endif + +namespace dbaui +{ + class OSqlEdit; + // ================================================================================================ + // OSqlEditUndoAct - Undo-class for changing sql text + //------------------------------------------------------------------------ + class OSqlEditUndoAct : public OCommentUndoAction + { + protected: + OSqlEdit* m_pOwner; + String m_strNextText; + + virtual void Undo() { ToggleText(); } + virtual void Redo() { ToggleText(); } + + void ToggleText(); + public: + OSqlEditUndoAct(OSqlEdit* pEdit) : OCommentUndoAction(STR_QUERY_UNDO_MODIFYSQLEDIT), m_pOwner(pEdit) { } + + void SetOriginalText(const String& strText) { m_strNextText = strText; } + }; +} +#endif // DBAUI_UNDOSQLEDIT_HXX
\ No newline at end of file diff --git a/dbaccess/source/ui/inc/unodatbr.hxx b/dbaccess/source/ui/inc/unodatbr.hxx index 91b5927e5ce4..695f984cdc20 100644 --- a/dbaccess/source/ui/inc/unodatbr.hxx +++ b/dbaccess/source/ui/inc/unodatbr.hxx @@ -2,9 +2,9 @@ * * $RCSfile: unodatbr.hxx,v $ * - * $Revision: 1.9 $ + * $Revision: 1.10 $ * - * last change: $Author: fs $ $Date: 2000-12-10 16:12:18 $ + * last change: $Author: oj $ $Date: 2001-01-09 16:03:40 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -72,9 +72,6 @@ #ifndef _COM_SUN_STAR_FRAME_XSTATUSLISTENER_HPP_ #include <com/sun/star/frame/XStatusListener.hpp> #endif -#ifndef _COM_SUN_STAR_CONTAINER_XNAMEACCESS_HPP_ -#include <com/sun/star/container/XNameAccess.hpp> -#endif #ifndef _COM_SUN_STAR_FRAME_XDISPATCH_HPP_ #include <com/sun/star/frame/XDispatch.hpp> #endif @@ -101,10 +98,11 @@ namespace dbaui ,public SbaTableQueryBrowser_Base { protected: + ::osl::Mutex m_aEntryMutex; DBTreeView* m_pTreeView; Splitter* m_pSplitter; DBTreeListModel* m_pTreeModel; // contains the datasources of the registry - SvLBoxEntry* m_pCurrentlyLoaded; + SvLBoxEntry* m_pCurrentlyDisplayed; DECLARE_STL_STDKEY_MAP( sal_Int32, ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch >, SpecialSlotDispatchers); DECLARE_STL_STDKEY_MAP( sal_Int32, sal_Bool, SpecialSlotStates); @@ -114,26 +112,20 @@ namespace dbaui ::rtl::OUString m_sDefaultDataSourceName; ::rtl::OUString m_sDefaultCommand; sal_Int32 m_nDefaultCommandType; - - ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > m_xDatabaseContext; + sal_Bool m_bHideTreeView; // attribute access public: SbaTableQueryBrowser(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rM); ~SbaTableQueryBrowser(); -// static void * SAL_CALL operator new( size_t nSize ) throw() -// { return ::rtl_allocateMemory( nSize ); } -// static void SAL_CALL operator delete( void * pMem ) throw() -// { ::rtl_freeMemory( pMem ); } -// // need by registration static ::rtl::OUString getImplementationName_Static() throw( ::com::sun::star::uno::RuntimeException ); static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static(void) throw( ::com::sun::star::uno::RuntimeException ); static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL Create(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&); - DECLARE_UNO3_DEFAULTS(SbaTableQueryBrowser,SbaXDataBrowserController_Base); + DECLARE_UNO3_DEFAULTS(SbaTableQueryBrowser,OGenericUnoController); // late construction virtual sal_Bool Construct(Window* pParent); @@ -214,15 +206,20 @@ namespace dbaui /** unloads the form, empties the grid model */ - void unloadForm(); + void unloadForm(sal_Bool _bDisposeConnection = sal_True); /** close the connection (and collapse the list entries) of the given list entries */ - void closeConnection(SvLBoxEntry* _pEntry); + void closeConnection(SvLBoxEntry* _pEntry,sal_Bool _bDisposeConnection = sal_True); sal_Bool populateTree(const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess>& _xNameAccess, SvLBoxEntry* _pParent, const Image& _rImage); void initializeTreeModel(); + /** search in the tree for query- or tablecontainer equal to this interface and return + this container entry + */ + SvLBoxEntry* getNameAccessFromEntry(const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess>& _rxNameAccess); + // is called when a table or a query was selected DECL_LINK( OnSelectEntry, SvLBoxEntry* ); DECL_LINK( OnExpandEntry, SvLBoxEntry* ); diff --git a/dbaccess/source/ui/misc/uiservices.cxx b/dbaccess/source/ui/misc/uiservices.cxx index 0bfe4d6d6bd1..5f82459a0896 100644 --- a/dbaccess/source/ui/misc/uiservices.cxx +++ b/dbaccess/source/ui/misc/uiservices.cxx @@ -2,9 +2,9 @@ * * $RCSfile: uiservices.cxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: fs $ $Date: 2000-12-15 16:46:23 $ + * last change: $Author: oj $ $Date: 2001-01-09 16:11:54 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -72,6 +72,7 @@ /********************************************************************************************/ using namespace ::rtl; +using namespace ::dbaui; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::registry; @@ -87,6 +88,7 @@ extern "C" void SAL_CALL createRegistryInfo_DBContentLoader(); extern "C" void SAL_CALL writeDBLoaderInfo(void* pRegistryKey); extern "C" void SAL_CALL createRegistryInfo_OInteractionHandler(); extern "C" void SAL_CALL createRegistryInfo_SbaXGridControl(); +extern "C" void SAL_CALL createRegistryInfo_OQueryControl(); //*************************************************************************************** extern "C" void SAL_CALL createRegistryInfo_DBU() @@ -101,6 +103,7 @@ extern "C" void SAL_CALL createRegistryInfo_DBU() createRegistryInfo_DBContentLoader(); createRegistryInfo_OInteractionHandler(); createRegistryInfo_SbaXGridControl(); + createRegistryInfo_OQueryControl(); bInit = sal_True; } } |