changes for querydesign
This commit is contained in:
parent
923fd8112b
commit
f639e6f22e
4 changed files with 101 additions and 18 deletions
|
@ -2,9 +2,9 @@
|
|||
*
|
||||
* $RCSfile: QueryTextView.hxx,v $
|
||||
*
|
||||
* $Revision: 1.1 $
|
||||
* $Revision: 1.2 $
|
||||
*
|
||||
* last change: $Author: oj $ $Date: 2001-01-09 16:02:43 $
|
||||
* last change: $Author: oj $ $Date: 2001-02-05 09:12:46 $
|
||||
*
|
||||
* The Contents of this file are made available subject to the terms of
|
||||
* either of the following licenses
|
||||
|
@ -67,6 +67,10 @@
|
|||
#ifndef _COM_SUN_STAR_FRAME_XFRAME_HPP_
|
||||
#include <com/sun/star/frame/XFrame.hpp>
|
||||
#endif
|
||||
#ifndef DBAUI_QUERYVIEWSWITCH_HXX
|
||||
#include "QueryViewSwitch.hxx"
|
||||
#endif
|
||||
|
||||
|
||||
class Splitter;
|
||||
|
||||
|
@ -79,12 +83,12 @@ namespace dbaui
|
|||
OBeamer(Window* _pParent) : Window(_pParent){}
|
||||
};
|
||||
|
||||
class OQueryTextView;
|
||||
class OQueryViewSwitch;
|
||||
class OQueryContainerWindow : public Window
|
||||
{
|
||||
OQueryTextView* m_pView;
|
||||
OBeamer* m_pBeamer;
|
||||
Splitter* m_pSplitter;
|
||||
OQueryViewSwitch* 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
|
||||
|
||||
|
@ -97,13 +101,15 @@ namespace dbaui
|
|||
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; }
|
||||
OQueryViewSwitch* getView() { return m_pView; }
|
||||
void switchView();
|
||||
};
|
||||
// end of temp classes
|
||||
|
||||
class OSqlEdit;
|
||||
class OQueryTextView : public OQueryView
|
||||
{
|
||||
friend class OQueryViewSwitch;
|
||||
OSqlEdit* m_pEdit;
|
||||
public:
|
||||
OQueryTextView(Window* pParent, OQueryController* _pController,const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& );
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
*
|
||||
* $RCSfile: browserids.hxx,v $
|
||||
*
|
||||
* $Revision: 1.2 $
|
||||
* $Revision: 1.3 $
|
||||
*
|
||||
* last change: $Author: oj $ $Date: 2001-01-11 09:19:40 $
|
||||
* last change: $Author: oj $ $Date: 2001-02-05 09:12:46 $
|
||||
*
|
||||
* The Contents of this file are made available subject to the terms of
|
||||
* either of the following licenses
|
||||
|
@ -103,9 +103,10 @@
|
|||
#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_TREE_QUERY_CREATE_DESIGN 4
|
||||
#define ID_TREE_QUERY_CREATE_TEXT 5
|
||||
#define ID_TREE_QUERY_EDIT 6
|
||||
#define ID_TREE_QUERY_DELETE 7
|
||||
|
||||
#define ID_BROWSER_QUERY_EXECUTE SID_FM_EXECUTE
|
||||
#define ID_BROWSER_CLEAR_QUERY (SID_SBA_START+130)
|
||||
|
@ -116,6 +117,12 @@
|
|||
#define ID_BROWSER_CLOSE SID_CLOSEDOC
|
||||
#define ID_BROWSER_ESACPEPROCESSING SID_FM_NATIVESQL
|
||||
|
||||
#define ID_QUERY_FUNCTION (SID_SBA_START + 41) // Funktionen anzeigen
|
||||
#define ID_QUERY_TABLENAME (SID_SBA_START + 42) // Tabellennamen anzeigen
|
||||
#define ID_QUERY_ALIASNAME (SID_SBA_START + 43) // Aliasnamen anzeigen
|
||||
#define ID_QUERY_DISTINCT (SID_SBA_START + 44) // Distinct anzeigen
|
||||
#define ID_QUERY_ZOOM_IN SID_ZOOM_IN
|
||||
#define ID_QUERY_ZOOM_OUT SID_ZOOM_OUT
|
||||
|
||||
|
||||
#endif // DBACCESS_UI_BROWSER_ID_HXX
|
||||
|
|
|
@ -10,23 +10,56 @@
|
|||
#ifndef _COM_SUN_STAR_SDB_XSQLQUERYCOMPOSER_HPP_
|
||||
#include <com/sun/star/sdb/XSQLQueryComposer.hpp>
|
||||
#endif
|
||||
#ifndef _COM_SUN_STAR_UTIL_XNUMBERFORMATTER_HPP_
|
||||
#include <com/sun/star/util/XNumberFormatter.hpp>
|
||||
#endif
|
||||
#ifndef DBAUI_QUERYVIEW_HXX
|
||||
#include "queryview.hxx"
|
||||
#endif
|
||||
#ifndef _UNDO_HXX
|
||||
#include <svtools/undo.hxx>
|
||||
#endif
|
||||
#ifndef _CONNECTIVITY_PARSE_SQLITERATOR_HXX_
|
||||
#include <connectivity/sqliterator.hxx>
|
||||
#endif
|
||||
#ifndef _CONNECTIVITY_SQLPARSE_HXX
|
||||
#include <connectivity/sqlparse.hxx>
|
||||
#endif
|
||||
#ifndef _CONNECTIVITY_SQLNODE_HXX
|
||||
#include <connectivity/sqlnode.hxx>
|
||||
#endif
|
||||
#ifndef _COM_SUN_STAR_IO_XOBJECTOUTPUTSTREAM_HPP_
|
||||
#include <com/sun/star/io/XObjectOutputStream.hpp>
|
||||
#endif
|
||||
#ifndef _COM_SUN_STAR_IO_XOBJECTINPUTSTREAM_HPP_
|
||||
#include <com/sun/star/io/XObjectInputStream.hpp>
|
||||
#endif
|
||||
|
||||
|
||||
class VCLXWindow;
|
||||
namespace dbaui
|
||||
{
|
||||
class OQueryView;
|
||||
class OQueryContainerWindow;
|
||||
class OTableConnectionData;
|
||||
class OTableWindowData;
|
||||
class OAddTableDlg;
|
||||
class OTableFieldDesc;
|
||||
class OQueryController : public OGenericUnoController
|
||||
{
|
||||
SfxUndoManager m_aUndoManager;
|
||||
::std::vector< OTableConnectionData*> m_vTableConnectionData;
|
||||
::std::vector< OTableWindowData*> m_vTableData;
|
||||
::std::vector<OTableFieldDesc*> m_vTableFieldDesc;
|
||||
|
||||
::connectivity::OSQLParser m_aSqlParser; // to parse sql statements
|
||||
::connectivity::OSQLParseTreeIterator* m_pSqlIterator; // to iterate through them
|
||||
::std::vector<sal_uInt32> m_vColumnWidth;
|
||||
Fraction m_aZoom;
|
||||
|
||||
::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > m_xConnection;
|
||||
::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSQLQueryComposer > m_xComposer;
|
||||
::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter > m_xFormatter; // a number formatter working with the connection's NumberFormatsSupplier
|
||||
|
||||
::rtl::OUString m_sDataSourceName; // is set in initialze
|
||||
::rtl::OUString m_sStatement; // contains the sql statement
|
||||
|
@ -35,8 +68,11 @@ namespace dbaui
|
|||
::rtl::OUString m_sUpdateTableName; // table for update data
|
||||
::rtl::OUString m_sName; // name of the query
|
||||
|
||||
OQueryContainerWindow* m_pWindow; // temporary window
|
||||
OQueryContainerWindow* m_pWindow; // temporary window
|
||||
OAddTableDlg* m_pAddTabDlg; // isa set by the first call of execute, the owner is the design view
|
||||
|
||||
sal_Int32 m_nVisibleRows; // which rows the selection browse should show
|
||||
sal_Int32 m_nSplitPos; // the position of the splitter
|
||||
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
|
||||
|
@ -68,14 +104,44 @@ namespace dbaui
|
|||
~OQueryController();
|
||||
// temp
|
||||
virtual VCLXWindow* getWindowPeer();
|
||||
// removes the connection from the vector and delete it
|
||||
void removeConnectionData(const OTableConnectionData* _pData);
|
||||
::std::vector< OTableWindowData*>* getTableWindowData() { return &m_vTableData; }
|
||||
::std::vector<OTableFieldDesc*>* getTableFieldDesc() { return &m_vTableFieldDesc; }
|
||||
::std::vector< OTableConnectionData*>* getTableConnectionData() { return &m_vTableConnectionData;}
|
||||
|
||||
void setModified(sal_Bool _bModified);
|
||||
sal_Bool isModified() const { return m_bModified; }
|
||||
::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > getConnection() { return m_xConnection; }
|
||||
|
||||
// should the statement be parsed by our own sql parser
|
||||
sal_Bool isReadOnly() const { return !m_bEditable; }
|
||||
sal_Bool isModified() const { return m_bModified; }
|
||||
sal_Bool isEsacpeProcessing() const { return m_bEsacpeProcessing; }
|
||||
sal_Bool isDesignMode() const { return m_bDesign; }
|
||||
sal_Bool isDistinct() const { return m_bDistinct; }
|
||||
|
||||
::rtl::OUString getStatement() const { return m_sStatement; }
|
||||
sal_Int32 getSplitPos() const { return m_nSplitPos;}
|
||||
sal_Int32 getVisibleRows() const { return m_nVisibleRows; }
|
||||
|
||||
void setDistinct(sal_Bool _bDistinct) { m_bDistinct = _bDistinct;}
|
||||
void setSplitPos(sal_Int32 _nSplitPos) { m_nSplitPos = _nSplitPos;}
|
||||
void setVisibleRows(sal_Int32 _nVisibleRows) { m_nVisibleRows = _nVisibleRows;}
|
||||
void setModified(sal_Bool _bModified=sal_True);
|
||||
|
||||
// const ::connectivity::OSQLParseNode* getParseTree() const { return m_aSqlIterator.getParseTree();}
|
||||
// need for undo's and redo's
|
||||
SfxUndoManager* getUndoMgr();
|
||||
|
||||
::connectivity::OSQLParser& getParser() { return m_aSqlParser; }
|
||||
::connectivity::OSQLParseTreeIterator& getParseIterator() { return *m_pSqlIterator; }
|
||||
sal_uInt32 getColWidth(sal_uInt16 _nPos) const
|
||||
{
|
||||
return m_vColumnWidth.size() < _nPos ? m_vColumnWidth[_nPos] : sal_uInt32(0);
|
||||
}
|
||||
|
||||
virtual sal_Bool Construct(Window* pParent);
|
||||
|
||||
::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter > getNumberFormatter()const { return m_xFormatter; }
|
||||
// XEventListener
|
||||
virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException);
|
||||
// ::com::sun::star::beans::XPropertyChangeListener
|
||||
|
@ -100,6 +166,10 @@ namespace dbaui
|
|||
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);
|
||||
|
||||
//
|
||||
virtual void Load(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectInputStream>& _rxIn);
|
||||
virtual void Save(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectOutputStream>& _rxOut);
|
||||
};
|
||||
}
|
||||
#endif // DBAUI_QUERYCONTROLLER_HXX
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
*
|
||||
* $RCSfile: queryview.hxx,v $
|
||||
*
|
||||
* $Revision: 1.1 $
|
||||
* $Revision: 1.2 $
|
||||
*
|
||||
* last change: $Author: oj $ $Date: 2001-01-09 16:02:01 $
|
||||
* last change: $Author: oj $ $Date: 2001-02-05 09:12:46 $
|
||||
*
|
||||
* The Contents of this file are made available subject to the terms of
|
||||
* either of the following licenses
|
||||
|
@ -75,7 +75,7 @@ namespace dbaui
|
|||
OQueryView(Window* pParent, OQueryController* _pController,const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& );
|
||||
virtual ~OQueryView();
|
||||
|
||||
OQueryController* getController() { return m_pController; }
|
||||
OQueryController* getController() const { return m_pController; }
|
||||
|
||||
virtual sal_Bool isCutAllowed() = 0;
|
||||
virtual void copy() = 0;
|
||||
|
|
Loading…
Reference in a new issue