Bump version to 5.0-14
[LibreOffice.git] / dbaccess / source / ui / inc / QueryViewSwitch.hxx
blobccf45802c39414e3be28267c77a307018ffc06be
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 #ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_QUERYVIEWSWITCH_HXX
20 #define INCLUDED_DBACCESS_SOURCE_UI_INC_QUERYVIEWSWITCH_HXX
22 #include "queryview.hxx"
24 namespace dbtools
26 class SQLExceptionInfo;
29 namespace dbaui
31 class OQueryDesignView;
32 class OQueryTextView;
33 class OAddTableDlg;
34 class OQueryContainerWindow;
35 class OQueryViewSwitch
37 VclPtr<OQueryDesignView> m_pDesignView;
38 VclPtr<OQueryTextView> m_pTextView;
39 bool m_bAddTableDialogWasVisible; // true if so
40 public:
41 OQueryViewSwitch(OQueryContainerWindow* pParent, OQueryController& _rController,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& );
42 virtual ~OQueryViewSwitch();
44 bool isCutAllowed();
45 bool isPasteAllowed();
46 bool isCopyAllowed();
47 void copy();
48 void cut();
49 void paste();
50 // clears the whole query
51 void clear();
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();
58 /// late construction
59 void Construct();
60 void initialize();
61 /** show the text or the design view
62 @return
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
65 old state)
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);
72 void SaveUIConfig();
73 bool reset( ::dbtools::SQLExceptionInfo* _pErrorInfo );
74 void GrabFocus();
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;
85 private:
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: */