Files
libreoffice/dbaccess/source/ui/inc/QueryDesignView.hxx

184 lines
6.4 KiB
C++
Raw Normal View History

2001-02-05 08:10:26 +00:00
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2001-02-05 08:10:26 +00:00
*
* Copyright 2008 by Sun Microsystems, Inc.
2001-02-05 08:10:26 +00:00
*
* OpenOffice.org - a multi-platform office productivity suite
2001-02-05 08:10:26 +00:00
*
* $RCSfile: QueryDesignView.hxx,v $
* $Revision: 1.24 $
2001-02-05 08:10:26 +00:00
*
* This file is part of OpenOffice.org.
2001-02-05 08:10:26 +00:00
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
2001-02-05 08:10:26 +00:00
*
* OpenOffice.org 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 version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
2001-02-05 08:10:26 +00:00
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
2001-02-05 08:10:26 +00:00
*
************************************************************************/
#ifndef DBAUI_QUERYDESIGNVIEW_HXX
#define DBAUI_QUERYDESIGNVIEW_HXX
#ifndef DBAUI_QUERYVIEW_HXX
#include "queryview.hxx"
#endif
#ifndef _SV_SPLIT_HXX
#include <vcl/split.hxx>
#endif
#ifndef _STRING_HXX
#include <tools/string.hxx>
#endif
#ifndef DBAUI_ENUMTYPES_HXX
#include "QEnumTypes.hxx"
#endif
2001-09-27 05:19:05 +00:00
#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
#include <com/sun/star/beans/XPropertySet.hpp>
#endif
#ifndef DBAUI_QUERYCONTROLLER_HXX
#include "querycontroller.hxx"
#endif
#ifndef DBAUI_CONNECTIONLINEDATA_HXX
#include "ConnectionLineData.hxx"
#endif
2001-02-05 08:10:26 +00:00
namespace connectivity
{
class OSQLParseNode;
}
class ComboBox;
namespace dbaui
{
2002-05-06 08:31:11 +00:00
enum SqlParseError
{
eIllegalJoin,
eStatementTooLong,
eNoConnection,
eNoSelectStatement,
eStatementTooComplex,
eColumnInLikeNotFound,
eNoColumnInLike,
eColumnNotFound,
eNativeMode,
eTooManyTables,
eTooManyConditions,
eTooManyColumns,
eIllegalJoinCondition,
eOk
};
2001-02-05 08:10:26 +00:00
class OQueryViewSwitch;
class OAddTableDlg;
class OQueryTableWindow;
class OSelectionBrowseBox;
class OTableConnection;
class OQueryTableConnectionData;
class OQueryContainerWindow;
2001-02-05 08:10:26 +00:00
class OQueryDesignView : public OQueryView
{
2001-05-02 11:44:27 +00:00
enum ChildFocusState
{
SELECTION,
TABLEVIEW,
NONE
};
2001-02-05 08:10:26 +00:00
Splitter m_aSplitter;
::com::sun::star::lang::Locale m_aLocale;
::rtl::OUString m_sDecimalSep;
2001-04-18 12:20:48 +00:00
OSelectionBrowseBox* m_pSelectionBox; // presents the lower window
2001-05-02 11:44:27 +00:00
ChildFocusState m_eChildFocus;
2002-02-11 11:43:58 +00:00
sal_Bool m_bInKeyEvent;
2002-05-24 11:43:58 +00:00
sal_Bool m_bInSplitHandler;
2001-02-05 08:10:26 +00:00
public:
OQueryDesignView(OQueryContainerWindow* pParent, OQueryController& _rController,const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& );
2001-02-05 08:10:26 +00:00
virtual ~OQueryDesignView();
virtual sal_Bool isCutAllowed();
2001-04-18 12:20:48 +00:00
virtual sal_Bool isPasteAllowed();
virtual sal_Bool isCopyAllowed();
2001-02-05 08:10:26 +00:00
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);
2001-09-27 05:19:05 +00:00
// check if the statement is correct when not returning false
virtual sal_Bool checkStatement();
2001-02-05 08:10:26 +00:00
// set the statement for representation
virtual void setStatement(const ::rtl::OUString& _rsStatement);
// returns the current sql statement
virtual ::rtl::OUString getStatement();
/// late construction
virtual void Construct();
2001-02-05 08:10:26 +00:00
virtual void initialize();
// window overloads
virtual long PreNotify( NotifyEvent& rNEvt );
virtual void GetFocus();
2001-02-05 08:10:26 +00:00
sal_Bool isSlotEnabled(sal_Int32 _nSlotId);
void setSlotEnabled(sal_Int32 _nSlotId,sal_Bool _bEnable);
2001-10-23 11:30:27 +00:00
void setNoneVisbleRow(sal_Int32 _nRows);
2001-02-05 08:10:26 +00:00
::com::sun::star::lang::Locale getLocale() const { return m_aLocale;}
::rtl::OUString getDecimalSeparator() const { return m_sDecimalSep;}
2002-05-06 08:31:11 +00:00
SqlParseError InsertField( const OTableFieldDescRef& rInfo, sal_Bool bVis=sal_True, sal_Bool bActivate = sal_True);
2001-02-05 08:10:26 +00:00
// save the position of the table window and the pos of the splitters
// called when fields are deleted
void DeleteFields( const ::rtl::OUString& rAliasName );
// called when a table from tabeview was deleted
void TableDeleted(const ::rtl::OUString& rAliasName);
CWS-TOOLING: integrate CWS dba31d 2008-12-08 16:22:07 +0100 rt r265005 : Remove DOS lineends 2008-12-05 13:56:24 +0100 fs r264906 : #i10000# removed unreachable statement 2008-11-20 11:41:26 +0100 fs r264037 : merged in the fix for #i95865# (it was wrongly committed to CWS dba32a, should have been here) 2008-11-20 11:34:24 +0100 fs r264036 : line ends 2008-11-14 08:44:50 +0100 lla r263665 : #i10000# comparsion between int and uint fixed 2008-11-13 13:31:12 +0100 lla r263641 : #i10000# build problem fixed 2008-11-13 11:20:01 +0100 lla r263625 : #i96130# hard code name of extension 2008-11-12 11:13:41 +0100 fs r263582 : #i96096# when opening a SRB-report fails due to the missing SRB extension, log this as warning only, and proceed with the migration 2008-11-12 11:11:35 +0100 fs r263581 : #i96096# ContentType handling. Now all contents deliver proper results in XContent::getContentType 2008-11-12 11:10:11 +0100 fs r263580 : #i96096# new ctors taking UNO_QUERY_THROW 2008-11-11 10:10:13 +0100 lla r263546 : CWS-TOOLING: rebase CWS dba31d to trunk@263288 (milestone: DEV300:m35) 2008-11-06 15:55:39 +0100 oj r263393 : #i93452# get field from model fallbackis the name 2008-11-06 15:31:47 +0100 oj r263392 : #i93465# remeber location of floating windows 2008-11-06 13:36:24 +0100 oj r263381 : #i93450# check typemap for null 2008-11-06 13:28:49 +0100 oj r263379 : #i93020# empty column list boxes when new relation should be created 2008-11-06 12:33:53 +0100 oj r263377 : #i93012# set border to default : flat 2008-11-06 12:26:54 +0100 oj r263375 : #i74927# do some less calls for odbc 2008-11-06 09:34:01 +0100 oj r263362 : #i93383# grabFocus in suspend to get allmodified cells 2008-11-03 21:01:39 +0100 oj r263308 : #i86739# check if slash can be valid for tables 2008-11-03 14:40:21 +0100 oj r263287 : #i86739# check if slash can be valid for tables 2008-11-03 14:32:17 +0100 oj r263286 : #i95227# column width 2008-11-03 14:27:26 +0100 oj r263285 : link fwe 2008-11-03 14:24:54 +0100 oj r263284 : #i95235# changed to hold no ref only weak 2008-10-31 11:21:48 +0100 oj r262859 : #i93459# set images add menu entry 2008-10-31 09:06:37 +0100 oj r262851 : #i88629# correct fileopen filter for database odb files 2008-10-30 15:01:04 +0100 oj r262828 : #i95229# set filter at the composer 2008-10-29 15:57:41 +0100 oj r262817 : #i95235# changed to hold no ref only weak 2008-10-29 15:57:19 +0100 oj r262816 : #i95235# changed to hold no ref only weak 2008-10-29 15:57:03 +0100 oj r262815 : #i95235# changed to hold no ref only weak 2008-10-29 15:56:15 +0100 oj r262814 : #i95235# filtermanger changed to hold no ref only weak 2008-10-29 10:32:39 +0100 oj r262773 : #i93474# use correct table name 2008-10-28 13:49:33 +0100 lla r262744 : #i95524# make an Invalidate and refresh on Tables 2008-10-28 10:45:02 +0100 fs r262707 : line ends 2008-10-28 10:34:42 +0100 fs r262706 : #i95522# don't expect the component to live in a TopWindow 2008-10-28 08:30:40 +0100 lla r262696 : #i93176# set preview mode on view 2008-10-28 07:56:57 +0100 oj r262694 : merge cvs svn 2008-10-27 14:13:51 +0100 oj r262673 : #i94129# use dummy data 2008-10-27 12:38:45 +0100 fs r262669 : #i94125# rework ScrollColumns 2008-10-23 15:53:57 +0200 oj r262624 : #i94568# do not load the embeddedobj just copy the storage 2008-10-23 14:39:14 +0200 oj r262622 : #i94129# handle chart correctly 2008-10-22 10:51:19 +0200 lla r262582 : #i94115# problem with left walk chart shape fixed 2008-10-22 07:47:48 +0200 oj r262576 : #i94455# rename now do not use remove insert 2008-10-22 07:47:27 +0200 oj r262575 : #i94455# rename now do not use remove insert 2008-10-21 12:46:26 +0200 lla r262567 : #i93845# extra check if default schema doesn't exists, fix assertion
2008-12-09 07:25:38 +00:00
sal_Int32 getColWidth( sal_uInt16 _nColPos) const;
2001-02-05 08:10:26 +00:00
void fillValidFields(const ::rtl::OUString& strTableName, ComboBox* pFieldList);
2001-02-05 15:19:35 +00:00
void SaveUIConfig();
2001-04-18 12:20:48 +00:00
void stopTimer();
void startTimer();
2001-10-23 11:30:27 +00:00
void reset();
CWS-TOOLING: integrate CWS dba31e 2008-11-19 12:36:23 +0100 msc r263980 : i96104 2008-11-19 12:31:19 +0100 msc r263979 : i96104 2008-11-19 12:21:55 +0100 msc r263977 : i96104 2008-11-19 12:18:53 +0100 msc r263976 : i96104 2008-11-18 09:09:45 +0100 oj r263746 : disable color entry when area is set 2008-11-18 08:37:52 +0100 oj r263741 : #remove sub report entry 2008-11-17 11:20:25 +0100 fs r263708 : #i10000# 2008-11-17 11:06:52 +0100 fs r263706 : minimal version now is 3.1 2008-11-12 22:25:59 +0100 fs r263621 : #i96150# 2008-11-12 22:20:02 +0100 fs r263620 : rebased to m34 2008-11-12 21:39:41 +0100 fs r263618 : MANUAL REBASE: rebase CWS dba31d to DEV300_m34 2008-11-12 13:54:58 +0100 fs r263597 : #i96134# MediaDescriptor.URL is to be preferred over MediaDescriptor.FileName. Nonetheless, ensure both are handled 2008-11-12 13:53:40 +0100 fs r263596 : #i96134# re-enabled the code for #i41897#, a better fix is to come 2008-11-12 12:48:21 +0100 fs r263585 : #i96134# disable saving URLs of file-base databases relatively 2008-11-11 16:11:11 +0100 msc r263566 : #i96104# 2008-11-05 09:09:47 +0100 oj r263342 : #i88727# color noe added 2008-11-05 08:41:43 +0100 oj r263341 : #i77916# zoom added 2008-11-04 21:24:15 +0100 fs r263339 : disposing: call disposeAndClear without own mutex locked - some of our listeners insist on locking the SolarMutex, which sometimes led to deadlocks on the complex test cases 2008-11-04 21:23:15 +0100 fs r263338 : remove SolarMutex locking - this happned in CWS dba31c (in the CVS version), which this CWS was created from, but seems to got lost during resync 2008-11-04 20:49:50 +0100 fs r263335 : docu formatting 2008-11-04 20:06:39 +0100 fs r263334 : #i95826# use m_aMutex, not a DocumentGuard (wrongly resolved merge conflicts) 2008-11-04 17:36:29 +0100 fs r263332 : #i92688# properly revoke as XEventListener from m_xActiveController when disposing 2008-11-04 14:49:34 +0100 fs r263324 : #i92322# enable Input Required if EmptyIsNULL does not exist at the control 2008-10-31 11:10:04 +0100 oj r262857 : merge from cvs to svn 2008-10-31 09:46:45 +0100 oj r262853 : merge from cvs to svn 2008-10-31 08:46:37 +0100 oj r262849 : merge from cvs to svn 2008-10-31 08:44:24 +0100 oj r262848 : merge from cvs to svn 2008-10-31 08:43:33 +0100 oj r262847 : merge from cvs to svn 2008-10-31 08:42:28 +0100 oj r262846 : merge from cvs to svn 2008-10-31 08:41:58 +0100 oj r262845 : merge from cvs to svn 2008-10-31 08:41:32 +0100 oj r262844 : merge from cvs to svn 2008-10-28 12:19:50 +0100 oj r262733 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:42 +0100 oj r262732 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:36 +0100 oj r262731 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:31 +0100 oj r262730 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:22 +0100 oj r262729 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:18 +0100 oj r262728 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:10 +0100 oj r262727 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:06 +0100 oj r262726 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:05 +0100 oj r262725 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:19:01 +0100 oj r262724 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:50 +0100 oj r262723 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:41 +0100 oj r262722 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:40 +0100 oj r262721 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:27 +0100 oj r262720 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:10 +0100 oj r262719 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:18:01 +0100 oj r262718 : #iXXXXX#: migrate CWS dba31e to SVN 2008-10-28 12:17:39 +0100 oj r262717 : #iXXXXX#: migrate CWS dba31e to SVN
2008-12-01 12:31:27 +00:00
/** initializes the view from the current parser / parse iterator of the controller
@param _pErrorInfo
When not <NULL/>, the instance pointed to by this parameter takes the error
which happened during the initialization.
If it is not <NULL/>, then any such error will be displayed, using the controller's
showError method.
@return <TRUE/> if and only if the initialization was successful
*/
bool initByParseIterator( ::dbtools::SQLExceptionInfo* _pErrorInfo );
2001-09-27 05:19:05 +00:00
::connectivity::OSQLParseNode* getPredicateTreeFromEntry( OTableFieldDescRef pEntry,
2001-09-27 05:19:05 +00:00
const String& _sCriteria,
::rtl::OUString& _rsErrorMessage,
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxColumn) const;
2001-02-05 08:10:26 +00:00
protected:
// return the Rectangle where I can paint myself
virtual void resizeDocumentView(Rectangle& rRect);
2001-02-05 08:10:26 +00:00
DECL_LINK( SplitHdl, void* );
private:
using OQueryView::SaveTabWinUIConfig;
2001-02-05 08:10:26 +00:00
};
}
#endif // DBAUI_QUERYDESIGNVIEW_HXX