1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 
20 #ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_QUERYCONTAINERWINDOW_HXX
21 #define INCLUDED_DBACCESS_SOURCE_UI_INC_QUERYCONTAINERWINDOW_HXX
22 
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>
29 
30 namespace dbaui
31 {
32 
33     // OBeamer
34     // temporary class until the beamer is implemented
35     class OBeamer : public DockingWindow
36     {
37     public:
OBeamer(vcl::Window * _pParent)38         OBeamer(vcl::Window* _pParent) : DockingWindow(_pParent,0){}
39     };
40 
41     // OQueryContainerWindow
42     class OQueryContainerWindow : public ODataView
43     {
44         OQueryViewSwitch*   m_pViewSwitch;
45         VclPtr<OBeamer>     m_pBeamer;
46         VclPtr<Splitter>    m_pSplitter;
47         css::uno::Reference< css::frame::XFrame2 > m_xBeamer;
48 
49         DECL_LINK( SplitHdl, Splitter*, void );
50     public:
51         OQueryContainerWindow(vcl::Window* pParent, OQueryController& _rController,const css::uno::Reference< css::uno::XComponentContext >&);
52         virtual ~OQueryContainerWindow() override;
53         virtual void dispose() override;
54 
55         virtual void Construct() override;
56 
57         virtual bool        PreNotify( NotifyEvent& rNEvt ) override;
58 
59         // show the beamer
60         void    showPreview(const css::uno::Reference< css::frame::XFrame >& _xFrame);
61             // called when the beamer has been disposed
62         void    disposingPreview();
63 
64         const css::uno::Reference< css::frame::XFrame2 >&
getPreviewFrame() const65                 getPreviewFrame() const { return m_xBeamer; }
66 
getDesignView()67         OQueryDesignView*   getDesignView() { return m_pViewSwitch->getDesignView(); }
68 
isCutAllowed() const69         bool isCutAllowed() const   { return m_pViewSwitch->isCutAllowed(); }
isPasteAllowed() const70         bool isPasteAllowed() const { return m_pViewSwitch->isPasteAllowed(); }
isCopyAllowed() const71         bool isCopyAllowed() const  { return m_pViewSwitch->isCopyAllowed(); }
copy()72         void copy()                 { m_pViewSwitch->copy(); }
cut()73         void cut()                  { m_pViewSwitch->cut(); }
paste()74         void paste()                { m_pViewSwitch->paste(); }
75 
clear()76         void clear()                                                        { m_pViewSwitch->clear(); }
isSlotEnabled(sal_Int32 _nSlotId)77         bool isSlotEnabled( sal_Int32 _nSlotId )                        { return m_pViewSwitch->isSlotEnabled( _nSlotId ); }
setSlotEnabled(sal_Int32 _nSlotId,bool _bEnable)78         void     setSlotEnabled( sal_Int32 _nSlotId, bool _bEnable )    { m_pViewSwitch->setSlotEnabled( _nSlotId, _bEnable ); }
setNoneVisbleRow(sal_Int32 _nRows)79         void     setNoneVisbleRow(sal_Int32 _nRows)                         { m_pViewSwitch->setNoneVisbleRow( _nRows); }
80 
checkStatement()81         bool checkStatement()                                           { return m_pViewSwitch->checkStatement( ); }
getStatement()82         OUString getStatement()                                      { return m_pViewSwitch->getStatement( ); }
setStatement(const OUString & _rsStatement)83         void setStatement( const OUString& _rsStatement )            { m_pViewSwitch->setStatement( _rsStatement ); }
84 
initialize()85         void    initialize() override                                                { m_pViewSwitch->initialize(); }
SaveUIConfig()86         void    SaveUIConfig()                                              { m_pViewSwitch->SaveUIConfig(); }
reset()87         void    reset()                                                     { m_pViewSwitch->reset(); }
88 
89         bool    switchView( ::dbtools::SQLExceptionInfo* _pErrorInfo );
90         void    forceInitialView();
91 
92         virtual void GetFocus() override;
93 
94     protected:
95         // re-arrange the controls belonging to the document itself
96         virtual void resizeAll( const tools::Rectangle& _rPlayground ) override;
97 
98         // arrange derived classes controls in the rectangle given
99         virtual void resizeDocumentView(tools::Rectangle& _rPlayground) override;
100     };
101     // end of temp classes
102 
103 }   // namespace dbaui
104 
105 #endif // INCLUDED_DBACCESS_SOURCE_UI_INC_QUERYCONTAINERWINDOW_HXX
106 
107 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
108