1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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_QUERYDESIGNVIEW_HXX
20 #define INCLUDED_DBACCESS_SOURCE_UI_INC_QUERYDESIGNVIEW_HXX
22 #include "queryview.hxx"
23 #include <vcl/split.hxx>
24 #include "QEnumTypes.hxx"
25 #include <com/sun/star/beans/XPropertySet.hpp>
26 #include "querycontroller.hxx"
27 #include "ConnectionLineData.hxx"
29 namespace connectivity
44 eColumnInLikeNotFound
,
51 eIllegalJoinCondition
,
55 class OSelectionBrowseBox
;
56 class OQueryContainerWindow
;
58 class OQueryDesignView
: public OQueryView
67 VclPtr
<Splitter
> m_aSplitter
;
69 ::com::sun::star::lang::Locale m_aLocale
;
70 OUString m_sDecimalSep
;
72 VclPtr
<OSelectionBrowseBox
> m_pSelectionBox
; // presents the lower window
73 ChildFocusState m_eChildFocus
;
74 bool m_bInSplitHandler
;
77 OQueryDesignView(OQueryContainerWindow
* pParent
, OQueryController
& _rController
,const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
>& );
78 virtual ~OQueryDesignView();
79 virtual void dispose() SAL_OVERRIDE
;
81 virtual bool isCutAllowed() SAL_OVERRIDE
;
82 virtual bool isPasteAllowed() SAL_OVERRIDE
;
83 virtual bool isCopyAllowed() SAL_OVERRIDE
;
84 virtual void copy() SAL_OVERRIDE
;
85 virtual void cut() SAL_OVERRIDE
;
86 virtual void paste() SAL_OVERRIDE
;
87 // clears the whole query
88 virtual void clear() SAL_OVERRIDE
;
89 // set the view readonly or not
90 virtual void setReadOnly(bool _bReadOnly
) SAL_OVERRIDE
;
91 // check if the statement is correct when not returning false
92 bool checkStatement();
93 // set the statement for representation
94 virtual void setStatement(const OUString
& _rsStatement
) SAL_OVERRIDE
;
95 // returns the current sql statement
96 virtual OUString
getStatement() SAL_OVERRIDE
;
98 virtual void Construct() SAL_OVERRIDE
;
99 virtual void initialize() SAL_OVERRIDE
;
101 virtual bool PreNotify( NotifyEvent
& rNEvt
) SAL_OVERRIDE
;
102 virtual void GetFocus() SAL_OVERRIDE
;
104 bool isSlotEnabled(sal_Int32 _nSlotId
);
105 void setSlotEnabled(sal_Int32 _nSlotId
, bool _bEnable
);
106 void setNoneVisbleRow(sal_Int32 _nRows
);
108 ::com::sun::star::lang::Locale
getLocale() const { return m_aLocale
;}
109 OUString
getDecimalSeparator() const { return m_sDecimalSep
;}
111 SqlParseError
InsertField( const OTableFieldDescRef
& rInfo
, bool bVis
= true, bool bActivate
= true);
112 bool HasFieldByAliasName(const OUString
& rFieldName
, OTableFieldDescRef
& rInfo
) const;
113 // save the position of the table window and the pos of the splitters
114 // called when fields are deleted
115 void DeleteFields( const OUString
& rAliasName
);
116 // called when a table from tabeview was deleted
117 void TableDeleted(const OUString
& rAliasName
);
119 sal_Int32
getColWidth( sal_uInt16 _nColPos
) const;
120 void fillValidFields(const OUString
& strTableName
, ComboBox
* pFieldList
);
127 /** initializes the view from the current parser / parse iterator of the controller
130 When not <NULL/>, the instance pointed to by this parameter takes the error
131 which happened during the initialization.
132 If it is not <NULL/>, then any such error will be displayed, using the controller's
135 @return <TRUE/> if and only if the initialization was successful
137 bool initByParseIterator( ::dbtools::SQLExceptionInfo
* _pErrorInfo
);
139 void initByFieldDescriptions(
140 const ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
>& i_rFieldDescriptions
143 ::connectivity::OSQLParseNode
* getPredicateTreeFromEntry( OTableFieldDescRef pEntry
,
144 const OUString
& _sCriteria
,
145 OUString
& _rsErrorMessage
,
146 ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
>& _rxColumn
) const;
148 void fillFunctionInfo( const ::connectivity::OSQLParseNode
* pNode
149 ,const OUString
& sFunctionTerm
150 ,OTableFieldDescRef
& aInfo
);
152 // return the Rectangle where I can paint myself
153 virtual void resizeDocumentView(Rectangle
& rRect
) SAL_OVERRIDE
;
154 DECL_LINK( SplitHdl
, void* );
157 using OQueryView::SaveTabWinUIConfig
;
160 #endif // INCLUDED_DBACCESS_SOURCE_UI_INC_QUERYDESIGNVIEW_HXX
162 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */