1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef DBAUI_QUERYCONTAINERWINDOW_HXX
21 #define DBAUI_QUERYCONTAINERWINDOW_HXX
23 #include <vcl/window.hxx>
24 #include <vcl/split.hxx>
25 #include <dbaccess/dataview.hxx>
26 #include <com/sun/star/frame/XFrame2.hpp>
27 #include "QueryViewSwitch.hxx"
28 #include <vcl/dockwin.hxx>
30 //.........................................................................
33 //.........................................................................
35 //=====================================================================
37 //=====================================================================
38 // tempoaray class until the beamer is implemented
39 class OBeamer
: public DockingWindow
42 OBeamer(Window
* _pParent
) : DockingWindow(_pParent
,0){}
45 //=====================================================================
46 //= OQueryContainerWindow
47 //=====================================================================
48 class OQueryContainerWindow
: public ODataView
50 OQueryViewSwitch
* m_pViewSwitch
;
52 Splitter
* m_pSplitter
;
53 ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XFrame2
> m_xBeamer
;
55 DECL_LINK( SplitHdl
, void* );
57 OQueryContainerWindow(Window
* pParent
, OQueryController
& _rController
,const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
>&);
58 ~OQueryContainerWindow();
60 virtual void Construct();
62 virtual long PreNotify( NotifyEvent
& rNEvt
);
65 void showPreview(const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XFrame
>& _xFrame
);
66 // called when the beamer has been disposed
67 void disposingPreview();
69 ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XFrame2
>
70 getPreviewFrame() const { return m_xBeamer
; }
72 OQueryDesignView
* getDesignView() { return m_pViewSwitch
->getDesignView(); }
74 sal_Bool
isCutAllowed() { return m_pViewSwitch
->isCutAllowed(); }
75 sal_Bool
isPasteAllowed() { return m_pViewSwitch
->isPasteAllowed(); }
76 sal_Bool
isCopyAllowed() { return m_pViewSwitch
->isCopyAllowed(); }
77 void copy() { m_pViewSwitch
->copy(); }
78 void cut() { m_pViewSwitch
->cut(); }
79 void paste() { m_pViewSwitch
->paste(); }
81 void clear() { m_pViewSwitch
->clear(); }
82 sal_Bool
isSlotEnabled( sal_Int32 _nSlotId
) { return m_pViewSwitch
->isSlotEnabled( _nSlotId
); }
83 void setSlotEnabled( sal_Int32 _nSlotId
, sal_Bool _bEnable
) { m_pViewSwitch
->setSlotEnabled( _nSlotId
, _bEnable
); }
84 void setNoneVisbleRow(sal_Int32 _nRows
) { m_pViewSwitch
->setNoneVisbleRow( _nRows
); }
86 void setReadOnly( sal_Bool _bReadOnly
) { m_pViewSwitch
->setReadOnly( _bReadOnly
); }
88 sal_Bool
checkStatement() { return m_pViewSwitch
->checkStatement( ); }
89 OUString
getStatement() { return m_pViewSwitch
->getStatement( ); }
90 void setStatement( const OUString
& _rsStatement
) { m_pViewSwitch
->setStatement( _rsStatement
); }
92 void initialize() { m_pViewSwitch
->initialize(); }
93 void SaveUIConfig() { m_pViewSwitch
->SaveUIConfig(); }
94 bool reset( ::dbtools::SQLExceptionInfo
* _pErrorInfo
) { return m_pViewSwitch
->reset( _pErrorInfo
); }
96 bool switchView( ::dbtools::SQLExceptionInfo
* _pErrorInfo
);
97 void forceInitialView();
99 virtual void GetFocus();
102 // re-arrange the controls belonging to the document itself
103 virtual void resizeAll( const Rectangle
& _rPlayground
);
105 // arrange dericed classes controls in the rectangle given
106 virtual void resizeDocumentView(Rectangle
& _rPlayground
);
108 // end of temp classes
110 //.........................................................................
112 //.........................................................................
114 #endif // DBAUI_QUERYCONTAINERWINDOW_HXX
116 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */