merge the formfield patch from ooo-build
[ooovba.git] / dbaccess / source / ui / inc / QueryViewSwitch.hxx
blob9b0d2f6f198c1e630894c2466e6e7bd6f19701f1
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: QueryViewSwitch.hxx,v $
10 * $Revision: 1.15 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef DBAUI_QUERYVIEWSWITCH_HXX
31 #define DBAUI_QUERYVIEWSWITCH_HXX
33 #include "queryview.hxx"
35 namespace dbtools
37 class SQLExceptionInfo;
40 namespace dbaui
42 class OQueryDesignView;
43 class OQueryTextView;
44 class OAddTableDlg;
45 class OQueryContainerWindow;
46 class OQueryViewSwitch
48 OQueryDesignView* m_pDesignView;
49 OQueryTextView* m_pTextView;
50 sal_Bool m_bAddTableDialogWasVisible; // true if so
51 public:
52 OQueryViewSwitch(OQueryContainerWindow* pParent, OQueryController& _rController,const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& );
53 virtual ~OQueryViewSwitch();
55 virtual sal_Bool isCutAllowed();
56 virtual sal_Bool isPasteAllowed();
57 virtual sal_Bool isCopyAllowed();
58 virtual void copy();
59 virtual void cut();
60 virtual void paste();
61 // clears the whole query
62 virtual void clear();
63 // set the view readonly or not
64 virtual void setReadOnly(sal_Bool _bReadOnly);
65 // check if the statement is correct when not returning false
66 virtual sal_Bool checkStatement();
67 // set the statement for representation
68 virtual void setStatement(const ::rtl::OUString& _rsStatement);
69 // returns the current sql statement
70 virtual ::rtl::OUString getStatement();
71 /// late construction
72 virtual void Construct();
73 virtual void initialize();
74 /** show the text or the design view
75 @return
76 <TRUE/> if and only if the view could be successfully, switched, <FALSE/> otherwise
77 (In the latter case, the controller will issue another switchView call to restore the
78 old state)
80 bool switchView( ::dbtools::SQLExceptionInfo* _pErrorInfo );
81 sal_Bool isSlotEnabled(sal_Int32 _nSlotId);
82 void setSlotEnabled(sal_Int32 _nSlotId,sal_Bool _bEnable);
83 void setNoneVisbleRow(sal_Int32 _nRows);
84 void SaveUIConfig();
85 bool reset( ::dbtools::SQLExceptionInfo* _pErrorInfo );
86 void GrabFocus();
88 // returs the add table dialog from the design view
89 OAddTableDlg* getAddTableDialog();
91 OQueryDesignView* getDesignView() const { return m_pDesignView; }
92 OQueryContainerWindow* getContainer() const;
94 void SetPosSizePixel( Point _rPt,Size _rSize);
95 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > getORB() const;
96 protected:
97 // return the Rectangle where I can paint myself
98 virtual void resizeDocumentView(Rectangle& rRect);
101 #endif // DBAUI_QUERYVIEWSWITCH_HXX