LibreOffice Module dbaccess (master) 1
QueryViewSwitch.hxx
Go to the documentation of this file.
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#pragma once
20
21#include <com/sun/star/uno/XComponentContext.hpp>
22#include <tools/gen.hxx>
23#include <vcl/vclptr.hxx>
24
25namespace dbtools
26{
27 class SQLExceptionInfo;
28}
29
30namespace dbaui
31{
32 class OQueryDesignView;
33 class OQueryTextView;
34 class OAddTableDlg;
35 class OQueryContainerWindow;
36 class OQueryController;
37
38 class OQueryViewSwitch final
39 {
42 bool m_bAddTableDialogWasVisible; // true if so
43 public:
44 OQueryViewSwitch(OQueryContainerWindow* pParent, OQueryController& _rController,const css::uno::Reference< css::uno::XComponentContext >& );
46
47 bool isCutAllowed() const;
48 bool isPasteAllowed() const;
49 bool isCopyAllowed() const;
50 void copy();
51 void cut();
52 void paste();
53 // clears the whole query
54 void clear();
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();
62 void Construct();
63 void initialize();
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);
75 void SaveUIConfig();
76 void reset();
77 void GrabFocus();
78
79 // returns the add table dialog from the design view
81
84
85 void SetPosSizePixel( Point _rPt,Size _rSize);
86 css::uno::Reference< css::uno::XComponentContext > const & getORB() const;
87
88 private:
89 void impl_forceSQLView();
90 bool impl_postViewSwitch( const bool i_bGraphicalDesign, const bool i_bSuccess );
91 };
92}
93
94/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool isSlotEnabled(sal_Int32 _nSlotId)
void setSlotEnabled(sal_Int32 _nSlotId, bool _bEnable)
css::uno::Reference< css::uno::XComponentContext > const & getORB() const
void Construct()
late construction
void setNoneVisibleRow(sal_Int32 _nRows)
bool switchView(::dbtools::SQLExceptionInfo *_pErrorInfo)
show the text or the design view
void setStatement(const OUString &_rsStatement)
VclPtr< OQueryDesignView > m_pDesignView
OQueryContainerWindow * getContainer() const
void SetPosSizePixel(Point _rPt, Size _rSize)
OAddTableDlg * getAddTableDialog()
OQueryViewSwitch(OQueryContainerWindow *pParent, OQueryController &_rController, const css::uno::Reference< css::uno::XComponentContext > &)
OQueryDesignView * getDesignView() const
VclPtr< OQueryTextView > m_pTextView
bool impl_postViewSwitch(const bool i_bGraphicalDesign, const bool i_bSuccess)