1*b1cdbd2cSJim Jagielski /**************************************************************
2*b1cdbd2cSJim Jagielski *
3*b1cdbd2cSJim Jagielski * Licensed to the Apache Software Foundation (ASF) under one
4*b1cdbd2cSJim Jagielski * or more contributor license agreements. See the NOTICE file
5*b1cdbd2cSJim Jagielski * distributed with this work for additional information
6*b1cdbd2cSJim Jagielski * regarding copyright ownership. The ASF licenses this file
7*b1cdbd2cSJim Jagielski * to you under the Apache License, Version 2.0 (the
8*b1cdbd2cSJim Jagielski * "License"); you may not use this file except in compliance
9*b1cdbd2cSJim Jagielski * with the License. You may obtain a copy of the License at
10*b1cdbd2cSJim Jagielski *
11*b1cdbd2cSJim Jagielski * http://www.apache.org/licenses/LICENSE-2.0
12*b1cdbd2cSJim Jagielski *
13*b1cdbd2cSJim Jagielski * Unless required by applicable law or agreed to in writing,
14*b1cdbd2cSJim Jagielski * software distributed under the License is distributed on an
15*b1cdbd2cSJim Jagielski * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*b1cdbd2cSJim Jagielski * KIND, either express or implied. See the License for the
17*b1cdbd2cSJim Jagielski * specific language governing permissions and limitations
18*b1cdbd2cSJim Jagielski * under the License.
19*b1cdbd2cSJim Jagielski *
20*b1cdbd2cSJim Jagielski *************************************************************/
21*b1cdbd2cSJim Jagielski
22*b1cdbd2cSJim Jagielski
23*b1cdbd2cSJim Jagielski #ifndef _SVX_FILTNAV_HXX
24*b1cdbd2cSJim Jagielski #define _SVX_FILTNAV_HXX
25*b1cdbd2cSJim Jagielski
26*b1cdbd2cSJim Jagielski #include <com/sun/star/form/XForm.hpp>
27*b1cdbd2cSJim Jagielski #include <com/sun/star/form/runtime/XFormController.hpp>
28*b1cdbd2cSJim Jagielski #include <com/sun/star/form/runtime/XFilterController.hpp>
29*b1cdbd2cSJim Jagielski #include <svl/lstner.hxx>
30*b1cdbd2cSJim Jagielski #include <svl/brdcst.hxx>
31*b1cdbd2cSJim Jagielski
32*b1cdbd2cSJim Jagielski #include <vcl/window.hxx>
33*b1cdbd2cSJim Jagielski #include <sfx2/childwin.hxx>
34*b1cdbd2cSJim Jagielski #include <svl/poolitem.hxx>
35*b1cdbd2cSJim Jagielski #include <sfx2/bindings.hxx>
36*b1cdbd2cSJim Jagielski #include <sfx2/dockwin.hxx>
37*b1cdbd2cSJim Jagielski #include <sfx2/ctrlitem.hxx>
38*b1cdbd2cSJim Jagielski #include <vcl/image.hxx>
39*b1cdbd2cSJim Jagielski #include <svtools/svtreebx.hxx>
40*b1cdbd2cSJim Jagielski
41*b1cdbd2cSJim Jagielski #include <vcl/dialog.hxx>
42*b1cdbd2cSJim Jagielski #include <vcl/group.hxx>
43*b1cdbd2cSJim Jagielski #include <vcl/dockwin.hxx>
44*b1cdbd2cSJim Jagielski #include "svx/fmtools.hxx"
45*b1cdbd2cSJim Jagielski #include "fmexch.hxx"
46*b1cdbd2cSJim Jagielski #include <connectivity/sqlparse.hxx>
47*b1cdbd2cSJim Jagielski #include "fmexch.hxx"
48*b1cdbd2cSJim Jagielski #include "sqlparserclient.hxx"
49*b1cdbd2cSJim Jagielski
50*b1cdbd2cSJim Jagielski class FmFormShell;
51*b1cdbd2cSJim Jagielski
52*b1cdbd2cSJim Jagielski //........................................................................
53*b1cdbd2cSJim Jagielski namespace svxform
54*b1cdbd2cSJim Jagielski {
55*b1cdbd2cSJim Jagielski //........................................................................
56*b1cdbd2cSJim Jagielski
57*b1cdbd2cSJim Jagielski class FmFilterItem;
58*b1cdbd2cSJim Jagielski class FmFilterItems;
59*b1cdbd2cSJim Jagielski class FmParentData;
60*b1cdbd2cSJim Jagielski class FmFilterAdapter;
61*b1cdbd2cSJim Jagielski
62*b1cdbd2cSJim Jagielski //========================================================================
63*b1cdbd2cSJim Jagielski // data structure for the filter model
64*b1cdbd2cSJim Jagielski //========================================================================
65*b1cdbd2cSJim Jagielski class FmFilterData
66*b1cdbd2cSJim Jagielski {
67*b1cdbd2cSJim Jagielski ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xORB;
68*b1cdbd2cSJim Jagielski FmParentData* m_pParent;
69*b1cdbd2cSJim Jagielski ::rtl::OUString m_aText;
70*b1cdbd2cSJim Jagielski
71*b1cdbd2cSJim Jagielski public:
72*b1cdbd2cSJim Jagielski TYPEINFO();
FmFilterData(const::com::sun::star::uno::Reference<::com::sun::star::lang::XMultiServiceFactory> & _rxFactory,FmParentData * pParent=NULL,const::rtl::OUString & rText=::rtl::OUString ())73*b1cdbd2cSJim Jagielski FmFilterData(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory,FmParentData* pParent = NULL, const ::rtl::OUString& rText = ::rtl::OUString())
74*b1cdbd2cSJim Jagielski :m_xORB( _rxFactory )
75*b1cdbd2cSJim Jagielski ,m_pParent( pParent )
76*b1cdbd2cSJim Jagielski ,m_aText( rText )
77*b1cdbd2cSJim Jagielski {}
~FmFilterData()78*b1cdbd2cSJim Jagielski virtual ~FmFilterData(){}
79*b1cdbd2cSJim Jagielski
SetText(const::rtl::OUString & rText)80*b1cdbd2cSJim Jagielski void SetText( const ::rtl::OUString& rText ){ m_aText = rText; }
GetText() const81*b1cdbd2cSJim Jagielski ::rtl::OUString GetText() const { return m_aText; }
GetParent() const82*b1cdbd2cSJim Jagielski FmParentData* GetParent() const {return m_pParent;}
83*b1cdbd2cSJim Jagielski
84*b1cdbd2cSJim Jagielski virtual Image GetImage( BmpColorMode _eMode = BMP_COLOR_NORMAL ) const;
85*b1cdbd2cSJim Jagielski };
86*b1cdbd2cSJim Jagielski
87*b1cdbd2cSJim Jagielski //========================================================================
88*b1cdbd2cSJim Jagielski class FmParentData : public FmFilterData
89*b1cdbd2cSJim Jagielski {
90*b1cdbd2cSJim Jagielski protected:
91*b1cdbd2cSJim Jagielski ::std::vector< FmFilterData* > m_aChildren;
92*b1cdbd2cSJim Jagielski
93*b1cdbd2cSJim Jagielski public:
94*b1cdbd2cSJim Jagielski TYPEINFO();
FmParentData(const::com::sun::star::uno::Reference<::com::sun::star::lang::XMultiServiceFactory> & _rxFactory,FmParentData * pParent,const::rtl::OUString & rText)95*b1cdbd2cSJim Jagielski FmParentData(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory,FmParentData* pParent, const ::rtl::OUString& rText)
96*b1cdbd2cSJim Jagielski : FmFilterData(_rxFactory,pParent, rText)
97*b1cdbd2cSJim Jagielski {}
98*b1cdbd2cSJim Jagielski virtual ~FmParentData();
99*b1cdbd2cSJim Jagielski
GetChildren()100*b1cdbd2cSJim Jagielski ::std::vector< FmFilterData* >& GetChildren() { return m_aChildren; }
101*b1cdbd2cSJim Jagielski };
102*b1cdbd2cSJim Jagielski
103*b1cdbd2cSJim Jagielski //========================================================================
104*b1cdbd2cSJim Jagielski // Item representing the forms and subforms
105*b1cdbd2cSJim Jagielski class FmFormItem : public FmParentData
106*b1cdbd2cSJim Jagielski {
107*b1cdbd2cSJim Jagielski ::com::sun::star::uno::Reference< ::com::sun::star::form::runtime::XFormController > m_xController;
108*b1cdbd2cSJim Jagielski ::com::sun::star::uno::Reference< ::com::sun::star::form::runtime::XFilterController > m_xFilterController;
109*b1cdbd2cSJim Jagielski
110*b1cdbd2cSJim Jagielski public:
111*b1cdbd2cSJim Jagielski TYPEINFO();
112*b1cdbd2cSJim Jagielski
FmFormItem(const::com::sun::star::uno::Reference<::com::sun::star::lang::XMultiServiceFactory> & _rxFactory,FmParentData * _pParent,const::com::sun::star::uno::Reference<::com::sun::star::form::runtime::XFormController> & _xController,const::rtl::OUString & _rText)113*b1cdbd2cSJim Jagielski FmFormItem( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory,FmParentData* _pParent,
114*b1cdbd2cSJim Jagielski const ::com::sun::star::uno::Reference< ::com::sun::star::form::runtime::XFormController > & _xController,
115*b1cdbd2cSJim Jagielski const ::rtl::OUString& _rText)
116*b1cdbd2cSJim Jagielski :FmParentData( _rxFactory, _pParent, _rText )
117*b1cdbd2cSJim Jagielski ,m_xController( _xController )
118*b1cdbd2cSJim Jagielski ,m_xFilterController( _xController, ::com::sun::star::uno::UNO_QUERY_THROW )
119*b1cdbd2cSJim Jagielski {
120*b1cdbd2cSJim Jagielski }
121*b1cdbd2cSJim Jagielski
122*b1cdbd2cSJim Jagielski inline const ::com::sun::star::uno::Reference< ::com::sun::star::form::runtime::XFormController >&
GetController()123*b1cdbd2cSJim Jagielski GetController() { return m_xController; }
124*b1cdbd2cSJim Jagielski
125*b1cdbd2cSJim Jagielski inline const ::com::sun::star::uno::Reference< ::com::sun::star::form::runtime::XFilterController >&
GetFilterController()126*b1cdbd2cSJim Jagielski GetFilterController() { return m_xFilterController; }
127*b1cdbd2cSJim Jagielski
128*b1cdbd2cSJim Jagielski virtual Image GetImage( BmpColorMode _eMode = BMP_COLOR_NORMAL ) const;
129*b1cdbd2cSJim Jagielski };
130*b1cdbd2cSJim Jagielski
131*b1cdbd2cSJim Jagielski //========================================================================
132*b1cdbd2cSJim Jagielski class FmFilterItems : public FmParentData
133*b1cdbd2cSJim Jagielski {
134*b1cdbd2cSJim Jagielski public:
135*b1cdbd2cSJim Jagielski TYPEINFO();
FmFilterItems(const::com::sun::star::uno::Reference<::com::sun::star::lang::XMultiServiceFactory> & _rxFactory)136*b1cdbd2cSJim Jagielski FmFilterItems(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory):FmParentData(_rxFactory,NULL, ::rtl::OUString()){}
FmFilterItems(const::com::sun::star::uno::Reference<::com::sun::star::lang::XMultiServiceFactory> & _rxFactory,FmFormItem * pParent,const::rtl::OUString & rText)137*b1cdbd2cSJim Jagielski FmFilterItems(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory,FmFormItem* pParent, const ::rtl::OUString& rText ):FmParentData(_rxFactory,pParent, rText){}
138*b1cdbd2cSJim Jagielski
139*b1cdbd2cSJim Jagielski FmFilterItem* Find( const ::sal_Int32 _nFilterComponentIndex ) const;
140*b1cdbd2cSJim Jagielski virtual Image GetImage( BmpColorMode _eMode = BMP_COLOR_NORMAL ) const;
141*b1cdbd2cSJim Jagielski };
142*b1cdbd2cSJim Jagielski
143*b1cdbd2cSJim Jagielski //========================================================================
144*b1cdbd2cSJim Jagielski class FmFilterItem : public FmFilterData
145*b1cdbd2cSJim Jagielski {
146*b1cdbd2cSJim Jagielski ::rtl::OUString m_aFieldName;
147*b1cdbd2cSJim Jagielski const sal_Int32 m_nComponentIndex;
148*b1cdbd2cSJim Jagielski
149*b1cdbd2cSJim Jagielski public:
150*b1cdbd2cSJim Jagielski TYPEINFO();
151*b1cdbd2cSJim Jagielski FmFilterItem(
152*b1cdbd2cSJim Jagielski const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory,
153*b1cdbd2cSJim Jagielski FmFilterItems* pParent,
154*b1cdbd2cSJim Jagielski const ::rtl::OUString& aFieldName,
155*b1cdbd2cSJim Jagielski const ::rtl::OUString& aCondition,
156*b1cdbd2cSJim Jagielski const sal_Int32 _nComponentIndex
157*b1cdbd2cSJim Jagielski );
158*b1cdbd2cSJim Jagielski
GetFieldName() const159*b1cdbd2cSJim Jagielski const ::rtl::OUString& GetFieldName() const {return m_aFieldName;}
GetComponentIndex() const160*b1cdbd2cSJim Jagielski sal_Int32 GetComponentIndex() const { return m_nComponentIndex; }
161*b1cdbd2cSJim Jagielski
162*b1cdbd2cSJim Jagielski virtual Image GetImage( BmpColorMode _eMode = BMP_COLOR_NORMAL ) const;
163*b1cdbd2cSJim Jagielski };
164*b1cdbd2cSJim Jagielski
165*b1cdbd2cSJim Jagielski //========================================================================
166*b1cdbd2cSJim Jagielski class FmFilterModel : public FmParentData
167*b1cdbd2cSJim Jagielski ,public SfxBroadcaster
168*b1cdbd2cSJim Jagielski ,public ::svxform::OSQLParserClient
169*b1cdbd2cSJim Jagielski {
170*b1cdbd2cSJim Jagielski friend class FmFilterAdapter;
171*b1cdbd2cSJim Jagielski
172*b1cdbd2cSJim Jagielski ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > m_xControllers;
173*b1cdbd2cSJim Jagielski ::com::sun::star::uno::Reference< ::com::sun::star::form::runtime::XFormController > m_xController;
174*b1cdbd2cSJim Jagielski ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xORB;
175*b1cdbd2cSJim Jagielski FmFilterAdapter* m_pAdapter;
176*b1cdbd2cSJim Jagielski FmFilterItems* m_pCurrentItems;
177*b1cdbd2cSJim Jagielski
178*b1cdbd2cSJim Jagielski public:
179*b1cdbd2cSJim Jagielski TYPEINFO();
180*b1cdbd2cSJim Jagielski FmFilterModel(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory);
181*b1cdbd2cSJim Jagielski virtual ~FmFilterModel();
182*b1cdbd2cSJim Jagielski
183*b1cdbd2cSJim Jagielski void Update(const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > & xControllers, const ::com::sun::star::uno::Reference< ::com::sun::star::form::runtime::XFormController > & xCurrent);
184*b1cdbd2cSJim Jagielski void Clear();
185*b1cdbd2cSJim Jagielski sal_Bool ValidateText(FmFilterItem* pItem, UniString& rText, UniString& rErrorMsg) const;
186*b1cdbd2cSJim Jagielski void Append(FmFilterItems* pItems, FmFilterItem* pFilterItem);
187*b1cdbd2cSJim Jagielski void SetTextForItem(FmFilterItem* pItem, const ::rtl::OUString& rText);
188*b1cdbd2cSJim Jagielski
GetCurrentForm() const189*b1cdbd2cSJim Jagielski FmFormItem* GetCurrentForm() const {return m_pCurrentItems ? (FmFormItem*)m_pCurrentItems->GetParent() : NULL;}
GetCurrentItems() const190*b1cdbd2cSJim Jagielski FmFilterItems* GetCurrentItems() const {return m_pCurrentItems;}
191*b1cdbd2cSJim Jagielski void SetCurrentItems(FmFilterItems* pCurrent);
getORB() const192*b1cdbd2cSJim Jagielski ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > getORB() const { return m_xORB; }
193*b1cdbd2cSJim Jagielski
GetControllers() const194*b1cdbd2cSJim Jagielski const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > & GetControllers() const {return m_xControllers;}
GetCurrentController() const195*b1cdbd2cSJim Jagielski const ::com::sun::star::uno::Reference< ::com::sun::star::form::runtime::XFormController > & GetCurrentController() const {return m_xController;}
196*b1cdbd2cSJim Jagielski void SetCurrentController(const ::com::sun::star::uno::Reference< ::com::sun::star::form::runtime::XFormController > & xController);
197*b1cdbd2cSJim Jagielski
198*b1cdbd2cSJim Jagielski void Remove(FmFilterData* pFilterItem);
199*b1cdbd2cSJim Jagielski void AppendFilterItems( FmFormItem& _rItem );
200*b1cdbd2cSJim Jagielski void EnsureEmptyFilterRows( FmParentData& _rItem );
201*b1cdbd2cSJim Jagielski
202*b1cdbd2cSJim Jagielski protected:
203*b1cdbd2cSJim Jagielski void Insert(const ::std::vector<FmFilterData*>::iterator& rPos, FmFilterData* pFilterItem);
204*b1cdbd2cSJim Jagielski void Remove( const ::std::vector<FmFilterData*>::iterator& rPos );
205*b1cdbd2cSJim Jagielski FmFormItem* Find(const ::std::vector<FmFilterData*>& rItems, const ::com::sun::star::uno::Reference< ::com::sun::star::form::runtime::XFormController > & xController) const;
206*b1cdbd2cSJim Jagielski FmFormItem* Find(const ::std::vector<FmFilterData*>& rItems, const ::com::sun::star::uno::Reference< ::com::sun::star::form::XForm >& xForm) const;
207*b1cdbd2cSJim Jagielski void Update(const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > & xControllers, FmParentData* pParent);
208*b1cdbd2cSJim Jagielski };
209*b1cdbd2cSJim Jagielski
210*b1cdbd2cSJim Jagielski //========================================================================
211*b1cdbd2cSJim Jagielski //========================================================================
212*b1cdbd2cSJim Jagielski class OFilterItemExchange : public OLocalExchange
213*b1cdbd2cSJim Jagielski {
214*b1cdbd2cSJim Jagielski ::std::vector<FmFilterItem*> m_aDraggedEntries;
215*b1cdbd2cSJim Jagielski FmFormItem* m_pFormItem; // ensure that we drop on the same form
216*b1cdbd2cSJim Jagielski
217*b1cdbd2cSJim Jagielski public:
218*b1cdbd2cSJim Jagielski OFilterItemExchange();
219*b1cdbd2cSJim Jagielski
220*b1cdbd2cSJim Jagielski static sal_uInt32 getFormatId( );
221*b1cdbd2cSJim Jagielski inline static sal_Bool hasFormat( const DataFlavorExVector& _rFormats );
222*b1cdbd2cSJim Jagielski
getDraggedEntries() const223*b1cdbd2cSJim Jagielski const ::std::vector<FmFilterItem*>& getDraggedEntries() const { return m_aDraggedEntries; }
setDraggedEntries(const::std::vector<FmFilterItem * > & _rList)224*b1cdbd2cSJim Jagielski void setDraggedEntries(const ::std::vector<FmFilterItem*>& _rList) { m_aDraggedEntries = _rList; }
getFormItem() const225*b1cdbd2cSJim Jagielski FmFormItem* getFormItem() const { return m_pFormItem; }
226*b1cdbd2cSJim Jagielski
setFormItem(FmFormItem * _pItem)227*b1cdbd2cSJim Jagielski void setFormItem( FmFormItem* _pItem ) { m_pFormItem = _pItem; }
addSelectedItem(FmFilterItem * _pItem)228*b1cdbd2cSJim Jagielski void addSelectedItem( FmFilterItem* _pItem) { m_aDraggedEntries.push_back(_pItem); }
229*b1cdbd2cSJim Jagielski
230*b1cdbd2cSJim Jagielski protected:
231*b1cdbd2cSJim Jagielski virtual void AddSupportedFormats();
232*b1cdbd2cSJim Jagielski };
233*b1cdbd2cSJim Jagielski
hasFormat(const DataFlavorExVector & _rFormats)234*b1cdbd2cSJim Jagielski inline sal_Bool OFilterItemExchange::hasFormat( const DataFlavorExVector& _rFormats )
235*b1cdbd2cSJim Jagielski {
236*b1cdbd2cSJim Jagielski return OLocalExchange::hasFormat( _rFormats, getFormatId() );
237*b1cdbd2cSJim Jagielski }
238*b1cdbd2cSJim Jagielski
239*b1cdbd2cSJim Jagielski //====================================================================
240*b1cdbd2cSJim Jagielski //= OFilterExchangeHelper
241*b1cdbd2cSJim Jagielski //====================================================================
242*b1cdbd2cSJim Jagielski class OFilterExchangeHelper : public OLocalExchangeHelper
243*b1cdbd2cSJim Jagielski {
244*b1cdbd2cSJim Jagielski public:
OFilterExchangeHelper(Window * _pDragSource)245*b1cdbd2cSJim Jagielski OFilterExchangeHelper(Window* _pDragSource) : OLocalExchangeHelper(_pDragSource) { }
246*b1cdbd2cSJim Jagielski
operator ->() const247*b1cdbd2cSJim Jagielski OFilterItemExchange* operator->() const { return static_cast<OFilterItemExchange*>(m_pTransferable); }
248*b1cdbd2cSJim Jagielski
249*b1cdbd2cSJim Jagielski protected:
250*b1cdbd2cSJim Jagielski virtual OLocalExchange* createExchange() const;
251*b1cdbd2cSJim Jagielski };
252*b1cdbd2cSJim Jagielski
253*b1cdbd2cSJim Jagielski //========================================================================
254*b1cdbd2cSJim Jagielski class FmFilterNavigator : public SvTreeListBox, public SfxListener
255*b1cdbd2cSJim Jagielski {
256*b1cdbd2cSJim Jagielski enum DROP_ACTION{ DA_SCROLLUP, DA_SCROLLDOWN, DA_EXPANDNODE };
257*b1cdbd2cSJim Jagielski
258*b1cdbd2cSJim Jagielski FmFilterModel* m_pModel;
259*b1cdbd2cSJim Jagielski SvLBoxEntry* m_pEditingCurrently;
260*b1cdbd2cSJim Jagielski OFilterExchangeHelper m_aControlExchange;
261*b1cdbd2cSJim Jagielski
262*b1cdbd2cSJim Jagielski
263*b1cdbd2cSJim Jagielski AutoTimer m_aDropActionTimer;
264*b1cdbd2cSJim Jagielski unsigned short m_aTimerCounter;
265*b1cdbd2cSJim Jagielski Point m_aTimerTriggered; // die Position, an der der DropTimer angeschaltet wurde
266*b1cdbd2cSJim Jagielski DROP_ACTION m_aDropActionType;
267*b1cdbd2cSJim Jagielski
268*b1cdbd2cSJim Jagielski public:
269*b1cdbd2cSJim Jagielski FmFilterNavigator( Window* pParent );
270*b1cdbd2cSJim Jagielski virtual ~FmFilterNavigator();
271*b1cdbd2cSJim Jagielski
272*b1cdbd2cSJim Jagielski void UpdateContent(
273*b1cdbd2cSJim Jagielski const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > & xControllers,
274*b1cdbd2cSJim Jagielski const ::com::sun::star::uno::Reference< ::com::sun::star::form::runtime::XFormController > & xCurrent
275*b1cdbd2cSJim Jagielski );
GetFilterModel() const276*b1cdbd2cSJim Jagielski const FmFilterModel* GetFilterModel() const {return m_pModel;}
277*b1cdbd2cSJim Jagielski
278*b1cdbd2cSJim Jagielski protected:
279*b1cdbd2cSJim Jagielski using Control::Notify;
280*b1cdbd2cSJim Jagielski
281*b1cdbd2cSJim Jagielski virtual void KeyInput( const KeyEvent& rKEvt );
282*b1cdbd2cSJim Jagielski virtual void Command( const CommandEvent& rEvt );
283*b1cdbd2cSJim Jagielski virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
284*b1cdbd2cSJim Jagielski virtual void InitEntry(SvLBoxEntry* pEntry, const XubString& rStr, const Image& rImg1, const Image& rImg2, SvLBoxButtonKind eButtonKind);
285*b1cdbd2cSJim Jagielski virtual sal_Bool Select( SvLBoxEntry* pEntry, sal_Bool bSelect=sal_True );
286*b1cdbd2cSJim Jagielski virtual sal_Bool EditingEntry( SvLBoxEntry* pEntry, Selection& rSelection );
287*b1cdbd2cSJim Jagielski virtual sal_Bool EditedEntry( SvLBoxEntry* pEntry, const XubString& rNewText );
288*b1cdbd2cSJim Jagielski
289*b1cdbd2cSJim Jagielski virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt );
290*b1cdbd2cSJim Jagielski virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt );
291*b1cdbd2cSJim Jagielski virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel );
292*b1cdbd2cSJim Jagielski
293*b1cdbd2cSJim Jagielski void DeleteSelection();
294*b1cdbd2cSJim Jagielski void Clear();
295*b1cdbd2cSJim Jagielski SvLBoxEntry* FindEntry(const FmFilterData* pItem) const;
296*b1cdbd2cSJim Jagielski void Insert(FmFilterData* pItem, sal_Int32 nPos);
297*b1cdbd2cSJim Jagielski void Remove(FmFilterData* pItem);
298*b1cdbd2cSJim Jagielski
299*b1cdbd2cSJim Jagielski DECL_LINK(OnRemove, SvLBoxEntry*);
300*b1cdbd2cSJim Jagielski DECL_LINK(OnEdited, SvLBoxEntry*);
301*b1cdbd2cSJim Jagielski DECL_LINK(OnDropActionTimer, void*);
302*b1cdbd2cSJim Jagielski
303*b1cdbd2cSJim Jagielski private:
304*b1cdbd2cSJim Jagielski /** returns the first form item and the selected FilterItems in the vector
305*b1cdbd2cSJim Jagielski @param _rItemList
306*b1cdbd2cSJim Jagielski Is filled inside. <OUT/>
307*b1cdbd2cSJim Jagielski @return
308*b1cdbd2cSJim Jagielski The first form item.
309*b1cdbd2cSJim Jagielski */
310*b1cdbd2cSJim Jagielski FmFormItem* getSelectedFilterItems(::std::vector<FmFilterItem*>& _rItemList);
311*b1cdbd2cSJim Jagielski /* inserts the filter items into the tree model and creates new FilterItems if needed.
312*b1cdbd2cSJim Jagielski @param _rFilterList
313*b1cdbd2cSJim Jagielski The items which should be inserted.
314*b1cdbd2cSJim Jagielski @param _pTargetItems
315*b1cdbd2cSJim Jagielski The target where to insert the items.
316*b1cdbd2cSJim Jagielski @param _bCopy
317*b1cdbd2cSJim Jagielski If <TRUE/> the items will not be removed from the model, otherwise they will.
318*b1cdbd2cSJim Jagielski */
319*b1cdbd2cSJim Jagielski void insertFilterItem(const ::std::vector<FmFilterItem*>& _rFilterList,FmFilterItems* _pTargetItems,sal_Bool _bCopy = sal_False);
320*b1cdbd2cSJim Jagielski SvLBoxEntry* getPrevEntry(SvLBoxEntry* _pStartWith = NULL);
321*b1cdbd2cSJim Jagielski SvLBoxEntry* getNextEntry(SvLBoxEntry* _pStartWith = NULL);
322*b1cdbd2cSJim Jagielski
323*b1cdbd2cSJim Jagielski using SvTreeListBox::Select;
324*b1cdbd2cSJim Jagielski using SvTreeListBox::ExecuteDrop;
325*b1cdbd2cSJim Jagielski using SvTreeListBox::Insert;
326*b1cdbd2cSJim Jagielski };
327*b1cdbd2cSJim Jagielski
328*b1cdbd2cSJim Jagielski //========================================================================
329*b1cdbd2cSJim Jagielski class FmFilterNavigatorWin : public SfxDockingWindow, public SfxControllerItem
330*b1cdbd2cSJim Jagielski {
331*b1cdbd2cSJim Jagielski private:
332*b1cdbd2cSJim Jagielski FmFilterNavigator* m_pNavigator;
333*b1cdbd2cSJim Jagielski
334*b1cdbd2cSJim Jagielski protected:
335*b1cdbd2cSJim Jagielski virtual void Resize();
336*b1cdbd2cSJim Jagielski virtual sal_Bool Close();
337*b1cdbd2cSJim Jagielski virtual Size CalcDockingSize( SfxChildAlignment );
338*b1cdbd2cSJim Jagielski virtual SfxChildAlignment CheckAlignment( SfxChildAlignment, SfxChildAlignment );
339*b1cdbd2cSJim Jagielski
340*b1cdbd2cSJim Jagielski public:
341*b1cdbd2cSJim Jagielski FmFilterNavigatorWin( SfxBindings *pBindings, SfxChildWindow *pMgr,
342*b1cdbd2cSJim Jagielski Window* pParent );
343*b1cdbd2cSJim Jagielski virtual ~FmFilterNavigatorWin();
344*b1cdbd2cSJim Jagielski
345*b1cdbd2cSJim Jagielski void UpdateContent( FmFormShell* pFormShell );
346*b1cdbd2cSJim Jagielski void StateChanged( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState );
347*b1cdbd2cSJim Jagielski void FillInfo( SfxChildWinInfo& rInfo ) const;
348*b1cdbd2cSJim Jagielski
349*b1cdbd2cSJim Jagielski using SfxDockingWindow::StateChanged;
350*b1cdbd2cSJim Jagielski
351*b1cdbd2cSJim Jagielski virtual void GetFocus();
352*b1cdbd2cSJim Jagielski };
353*b1cdbd2cSJim Jagielski
354*b1cdbd2cSJim Jagielski //========================================================================
355*b1cdbd2cSJim Jagielski class FmFilterNavigatorWinMgr : public SfxChildWindow
356*b1cdbd2cSJim Jagielski {
357*b1cdbd2cSJim Jagielski public:
358*b1cdbd2cSJim Jagielski FmFilterNavigatorWinMgr( Window *pParent, sal_uInt16 nId, SfxBindings *pBindings,
359*b1cdbd2cSJim Jagielski SfxChildWinInfo *pInfo );
360*b1cdbd2cSJim Jagielski SFX_DECL_CHILDWINDOW( FmFilterNavigatorWinMgr );
361*b1cdbd2cSJim Jagielski };
362*b1cdbd2cSJim Jagielski
363*b1cdbd2cSJim Jagielski //........................................................................
364*b1cdbd2cSJim Jagielski } // namespace svxform
365*b1cdbd2cSJim Jagielski //........................................................................
366*b1cdbd2cSJim Jagielski
367*b1cdbd2cSJim Jagielski #endif // _SVX_FILTNAV_HXX
368*b1cdbd2cSJim Jagielski
369