1*353d8f4dSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*353d8f4dSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*353d8f4dSAndrew Rist * or more contributor license agreements. See the NOTICE file 5*353d8f4dSAndrew Rist * distributed with this work for additional information 6*353d8f4dSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*353d8f4dSAndrew Rist * to you under the Apache License, Version 2.0 (the 8*353d8f4dSAndrew Rist * "License"); you may not use this file except in compliance 9*353d8f4dSAndrew Rist * with the License. You may obtain a copy of the License at 10*353d8f4dSAndrew Rist * 11*353d8f4dSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*353d8f4dSAndrew Rist * 13*353d8f4dSAndrew Rist * Unless required by applicable law or agreed to in writing, 14*353d8f4dSAndrew Rist * software distributed under the License is distributed on an 15*353d8f4dSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*353d8f4dSAndrew Rist * KIND, either express or implied. See the License for the 17*353d8f4dSAndrew Rist * specific language governing permissions and limitations 18*353d8f4dSAndrew Rist * under the License. 19*353d8f4dSAndrew Rist * 20*353d8f4dSAndrew Rist *************************************************************/ 21*353d8f4dSAndrew Rist 22*353d8f4dSAndrew Rist 23cdf0e10cSrcweir #ifndef _SFXCTRLITEM_HXX 24cdf0e10cSrcweir #define _SFXCTRLITEM_HXX 25cdf0e10cSrcweir 26cdf0e10cSrcweir #include "sal/config.h" 27cdf0e10cSrcweir #include "sfx2/dllapi.h" 28cdf0e10cSrcweir #include "sal/types.h" 29cdf0e10cSrcweir #include <svl/poolitem.hxx> 30cdf0e10cSrcweir 31cdf0e10cSrcweir class SfxPoolItem; 32cdf0e10cSrcweir class SfxBindings; 33cdf0e10cSrcweir class SvStream; 34cdf0e10cSrcweir 35cdf0e10cSrcweir class SFX2_DLLPUBLIC SfxControllerItem 36cdf0e10cSrcweir { 37cdf0e10cSrcweir private: 38cdf0e10cSrcweir sal_uInt16 nId; 39cdf0e10cSrcweir SfxControllerItem* pNext; // zu benachrichtigendes weiteres ControllerItem 40cdf0e10cSrcweir SfxBindings* pBindings; 41cdf0e10cSrcweir 42cdf0e10cSrcweir protected: 43cdf0e10cSrcweir //#if defined( DBG_UTIL ) && defined( _SOLAR__PRIVATE ) 44cdf0e10cSrcweir #if defined( DBG_UTIL ) 45cdf0e10cSrcweir SAL_DLLPRIVATE void CheckConfigure_Impl( sal_uIntPtr nType ); 46cdf0e10cSrcweir #endif 47cdf0e10cSrcweir 48cdf0e10cSrcweir public: GetBindings()49cdf0e10cSrcweir SfxBindings & GetBindings() { 50cdf0e10cSrcweir DBG_ASSERT(pBindings, "keine Bindings"); 51cdf0e10cSrcweir return *pBindings; 52cdf0e10cSrcweir } GetBindings() const53cdf0e10cSrcweir const SfxBindings & GetBindings() const { 54cdf0e10cSrcweir DBG_ASSERT(pBindings, "keine Bindings"); 55cdf0e10cSrcweir return *pBindings; 56cdf0e10cSrcweir } 57cdf0e10cSrcweir 58cdf0e10cSrcweir SfxControllerItem(); // fuer arrays 59cdf0e10cSrcweir SfxControllerItem( sal_uInt16 nId, SfxBindings & ); 60cdf0e10cSrcweir virtual ~SfxControllerItem(); 61cdf0e10cSrcweir 62cdf0e10cSrcweir void Bind( sal_uInt16 nNewId, SfxBindings * = 0); // in SfxBindings registrieren 63cdf0e10cSrcweir void UnBind(); 64cdf0e10cSrcweir void ReBind(); 65cdf0e10cSrcweir sal_Bool IsBound() const; 66cdf0e10cSrcweir void UpdateSlot(); 67cdf0e10cSrcweir void ClearCache(); SetBindings(SfxBindings & rBindings)68cdf0e10cSrcweir void SetBindings(SfxBindings &rBindings) { pBindings = &rBindings; } 69cdf0e10cSrcweir 70cdf0e10cSrcweir SfxControllerItem* GetItemLink(); 71cdf0e10cSrcweir SfxControllerItem* ChangeItemLink( SfxControllerItem* pNewLink ); 72cdf0e10cSrcweir 73cdf0e10cSrcweir void SetId( sal_uInt16 nItemId ); GetId() const74cdf0e10cSrcweir sal_uInt16 GetId() const { return nId; } 75cdf0e10cSrcweir 76cdf0e10cSrcweir virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState, 77cdf0e10cSrcweir const SfxPoolItem* pState ); 78cdf0e10cSrcweir virtual void DeleteFloatingWindow(); 79cdf0e10cSrcweir 80cdf0e10cSrcweir SfxMapUnit GetCoreMetric() const; 81cdf0e10cSrcweir 82cdf0e10cSrcweir static SfxItemState GetItemState( const SfxPoolItem* pState ); 83cdf0e10cSrcweir 84cdf0e10cSrcweir //#if 0 // _SOLAR__PRIVATE IsBindable_Impl() const85cdf0e10cSrcweir SAL_DLLPRIVATE sal_Bool IsBindable_Impl() const 86cdf0e10cSrcweir { return pBindings != NULL; } 87cdf0e10cSrcweir SAL_DLLPRIVATE void BindInternal_Impl( sal_uInt16 nNewId, SfxBindings* ); 88cdf0e10cSrcweir //#endif 89cdf0e10cSrcweir }; 90cdf0e10cSrcweir 91cdf0e10cSrcweir //==================================================================== 92cdf0e10cSrcweir 93cdf0e10cSrcweir class SFX2_DLLPUBLIC SfxStatusForwarder: public SfxControllerItem 94cdf0e10cSrcweir { 95cdf0e10cSrcweir SfxControllerItem* pMaster; 96cdf0e10cSrcweir 97cdf0e10cSrcweir protected: 98cdf0e10cSrcweir virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState, 99cdf0e10cSrcweir const SfxPoolItem* pState ); 100cdf0e10cSrcweir 101cdf0e10cSrcweir public: 102cdf0e10cSrcweir SfxStatusForwarder( sal_uInt16 nSlotId, 103cdf0e10cSrcweir SfxControllerItem&rMaster ); 104cdf0e10cSrcweir }; 105cdf0e10cSrcweir 106cdf0e10cSrcweir #endif 107cdf0e10cSrcweir 108