1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: QueryViewSwitch.hxx,v $
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"
37 class SQLExceptionInfo
;
42 class OQueryDesignView
;
45 class OQueryContainerWindow
;
46 class OQueryViewSwitch
48 OQueryDesignView
* m_pDesignView
;
49 OQueryTextView
* m_pTextView
;
50 sal_Bool m_bAddTableDialogWasVisible
; // true if so
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();
61 // clears the whole query
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();
72 virtual void Construct();
73 virtual void initialize();
74 /** show the text or the design view
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
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
);
85 bool reset( ::dbtools::SQLExceptionInfo
* _pErrorInfo
);
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;
97 // return the Rectangle where I can paint myself
98 virtual void resizeDocumentView(Rectangle
& rRect
);
101 #endif // DBAUI_QUERYVIEWSWITCH_HXX