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 _SFXCTRLITEM_HXX
20 #define _SFXCTRLITEM_HXX
22 #include "sal/config.h"
23 #include "sfx2/dllapi.h"
24 #include "sal/types.h"
25 #include <svl/poolitem.hxx>
31 class SFX2_DLLPUBLIC SfxControllerItem
35 SfxControllerItem
* pNext
; // to notify next ControllerItem
36 SfxBindings
* pBindings
;
39 #if defined( DBG_UTIL )
40 SAL_DLLPRIVATE
void CheckConfigure_Impl( sal_uIntPtr nType
);
44 SfxBindings
& GetBindings() {
45 DBG_ASSERT(pBindings
, "no Bindings");
48 const SfxBindings
& GetBindings() const {
49 DBG_ASSERT(pBindings
, "no Bindings");
53 SfxControllerItem(); // for arrays
54 SfxControllerItem( sal_uInt16 nId
, SfxBindings
& );
55 virtual ~SfxControllerItem();
57 void Bind( sal_uInt16 nNewId
, SfxBindings
* = 0); // Register in SfxBindings
60 sal_Bool
IsBound() const;
62 void SetBindings(SfxBindings
&rBindings
) { pBindings
= &rBindings
; }
64 SfxControllerItem
* GetItemLink();
65 SfxControllerItem
* ChangeItemLink( SfxControllerItem
* pNewLink
);
67 void SetId( sal_uInt16 nItemId
);
68 sal_uInt16
GetId() const { return nId
; }
70 virtual void StateChanged( sal_uInt16 nSID
, SfxItemState eState
,
71 const SfxPoolItem
* pState
);
72 virtual void DeleteFloatingWindow();
74 SfxMapUnit
GetCoreMetric() const;
76 static SfxItemState
GetItemState( const SfxPoolItem
* pState
);
78 SAL_DLLPRIVATE sal_Bool
IsBindable_Impl() const
79 { return pBindings
!= NULL
; }
80 SAL_DLLPRIVATE
void BindInternal_Impl( sal_uInt16 nNewId
, SfxBindings
* );
83 //====================================================================
85 class SFX2_DLLPUBLIC SfxStatusForwarder
: public SfxControllerItem
87 SfxControllerItem
* pMaster
;
90 virtual void StateChanged( sal_uInt16 nSID
, SfxItemState eState
,
91 const SfxPoolItem
* pState
);
94 SfxStatusForwarder( sal_uInt16 nSlotId
,
95 SfxControllerItem
&rMaster
);
100 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */