Gtk-WARNING gtktreestore.c:1047: Invalid column number 1 added to iter
[LibreOffice.git] / dbaccess / source / ui / inc / QueryViewSwitch.hxx
blob0f17d40bdcbf70966079a820f696127acee962f5
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 #pragma once
21 #include <com/sun/star/uno/XComponentContext.hpp>
22 #include <tools/gen.hxx>
23 #include <vcl/vclptr.hxx>
25 namespace dbtools
27 class SQLExceptionInfo;
30 namespace dbaui
32 class OQueryDesignView;
33 class OQueryTextView;
34 class OAddTableDlg;
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
43 public:
44 OQueryViewSwitch(OQueryContainerWindow* pParent, OQueryController& _rController,const css::uno::Reference< css::uno::XComponentContext >& );
45 ~OQueryViewSwitch();
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();
61 /// late construction
62 void Construct();
63 void initialize();
64 /** show the text or the design view
65 @return
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
68 old state)
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();
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;
88 private:
89 void impl_forceSQLView();
90 bool impl_postViewSwitch( const bool i_bGraphicalDesign, const bool i_bSuccess );
94 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */