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 .
19 #ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_QUERYVIEWSWITCH_HXX
20 #define INCLUDED_DBACCESS_SOURCE_UI_INC_QUERYVIEWSWITCH_HXX
22 #include "queryview.hxx"
26 class SQLExceptionInfo
;
31 class OQueryDesignView
;
34 class OQueryContainerWindow
;
35 class OQueryViewSwitch
37 VclPtr
<OQueryDesignView
> m_pDesignView
;
38 VclPtr
<OQueryTextView
> m_pTextView
;
39 bool m_bAddTableDialogWasVisible
; // true if so
41 OQueryViewSwitch(OQueryContainerWindow
* pParent
, OQueryController
& _rController
,const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
>& );
42 virtual ~OQueryViewSwitch();
45 bool isPasteAllowed();
50 // clears the whole query
52 // check if the statement is correct when not returning false
53 bool checkStatement();
54 // set the statement for representation
55 void setStatement(const OUString
& _rsStatement
);
56 // returns the current sql statement
57 OUString
getStatement();
61 /** show the text or the design view
63 <TRUE/> if and only if the view could be successfully, switched, <FALSE/> otherwise
64 (In the latter case, the controller will issue another switchView call to restore the
67 bool switchView( ::dbtools::SQLExceptionInfo
* _pErrorInfo
);
68 void forceInitialView();
69 bool isSlotEnabled(sal_Int32 _nSlotId
);
70 void setSlotEnabled(sal_Int32 _nSlotId
, bool _bEnable
);
71 void setNoneVisbleRow(sal_Int32 _nRows
);
73 bool reset( ::dbtools::SQLExceptionInfo
* _pErrorInfo
);
76 // returns the add table dialog from the design view
77 OAddTableDlg
* getAddTableDialog();
79 OQueryDesignView
* getDesignView() const { return m_pDesignView
; }
80 OQueryContainerWindow
* getContainer() const;
82 void SetPosSizePixel( Point _rPt
,Size _rSize
);
83 ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
> getORB() const;
86 void impl_forceSQLView();
87 bool impl_postViewSwitch( const bool i_bGraphicalDesign
, const bool i_bSuccess
);
90 #endif // INCLUDED_DBACCESS_SOURCE_UI_INC_QUERYVIEWSWITCH_HXX
92 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */