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 .
21 #include <com/sun/star/uno/XComponentContext.hpp>
22 #include <tools/gen.hxx>
23 #include <vcl/vclptr.hxx>
27 class SQLExceptionInfo
;
32 class OQueryDesignView
;
35 class OQueryContainerWindow
;
36 class OQueryController
;
38 class OQueryViewSwitch final
40 VclPtr
<OQueryDesignView
> m_pDesignView
;
41 VclPtr
<OQueryTextView
> m_pTextView
;
42 bool m_bAddTableDialogWasVisible
; // true if so
44 OQueryViewSwitch(OQueryContainerWindow
* pParent
, OQueryController
& _rController
,const css::uno::Reference
< css::uno::XComponentContext
>& );
47 bool isCutAllowed() const;
48 bool isPasteAllowed() const;
49 bool isCopyAllowed() const;
53 // clears the whole query
55 // check if the statement is correct when not returning false
56 bool checkStatement();
57 // set the statement for representation
58 void setStatement(const OUString
& _rsStatement
);
59 // returns the current sql statement
60 OUString
getStatement();
64 /** show the text or the design view
66 <TRUE/> if and only if the view could be successfully, switched, <FALSE/> otherwise
67 (In the latter case, the controller will issue another switchView call to restore the
70 bool switchView( ::dbtools::SQLExceptionInfo
* _pErrorInfo
);
71 void forceInitialView();
72 bool isSlotEnabled(sal_Int32 _nSlotId
);
73 void setSlotEnabled(sal_Int32 _nSlotId
, bool _bEnable
);
74 void setNoneVisibleRow(sal_Int32 _nRows
);
79 // returns the add table dialog from the design view
80 OAddTableDlg
* getAddTableDialog();
82 OQueryDesignView
* getDesignView() const { return m_pDesignView
; }
83 OQueryContainerWindow
* getContainer() const;
85 void SetPosSizePixel( Point _rPt
,Size _rSize
);
86 css::uno::Reference
< css::uno::XComponentContext
> const & getORB() const;
89 void impl_forceSQLView();
90 bool impl_postViewSwitch( const bool i_bGraphicalDesign
, const bool i_bSuccess
);
94 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */