xref: /trunk/main/dbaccess/source/ui/inc/querycontainerwindow.hxx (revision 31bbceb0f9d64c0c2c3b22a794a1666c1f33396e)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 #ifndef DBAUI_QUERYCONTAINERWINDOW_HXX
23 #define DBAUI_QUERYCONTAINERWINDOW_HXX
24 
25 #ifndef _SV_WINDOW_HXX
26 #include <vcl/window.hxx>
27 #endif
28 #ifndef _SV_SPLIT_HXX
29 #include <vcl/split.hxx>
30 #endif
31 #ifndef DBAUI_DATAVIEW_HXX
32 #include "dataview.hxx"
33 #endif
34 #ifndef _COM_SUN_STAR_FRAME_XFRAME_HPP_
35 #include <com/sun/star/frame/XFrame.hpp>
36 #endif
37 #ifndef DBAUI_QUERYVIEWSWITCH_HXX
38 #include "QueryViewSwitch.hxx"
39 #endif
40 #ifndef _SV_DOCKWIN_HXX
41 #include <vcl/dockwin.hxx>
42 #endif
43 
44 class FixedLine;
45 //.........................................................................
46 namespace dbaui
47 {
48 //.........................................................................
49 
50     //=====================================================================
51     //= OBeamer
52     //=====================================================================
53     // temporary class until the beamer is implemented
54     class OBeamer : public DockingWindow
55     {
56     public:
57         OBeamer(Window* _pParent) : DockingWindow(_pParent,0){}
58     };
59 
60     //=====================================================================
61     //= OQueryContainerWindow
62     //=====================================================================
63     class OQueryContainerWindow : public ODataView
64     {
65         OQueryViewSwitch*   m_pViewSwitch;
66         OBeamer*            m_pBeamer;
67         Splitter*           m_pSplitter;
68         ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > m_xBeamer;
69 
70         DECL_LINK( SplitHdl, void* );
71     public:
72         OQueryContainerWindow(Window* pParent, OQueryController& _rController,const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&);
73         ~OQueryContainerWindow();
74 
75         virtual void Construct();
76 
77         virtual long        PreNotify( NotifyEvent& rNEvt );
78 
79         // show the beamer
80         void    showPreview(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _xFrame);
81             // called when the beamer has been disposed
82         void    disposingPreview();
83 
84         ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >
85                 getPreviewFrame() const { return m_xBeamer; }
86 
87         OQueryDesignView*   getDesignView() { return m_pViewSwitch->getDesignView(); }
88 
89         sal_Bool isCutAllowed()     { return m_pViewSwitch->isCutAllowed(); }
90         sal_Bool isPasteAllowed()   { return m_pViewSwitch->isPasteAllowed(); }
91         sal_Bool isCopyAllowed()    { return m_pViewSwitch->isCopyAllowed(); }
92         void copy()                 { m_pViewSwitch->copy(); }
93         void cut()                  { m_pViewSwitch->cut(); }
94         void paste()                { m_pViewSwitch->paste(); }
95 
96         void clear()                                                        { m_pViewSwitch->clear(); }
97         sal_Bool isSlotEnabled( sal_Int32 _nSlotId )                        { return m_pViewSwitch->isSlotEnabled( _nSlotId ); }
98         void     setSlotEnabled( sal_Int32 _nSlotId, sal_Bool _bEnable )    { m_pViewSwitch->setSlotEnabled( _nSlotId, _bEnable ); }
99         void     setNoneVisbleRow(sal_Int32 _nRows)                         { m_pViewSwitch->setNoneVisbleRow( _nRows); }
100 
101         void setReadOnly( sal_Bool _bReadOnly )                             { m_pViewSwitch->setReadOnly( _bReadOnly ); }
102 
103         sal_Bool checkStatement()                                           { return m_pViewSwitch->checkStatement( ); }
104         ::rtl::OUString getStatement()                                      { return m_pViewSwitch->getStatement( ); }
105         void setStatement( const ::rtl::OUString& _rsStatement )            { m_pViewSwitch->setStatement( _rsStatement ); }
106 
107         void    initialize()                                                { m_pViewSwitch->initialize(); }
108         void    SaveUIConfig()                                              { m_pViewSwitch->SaveUIConfig(); }
109         bool    reset( ::dbtools::SQLExceptionInfo* _pErrorInfo )           { return m_pViewSwitch->reset( _pErrorInfo ); }
110 
111         bool    switchView( ::dbtools::SQLExceptionInfo* _pErrorInfo );
112         void    forceInitialView();
113 
114         virtual void GetFocus();
115 
116     protected:
117         // re-arrange the controls belonging to the document itself
118         virtual void resizeAll( const Rectangle& _rPlayground );
119 
120         // arrange derived classes controls in the rectangle given
121         virtual void resizeDocumentView(Rectangle& _rPlayground);
122     };
123     // end of temp classes
124 
125 //.........................................................................
126 }   // namespace dbaui
127 //.........................................................................
128 
129 #endif // DBAUI_QUERYCONTAINERWINDOW_HXX
130 
131 /* vim: set noet sw=4 ts=4: */
132