xref: /trunk/main/sfx2/inc/sfx2/itemconnect.hxx (revision 353d8f4d)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef SFX_ITEMCONNECT_HXX
25 #define SFX_ITEMCONNECT_HXX
26 
27 #include "sal/config.h"
28 #include "sfx2/dllapi.h"
29 
30 #include <memory>
31 #include <sfx2/itemwrapper.hxx>
32 #include <sfx2/controlwrapper.hxx>
33 
34 // ============================================================================
35 
36 namespace sfx {
37 
38 // ============================================================================
39 
40 typedef int ItemConnFlags;
41 
42 /** No special state for the connection. */
43 const ItemConnFlags ITEMCONN_NONE               = 0x0000;
44 
45 /** Connection is inactive - virtual functions will not be called. */
46 const ItemConnFlags ITEMCONN_INACTIVE           = 0x0001;
47 /** Clone item in FillItemSet() from old item set. */
48 //const ItemConnFlags ITEMCONN_CLONE_ITEM         = 0x0002;
49 
50 /** Enable control(s), if the item is known. */
51 const ItemConnFlags ITEMCONN_ENABLE_KNOWN       = 0x0010;
52 /** Disable control(s), if the item is unknown. */
53 const ItemConnFlags ITEMCONN_DISABLE_UNKNOWN    = 0x0020;
54 /** Show control(s), if the item is known. */
55 const ItemConnFlags ITEMCONN_SHOW_KNOWN         = 0x0040;
56 /** Hide control(s), if the item is unknown. */
57 const ItemConnFlags ITEMCONN_HIDE_UNKNOWN       = 0x0080;
58 
59 /** Default value for constructors. */
60 const ItemConnFlags ITEMCONN_DEFAULT            = ITEMCONN_NONE;
61 
62 // ============================================================================
63 // Base connection classes
64 // ============================================================================
65 
66 /** A helper for SfxTabPages to connect controls to items.
67 
68     This is the base class of all control connection classes. Their purpose is
69     to connect one or more controls from an SfxTabPage with an item from an
70     item set. The goal is to omit any additional code in the virtual functions
71     Reset() and FillItemSet() in classes derived from SfxTabPage.
72 
73     Examples of connections:
74     - A check box with an SfxBoolItem,
75     - A metric (spin) field with an SfxInt32Item.
76     - A group of radio buttons with an SfxEnumItem.
77 
78     Each SfxTabPage will contain a list of connection objects (derived from
79     this class). The connection objects remember the item and control(s) they
80     have to work on. The SfxTabPage will call the DoApplyFlags(), DoReset(),
81     and DoFillItemSet() functions of all connection objects it knows. The code
82     to initialize control(s) from the item value and fill the item from
83     control(s) has to be written only once for each control type.
84 
85     Additional flags passed in the constructor allow to control the behaviour
86     of the control(s) if the item is supported/unsupported in the currently
87     used item set. For example, it is possible to specify that a control will
88     be disabled or hidden if the item is not supported. This is done before
89     each call of Reset().
90 
91     The special flag ITEMCONN_CLONE_ITEM controls how to create new items in
92     the DoFillItemSet() function. The standard (and faster) method is to create
93     a temporary item on the stack and put it into the item set. But this does
94     not work if the item set expects a special item type derived from a common
95     item class, i.e. a Boolean item derived from SfxBoolItem providing special
96     item representation text. As this code does not know the item type, the
97     item cannot be created on the stack. For this case the flag specifies to
98     use the virtual Clone() method of the pool default item. This will create
99     an item of the correct type but can still be used in conjunction with i.e.
100     the standard BoolItemWrapper.
101 
102     How to use the item connection feature:
103 
104     A)  Single item <-> single control connection
105 
106         Example: An SfxBoolItem and a check box.
107 
108         A1) Create a new item wrapper class derived from the SingleItemWrapper
109             template, or use the template directly, or use one of the
110             predefined item wrappers. See documentation of the
111             SingleItemWrapper template for details (itemwrapper.hxx).
112         A2) Create a new control wrapper class derived from the
113             SingleControlWrapper template and implement the abstract functions,
114             or use one of the predefined control wrappers. See documentation of
115             the SingleControlWrapper template for details (controlwrapper.hxx).
116         A3) Create a new connection class derived from one of the following
117             base classes, and implement the abstract functions, or use the
118             ItemControlConnection template directly, or use one of the
119             predefined connections.
120         A4) Create connection objects in the constructor of the tab page, and
121             insert them into the tab page with SfxTabPage::AddItemConnection().
122         A5) Remove old code from the tab page's Reset() and FillItemSet()
123             functions, if necessary.
124 
125     B)  Single item <-> multiple controls connections
126 
127         B1) See step A1. If the item contains multiple values (and not a
128             structure that contains all the values for the different controls),
129             the best way is to use the IdentItemWrapper template, that works
130             with the item itself. This way it is possible to provide a 'data
131             type' that contains the values for all controls.
132         B2) Create a new control wrapper class derived from the
133             MultiControlWrapper template. Add single control wrapper members
134             for all controls to this class and register them in the
135             constructor, using the RegisterControlWrapper() function. Implement
136             the abstract functions GetControlValue() and SetControlValue().
137             These functions should call the respective functions of the own
138             single control wrappers and either fill a new data object (the item
139             itself in most cases, see step B1) with all the values from the
140             controls, or fill all the controls from the data object.
141         B3) Create a new connection class derived from ItemControlConnection,
142             or use the ItemControlConnection template directly. The multiple
143             control wrapper from step B2 acts like a single control, therefore
144             it is possible to use the ItemControlConnection.
145         B4) See steps A4 and A5.
146 
147     C)  Multiple items <-> single control connections
148 
149         todo
150 
151     D)  Multiple items <-> multiple controls connections
152 
153         todo
154 
155     The current tree of base classes/templates and standard connections:
156 
157     ItemConnectionBase
158      |
159      +- DummyItemConnection   [1]
160      |
161      +- ItemControlConnection< ItemWrpT, ControlWrpT >
162      |   |
163      |   +- CheckBoxConnection   [1]
164      |   +- EditConnection   [1]
165      |   |
166      |   +- NumericConnection< ItemWrpT >   [1]
167      |   |   |
168      |   |   +- [ValueType]NumericConnection   [1] [2]
169      |   |
170      |   +- MetricConnection< ItemWrpT >   [1]
171      |   |   |
172      |   |   +- [ValueType]MetricConnection   [1] [2]
173      |   |
174      |   +- ListBoxConnection< ItemWrpT >   [1]
175      |   |   |
176      |   |   +- [ValueType]ListBoxConnection   [1] [2]
177      |   |
178      |   +- ValueSetConnection< ItemWrpT >   [1]
179      |       |
180      |       +- [ValueType]ValueSetConnection   [1] [2]
181      |
182      +- ItemConnectionArray   [1]
183 
184     Notes:
185     [1] Standard connections ready to use.
186     [2] [ValueType] is one of Int16, UInt16, Int32, UInt32.
187  */
188 class SFX2_DLLPUBLIC ItemConnectionBase
189 {
190 public:
191     virtual             ~ItemConnectionBase();
192 
193     /** Returns the flags passed in the constructor. */
GetFlags() const194     inline ItemConnFlags GetFlags() const { return mnFlags; }
195 
196     /** Activates or deactivates this connection.
197         @descr  Deactivated connections do not execute the virtual functions
198         ApplyFlags(), Reset(), and FillItemSet(). */
199     void                Activate( bool bActive = true );
200     /** Returns true if this connection is active. */
201     bool                IsActive() const;
202 
203     /** Calls the virtual ApplyFlags() function, if connection is active. */
204     void                DoApplyFlags( const SfxItemSet& rItemSet );
205     /** Calls the virtual Reset() function, if connection is active. */
206     void                DoReset( const SfxItemSet& rItemSet );
207     /** Calls the virtual FillItemSet() function, if connection is active. */
208     bool                DoFillItemSet( SfxItemSet& rDestSet, const SfxItemSet& rOldSet );
209 
210 protected:
211     explicit            ItemConnectionBase( ItemConnFlags nFlags = ITEMCONN_DEFAULT );
212 
213     /** Derived classes implement actions according to current flags here. */
214     virtual void        ApplyFlags( const SfxItemSet& rItemSet ) = 0;
215     /** Derived classes implement initializing controls from item sets here. */
216     virtual void        Reset( const SfxItemSet& rItemSet ) = 0;
217     /** Derived classes implement filling item sets from controls here. */
218     virtual bool        FillItemSet( SfxItemSet& rDestSet, const SfxItemSet& rOldSet ) = 0;
219 
220     /** Returns whether to enable a control, according to current flags. */
221     TriState            GetEnableState( bool bKnown ) const;
222     /** Returns whether to show a control, according to current flags. */
223     TriState            GetShowState( bool bKnown ) const;
224 
225 private:
226     /* Disable copy c'tor and assignment. */
227                         ItemConnectionBase( const ItemConnectionBase& );
228     ItemConnectionBase& operator=( const ItemConnectionBase& );
229 
230     ItemConnFlags       mnFlags;    /// Flags for additional options.
231 };
232 
233 // ----------------------------------------------------------------------------
234 
235 /** Base class template for single item <-> single control connection objects.
236 
237     This template uses functions provided by the SingleItemWrapper and the
238     SingleControlWrapper template classes. The virtual functions ApplyFlags(),
239     Reset(), and FillItemSet() are implemented here in a generic way using the
240     virtual functions of the wrapper classes. Derived classes only have to
241     create or otherwise provide appropriate wrappers.
242  */
243 template< typename ItemWrpT, typename ControlWrpT >
244 class ItemControlConnection : public ItemConnectionBase
245 {
246 public:
247     typedef ItemWrpT                                        ItemWrapperType;
248     typedef ControlWrpT                                     ControlWrapperType;
249     typedef ItemControlConnection< ItemWrpT, ControlWrpT >  ItemControlConnectionType;
250     typedef typename ItemWrpT::ItemType                     ItemType;
251     typedef typename ItemWrpT::ItemValueType                ItemValueType;
252     typedef typename ControlWrpT::ControlType               ControlType;
253     typedef typename ControlWrpT::ControlValueType          ControlValueType;
254 
255     typedef std::auto_ptr< ItemWrpT >                       ItemWrapperRef;
256     typedef std::auto_ptr< ControlWrpT >                    ControlWrapperRef;
257 
258     /** Receives pointer to a newly created control wrapper.
259         @descr  Takes ownership of the control wrapper. */
260     explicit            ItemControlConnection( sal_uInt16 nSlot, ControlWrpT* pNewCtrlWrp,
261                             ItemConnFlags nFlags = ITEMCONN_DEFAULT );
262 
263     /** Convenience constructor. Receives reference to a control directly.
264         @descr  May only be used, if ControlWrpT::ControlWrpT( ControlType& )
265         constructor exists. */
266     explicit            ItemControlConnection( sal_uInt16 nSlot, ControlType& rControl,
267                             ItemConnFlags nFlags = ITEMCONN_DEFAULT );
268 
269     virtual             ~ItemControlConnection();
270 
271 protected:
272     /** Actions according to current flags for the control. */
273     virtual void        ApplyFlags( const SfxItemSet& rItemSet );
274     /** Resets the control according to the item contents. */
275     virtual void        Reset( const SfxItemSet& rItemSet );
276     /** Fills the item set according to the control's state. */
277     virtual bool        FillItemSet( SfxItemSet& rDestSet, const SfxItemSet& rOldSet );
278 
279     ItemWrapperType     maItemWrp;
280     ControlWrapperRef   mxCtrlWrp;
281 };
282 
283 // ============================================================================
284 // Standard connections
285 // ============================================================================
286 
287 /** This is a helper class to enable/disable/show/hide a control only.
288 
289     This class does nothing special in the Reset() and FillItemSet() functions.
290     It can be used to control the visibility of i.e. fixed lines or fixed texts
291     related to the availability of an item by passing the appropriate flags to
292     the constructor of this connection.
293  */
294 class SFX2_DLLPUBLIC DummyItemConnection:
295     public ItemConnectionBase, public DummyWindowWrapper
296 {
297 public:
298     explicit            DummyItemConnection( sal_uInt16 nSlot, Window& rWindow,
299                             ItemConnFlags nFlags = ITEMCONN_DEFAULT );
300 
301 protected:
302     virtual void        ApplyFlags( const SfxItemSet& rItemSet );
303     virtual void        Reset( const SfxItemSet& rItemSet );
304     virtual bool        FillItemSet( SfxItemSet& rDestSet, const SfxItemSet& rOldSet );
305 
306 private:
307     sal_uInt16              mnSlot;
308 };
309 
310 // ----------------------------------------------------------------------------
311 
312 /** Connection between an SfxBoolItem and a VCL CheckBox. */
313 typedef ItemControlConnection< BoolItemWrapper, CheckBoxWrapper > CheckBoxConnection;
314 
315 /** Connection between an SfxStringItem and a VCL Edit. */
316 typedef ItemControlConnection< StringItemWrapper, EditWrapper > EditConnection;
317 
318 // ============================================================================
319 
320 /** Connection between an item and the VCL NumericField. */
321 template< typename ItemWrpT >
322 class NumericConnection : public ItemControlConnection< ItemWrpT,
323         NumericFieldWrapper< typename ItemWrpT::ItemValueType > >
324 {
325 	typedef ItemControlConnection< ItemWrpT,
326         NumericFieldWrapper< typename ItemWrpT::ItemValueType > >
327 	ItemControlConnectionType;
328 
329 public:
330     typedef typename ItemControlConnectionType::ControlWrapperType NumericFieldWrapperType;
331 
332     explicit            NumericConnection( sal_uInt16 nSlot, NumericField& rField,
333                             ItemConnFlags nFlags = ITEMCONN_DEFAULT );
334 };
335 
336 // ----------------------------------------------------------------------------
337 
338 typedef NumericConnection< Int16ItemWrapper  > Int16NumericConnection;
339 typedef NumericConnection< UInt16ItemWrapper > UInt16NumericConnection;
340 typedef NumericConnection< Int32ItemWrapper  > Int32NumericConnection;
341 typedef NumericConnection< UInt32ItemWrapper > UInt32NumericConnection;
342 
343 // ============================================================================
344 
345 /** Connection between an item and the VCL MetricField.
346 
347     Adds support of different field units during control value <-> item value
348     conversion. The field unit passed to the constructor applies for the item
349     values, while the field unit used in the control has to be set at the
350     control itself.
351  */
352 template< typename ItemWrpT >
353 class MetricConnection : public ItemControlConnection< ItemWrpT,
354         MetricFieldWrapper< typename ItemWrpT::ItemValueType > >
355 {
356 	typedef ItemControlConnection< ItemWrpT,
357         MetricFieldWrapper< typename ItemWrpT::ItemValueType > >
358 	ItemControlConnectionType;
359 
360 public:
361     typedef typename ItemControlConnectionType::ControlWrapperType MetricFieldWrapperType;
362 
363     explicit            MetricConnection( sal_uInt16 nSlot, MetricField& rField,
364                             FieldUnit eItemUnit = FUNIT_NONE, ItemConnFlags nFlags = ITEMCONN_DEFAULT );
365 };
366 
367 // ----------------------------------------------------------------------------
368 
369 typedef MetricConnection< Int16ItemWrapper  > Int16MetricConnection;
370 typedef MetricConnection< UInt16ItemWrapper > UInt16MetricConnection;
371 typedef MetricConnection< Int32ItemWrapper  > Int32MetricConnection;
372 typedef MetricConnection< UInt32ItemWrapper > UInt32MetricConnection;
373 
374 // ============================================================================
375 
376 /** Connection between an item and a VCL ListBox.
377 
378     Optionally a map can be passed that maps list box positions to item values.
379     This map MUST be terminated with an entry containing LISTBOX_ENTRY_NOTFOUND
380     as list box position. The item value contained in this last entry is used
381     as default item value in case of an error.
382  */
383 template< typename ItemWrpT >
384 class ListBoxConnection : public ItemControlConnection< ItemWrpT,
385         ListBoxWrapper< typename ItemWrpT::ItemValueType > >
386 {
387 	typedef ItemControlConnection< ItemWrpT,
388         ListBoxWrapper< typename ItemWrpT::ItemValueType > >
389 	ItemControlConnectionType;
390 
391 public:
392     typedef typename ItemControlConnectionType::ControlWrapperType  ListBoxWrapperType;
393     typedef typename ListBoxWrapperType::MapEntryType               MapEntryType;
394 
395     explicit            ListBoxConnection( sal_uInt16 nSlot, ListBox& rListBox,
396                             const MapEntryType* pMap = 0, ItemConnFlags nFlags = ITEMCONN_DEFAULT );
397 };
398 
399 // ----------------------------------------------------------------------------
400 
401 typedef ListBoxConnection< Int16ItemWrapper >  Int16ListBoxConnection;
402 typedef ListBoxConnection< UInt16ItemWrapper > UInt16ListBoxConnection;
403 typedef ListBoxConnection< Int32ItemWrapper >  Int32ListBoxConnection;
404 typedef ListBoxConnection< UInt32ItemWrapper > UInt32ListBoxConnection;
405 
406 // ============================================================================
407 
408 /** Connection between an item and an SVTOOLS ValueSet.
409 
410     Optionally a map can be passed that maps value set identifiers to item
411     values. This map MUST be terminated with an entry containing
412     VALUESET_ITEM_NOTFOUND as value set identifier. The item value contained in
413     this last entry is used as default item value in case of an error.
414  */
415 template< typename ItemWrpT >
416 class ValueSetConnection : public ItemControlConnection< ItemWrpT,
417         ValueSetWrapper< typename ItemWrpT::ItemValueType > >
418 {
419 	typedef ItemControlConnection< ItemWrpT,
420         ValueSetWrapper< typename ItemWrpT::ItemValueType > >
421 	ItemControlConnectionType;
422 
423 public:
424     typedef typename ItemControlConnectionType::ControlWrapperType  ValueSetWrapperType;
425     typedef typename ValueSetWrapperType::MapEntryType              MapEntryType;
426 
427     explicit            ValueSetConnection( sal_uInt16 nSlot, ValueSet& rValueSet,
428                             const MapEntryType* pMap = 0, ItemConnFlags nFlags = ITEMCONN_DEFAULT );
429 };
430 
431 // ----------------------------------------------------------------------------
432 
433 typedef ValueSetConnection< Int16ItemWrapper >  Int16ValueSetConnection;
434 typedef ValueSetConnection< UInt16ItemWrapper > UInt16ValueSetConnection;
435 typedef ValueSetConnection< Int32ItemWrapper >  Int32ValueSetConnection;
436 typedef ValueSetConnection< UInt32ItemWrapper > UInt32ValueSetConnection;
437 
438 // ============================================================================
439 // Array of connections
440 // ============================================================================
441 
442 class ItemConnectionArrayImpl;
443 
444 /** A container of connection objects.
445 
446     This is a connection with the only purpose to contain other connection
447     objects. This way it is possible to create a tree structure of connections
448     for a convenient connection management. This class is used by the class
449     SfxTabPage to store all connections.
450  */
451 class ItemConnectionArray : public ItemConnectionBase
452 {
453 public:
454     explicit            ItemConnectionArray();
455     virtual             ~ItemConnectionArray();
456 
457     /** Adds a new connection to the list.
458         @descr  Takes ownership of the connection! */
459     void                AddConnection( ItemConnectionBase* pConnection );
460 
461 protected:
462     virtual void        ApplyFlags( const SfxItemSet& rItemSet );
463     virtual void        Reset( const SfxItemSet& rItemSet );
464     virtual bool        FillItemSet( SfxItemSet& rDestSet, const SfxItemSet& rOldSet );
465 
466 private:
467     std::auto_ptr< ItemConnectionArrayImpl > mxImpl;
468 };
469 
470 // ============================================================================
471 
472 // ============================================================================
473 //               ***  Implementation of template functions  ***
474 // ============================================================================
475 
476 // ============================================================================
477 // Base connection classes
478 // ============================================================================
479 
480 template< typename ItemWrpT, typename ControlWrpT >
ItemControlConnection(sal_uInt16 nSlot,ControlWrpT * pNewCtrlWrp,ItemConnFlags nFlags)481 ItemControlConnection< ItemWrpT, ControlWrpT >::ItemControlConnection(
482         sal_uInt16 nSlot, ControlWrpT* pNewCtrlWrp, ItemConnFlags nFlags ) :
483     ItemConnectionBase( nFlags ),
484     maItemWrp( nSlot ),
485     mxCtrlWrp( pNewCtrlWrp )
486 {
487 }
488 
489 template< typename ItemWrpT, typename ControlWrpT >
ItemControlConnection(sal_uInt16 nSlot,ControlType & rControl,ItemConnFlags nFlags)490 ItemControlConnection< ItemWrpT, ControlWrpT >::ItemControlConnection(
491         sal_uInt16 nSlot, ControlType& rControl, ItemConnFlags nFlags ) :
492     ItemConnectionBase( nFlags ),
493     maItemWrp( nSlot ),
494     mxCtrlWrp( new ControlWrpT( rControl ) )
495 {
496 }
497 
498 template< typename ItemWrpT, typename ControlWrpT >
~ItemControlConnection()499 ItemControlConnection< ItemWrpT, ControlWrpT >::~ItemControlConnection()
500 {
501 }
502 
503 template< typename ItemWrpT, typename ControlWrpT >
ApplyFlags(const SfxItemSet & rItemSet)504 void ItemControlConnection< ItemWrpT, ControlWrpT >::ApplyFlags( const SfxItemSet& rItemSet )
505 {
506     bool bKnown = ItemWrapperHelper::IsKnownItem( rItemSet, maItemWrp.GetSlotId() );
507     mxCtrlWrp->ModifyControl( GetEnableState( bKnown ), GetShowState( bKnown ) );
508 }
509 
510 template< typename ItemWrpT, typename ControlWrpT >
Reset(const SfxItemSet & rItemSet)511 void ItemControlConnection< ItemWrpT, ControlWrpT >::Reset( const SfxItemSet& rItemSet )
512 {
513     const ItemType* pItem = maItemWrp.GetUniqueItem( rItemSet );
514     mxCtrlWrp->SetControlDontKnow( pItem == 0 );
515     if( pItem )
516         mxCtrlWrp->SetControlValue( maItemWrp.GetItemValue( *pItem ) );
517 }
518 
519 template< typename ItemWrpT, typename ControlWrpT >
FillItemSet(SfxItemSet & rDestSet,const SfxItemSet & rOldSet)520 bool ItemControlConnection< ItemWrpT, ControlWrpT >::FillItemSet(
521         SfxItemSet& rDestSet, const SfxItemSet& rOldSet )
522 {
523     const ItemType* pOldItem = maItemWrp.GetUniqueItem( rOldSet );
524     bool bChanged = false;
525     if( !mxCtrlWrp->IsControlDontKnow() )
526     {
527         // first store the control value in a local variable
528         ControlValueType aCtrlValue( mxCtrlWrp->GetControlValue() );
529         // convert to item value type -> possible to convert i.e. from 'T' to 'const T&'
530         ItemValueType aNewValue( aCtrlValue );
531         // do not rely on existence of ItemValueType::operator!=
532         if( !pOldItem || !(maItemWrp.GetItemValue( *pOldItem ) == aNewValue) )
533         {
534             sal_uInt16 nWhich = ItemWrapperHelper::GetWhichId( rDestSet, maItemWrp.GetSlotId() );
535             std::auto_ptr< ItemType > xItem(
536                 static_cast< ItemType* >( maItemWrp.GetDefaultItem( rDestSet ).Clone() ) );
537             xItem->SetWhich( nWhich );
538             maItemWrp.SetItemValue( *xItem, aNewValue );
539             rDestSet.Put( *xItem );
540             bChanged = true;
541         }
542     }
543     if( !bChanged )
544         ItemWrapperHelper::RemoveDefaultItem( rDestSet, rOldSet, maItemWrp.GetSlotId() );
545     return bChanged;
546 }
547 
548 // ============================================================================
549 // Standard connections
550 // ============================================================================
551 
552 template< typename ItemWrpT >
NumericConnection(sal_uInt16 nSlot,NumericField & rField,ItemConnFlags nFlags)553 NumericConnection< ItemWrpT >::NumericConnection(
554         sal_uInt16 nSlot, NumericField& rField, ItemConnFlags nFlags ) :
555     ItemControlConnectionType( nSlot, rField, nFlags )
556 {
557 }
558 
559 // ============================================================================
560 
561 template< typename ItemWrpT >
MetricConnection(sal_uInt16 nSlot,MetricField & rField,FieldUnit eItemUnit,ItemConnFlags nFlags)562 MetricConnection< ItemWrpT >::MetricConnection(
563         sal_uInt16 nSlot, MetricField& rField, FieldUnit eItemUnit, ItemConnFlags nFlags ) :
564     ItemControlConnectionType( nSlot, new MetricFieldWrapperType( rField, eItemUnit ), nFlags )
565 {
566 }
567 
568 // ============================================================================
569 
570 template< typename ItemWrpT >
ListBoxConnection(sal_uInt16 nSlot,ListBox & rListBox,const MapEntryType * pMap,ItemConnFlags nFlags)571 ListBoxConnection< ItemWrpT >::ListBoxConnection(
572         sal_uInt16 nSlot, ListBox& rListBox, const MapEntryType* pMap, ItemConnFlags nFlags ) :
573     ItemControlConnectionType( nSlot, new ListBoxWrapperType( rListBox, pMap ), nFlags )
574 {
575 }
576 
577 // ============================================================================
578 
579 template< typename ItemWrpT >
ValueSetConnection(sal_uInt16 nSlot,ValueSet & rValueSet,const MapEntryType * pMap,ItemConnFlags nFlags)580 ValueSetConnection< ItemWrpT >::ValueSetConnection(
581         sal_uInt16 nSlot, ValueSet& rValueSet, const MapEntryType* pMap, ItemConnFlags nFlags ) :
582     ItemControlConnectionType( nSlot, new ValueSetWrapperType( rValueSet, pMap ), nFlags )
583 {
584 }
585 
586 // ============================================================================
587 
588 } // namespace sfx
589 
590 #endif
591 
592