Line data Source code
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 DBAUI_QUERYCONTAINERWINDOW_HXX
21 : #define DBAUI_QUERYCONTAINERWINDOW_HXX
22 :
23 : #include <vcl/window.hxx>
24 : #include <vcl/split.hxx>
25 : #include "dataview.hxx"
26 : #include <com/sun/star/frame/XFrame.hpp>
27 : #include "QueryViewSwitch.hxx"
28 : #include <vcl/dockwin.hxx>
29 :
30 : //.........................................................................
31 : namespace dbaui
32 : {
33 : //.........................................................................
34 :
35 : //=====================================================================
36 : //= OBeamer
37 : //=====================================================================
38 : // tempoaray class until the beamer is implemented
39 0 : class OBeamer : public DockingWindow
40 : {
41 : public:
42 0 : OBeamer(Window* _pParent) : DockingWindow(_pParent,0){}
43 : };
44 :
45 : //=====================================================================
46 : //= OQueryContainerWindow
47 : //=====================================================================
48 : class OQueryContainerWindow : public ODataView
49 : {
50 : OQueryViewSwitch* m_pViewSwitch;
51 : OBeamer* m_pBeamer;
52 : Splitter* m_pSplitter;
53 : ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > m_xBeamer;
54 :
55 : DECL_LINK( SplitHdl, void* );
56 : public:
57 : OQueryContainerWindow(Window* pParent, OQueryController& _rController,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >&);
58 : ~OQueryContainerWindow();
59 :
60 : virtual void Construct();
61 :
62 : virtual long PreNotify( NotifyEvent& rNEvt );
63 :
64 : // show the beamer
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();
68 :
69 : ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >
70 0 : getPreviewFrame() const { return m_xBeamer; }
71 :
72 0 : OQueryDesignView* getDesignView() { return m_pViewSwitch->getDesignView(); }
73 :
74 0 : sal_Bool isCutAllowed() { return m_pViewSwitch->isCutAllowed(); }
75 0 : sal_Bool isPasteAllowed() { return m_pViewSwitch->isPasteAllowed(); }
76 0 : sal_Bool isCopyAllowed() { return m_pViewSwitch->isCopyAllowed(); }
77 0 : void copy() { m_pViewSwitch->copy(); }
78 0 : void cut() { m_pViewSwitch->cut(); }
79 0 : void paste() { m_pViewSwitch->paste(); }
80 :
81 0 : void clear() { m_pViewSwitch->clear(); }
82 0 : sal_Bool isSlotEnabled( sal_Int32 _nSlotId ) { return m_pViewSwitch->isSlotEnabled( _nSlotId ); }
83 0 : void setSlotEnabled( sal_Int32 _nSlotId, sal_Bool _bEnable ) { m_pViewSwitch->setSlotEnabled( _nSlotId, _bEnable ); }
84 0 : void setNoneVisbleRow(sal_Int32 _nRows) { m_pViewSwitch->setNoneVisbleRow( _nRows); }
85 :
86 : void setReadOnly( sal_Bool _bReadOnly ) { m_pViewSwitch->setReadOnly( _bReadOnly ); }
87 :
88 0 : sal_Bool checkStatement() { return m_pViewSwitch->checkStatement( ); }
89 0 : ::rtl::OUString getStatement() { return m_pViewSwitch->getStatement( ); }
90 0 : void setStatement( const ::rtl::OUString& _rsStatement ) { m_pViewSwitch->setStatement( _rsStatement ); }
91 :
92 0 : void initialize() { m_pViewSwitch->initialize(); }
93 0 : void SaveUIConfig() { m_pViewSwitch->SaveUIConfig(); }
94 0 : bool reset( ::dbtools::SQLExceptionInfo* _pErrorInfo ) { return m_pViewSwitch->reset( _pErrorInfo ); }
95 :
96 : bool switchView( ::dbtools::SQLExceptionInfo* _pErrorInfo );
97 : void forceInitialView();
98 :
99 : virtual void GetFocus();
100 :
101 : protected:
102 : // re-arrange the controls belonging to the document itself
103 : virtual void resizeAll( const Rectangle& _rPlayground );
104 :
105 : // arrange dericed classes controls in the rectangle given
106 : virtual void resizeDocumentView(Rectangle& _rPlayground);
107 : };
108 : // end of temp classes
109 :
110 : //.........................................................................
111 : } // namespace dbaui
112 : //.........................................................................
113 :
114 : #endif // DBAUI_QUERYCONTAINERWINDOW_HXX
115 :
116 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|