13334a7e6SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 33334a7e6SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 43334a7e6SAndrew Rist * or more contributor license agreements. See the NOTICE file 53334a7e6SAndrew Rist * distributed with this work for additional information 63334a7e6SAndrew Rist * regarding copyright ownership. The ASF licenses this file 73334a7e6SAndrew Rist * to you under the Apache License, Version 2.0 (the 83334a7e6SAndrew Rist * "License"); you may not use this file except in compliance 93334a7e6SAndrew Rist * with the License. You may obtain a copy of the License at 10cdf0e10cSrcweir * 113334a7e6SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir * 133334a7e6SAndrew Rist * Unless required by applicable law or agreed to in writing, 143334a7e6SAndrew Rist * software distributed under the License is distributed on an 153334a7e6SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 163334a7e6SAndrew Rist * KIND, either express or implied. See the License for the 173334a7e6SAndrew Rist * specific language governing permissions and limitations 183334a7e6SAndrew Rist * under the License. 19cdf0e10cSrcweir * 203334a7e6SAndrew Rist *************************************************************/ 213334a7e6SAndrew Rist 223334a7e6SAndrew Rist 23cdf0e10cSrcweir #ifndef _SVX_COLRCTRL_HXX 24cdf0e10cSrcweir #define _SVX_COLRCTRL_HXX 25cdf0e10cSrcweir 26cdf0e10cSrcweir #include <sfx2/dockwin.hxx> 27cdf0e10cSrcweir #include <sfx2/childwin.hxx> 2828bcfa49SArmin Le Grand #include <svx/SvxColorValueSet.hxx> 29cdf0e10cSrcweir #include <svtools/transfer.hxx> 30cdf0e10cSrcweir #include <svl/lstner.hxx> 31cdf0e10cSrcweir #include "svx/svxdllapi.h" 32cdf0e10cSrcweir 33cdf0e10cSrcweir class SvData; 34cdf0e10cSrcweir 35cdf0e10cSrcweir /************************************************************************* 36cdf0e10cSrcweir |* 3728bcfa49SArmin Le Grand |* SvxColorValueSet_docking 38cdf0e10cSrcweir |* 39cdf0e10cSrcweir \************************************************************************/ 40cdf0e10cSrcweir 4128bcfa49SArmin Le Grand class SvxColorValueSet_docking : public SvxColorValueSet, public DragSourceHelper 42cdf0e10cSrcweir { 43cdf0e10cSrcweir private: 4428bcfa49SArmin Le Grand using SvxColorValueSet::StartDrag; 45cdf0e10cSrcweir 4628bcfa49SArmin Le Grand bool mbLeftButton; 47cdf0e10cSrcweir Point aDragPosPixel; 48cdf0e10cSrcweir 49cdf0e10cSrcweir protected: 50cdf0e10cSrcweir 51cdf0e10cSrcweir void DoDrag(); 52cdf0e10cSrcweir 53cdf0e10cSrcweir // ValueSet 54cdf0e10cSrcweir virtual void MouseButtonDown( const MouseEvent& rMEvt ); 55cdf0e10cSrcweir virtual void MouseButtonUp( const MouseEvent& rMEvt ); 56cdf0e10cSrcweir virtual void Command(const CommandEvent& rCEvt ); 57cdf0e10cSrcweir 58cdf0e10cSrcweir // DragSourceHelper 59cdf0e10cSrcweir virtual void StartDrag( sal_Int8 nAction, const Point& rPtPixel ); 60cdf0e10cSrcweir 6128bcfa49SArmin Le Grand DECL_STATIC_LINK(SvxColorValueSet_docking, ExecDragHdl, void*); 62cdf0e10cSrcweir 63cdf0e10cSrcweir public: 6428bcfa49SArmin Le Grand SvxColorValueSet_docking( Window* pParent, WinBits nWinStyle = WB_ITEMBORDER ); 6528bcfa49SArmin Le Grand SvxColorValueSet_docking( Window* pParent, const ResId& rResId ); 66cdf0e10cSrcweir 6728bcfa49SArmin Le Grand bool IsLeftButton() const { return mbLeftButton; } 68cdf0e10cSrcweir }; 69cdf0e10cSrcweir 70cdf0e10cSrcweir /************************************************************************* 71cdf0e10cSrcweir |* 72cdf0e10cSrcweir |* SvxColorDockingWindow 73cdf0e10cSrcweir |* 74cdf0e10cSrcweir \************************************************************************/ 75cdf0e10cSrcweir 76cdf0e10cSrcweir class SvxColorDockingWindow : public SfxDockingWindow, public SfxListener 77cdf0e10cSrcweir { 78cdf0e10cSrcweir friend class SvxColorChildWindow; 79cdf0e10cSrcweir 80cdf0e10cSrcweir private: 81*c7be74b1SArmin Le Grand XColorListSharedPtr maColorTable; 8228bcfa49SArmin Le Grand SvxColorValueSet_docking aColorSet; 83cdf0e10cSrcweir sal_uInt16 nLeftSlot; 84cdf0e10cSrcweir sal_uInt16 nRightSlot; 85cdf0e10cSrcweir sal_uInt16 nCols; 86cdf0e10cSrcweir sal_uInt16 nLines; 87cdf0e10cSrcweir long nCount; 88cdf0e10cSrcweir Size aItemSize; 89cdf0e10cSrcweir 90cdf0e10cSrcweir //#if 0 // _SOLAR__PRIVATE 91cdf0e10cSrcweir void FillValueSet(); 92cdf0e10cSrcweir void SetSize(); 93cdf0e10cSrcweir DECL_LINK( SelectHdl, void * ); 94cdf0e10cSrcweir 95cdf0e10cSrcweir /** This function is called when the window gets the focus. It grabs 96cdf0e10cSrcweir the focus to the color value set so that it can be controlled with 97cdf0e10cSrcweir the keyboard. 98cdf0e10cSrcweir */ 99cdf0e10cSrcweir virtual void GetFocus (void); 100cdf0e10cSrcweir //#endif 101cdf0e10cSrcweir 102cdf0e10cSrcweir protected: 103cdf0e10cSrcweir virtual sal_Bool Close(); 104cdf0e10cSrcweir virtual void Resize(); 105cdf0e10cSrcweir virtual void Resizing( Size& rSize ); 106cdf0e10cSrcweir 107cdf0e10cSrcweir public: 108cdf0e10cSrcweir SvxColorDockingWindow( SfxBindings* pBindings, 109cdf0e10cSrcweir SfxChildWindow *pCW, 110cdf0e10cSrcweir Window* pParent, 111cdf0e10cSrcweir const ResId& rResId ); 112cdf0e10cSrcweir ~SvxColorDockingWindow(); 113cdf0e10cSrcweir 114cdf0e10cSrcweir virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); 115cdf0e10cSrcweir 116cdf0e10cSrcweir void SetSlotIDs( sal_uInt16 nLeft, sal_uInt16 nRight ) 117cdf0e10cSrcweir { nLeftSlot = nLeft; nRightSlot = nRight; } 118cdf0e10cSrcweir 119cdf0e10cSrcweir virtual long Notify( NotifyEvent& rNEvt ); 120cdf0e10cSrcweir }; 121cdf0e10cSrcweir 122cdf0e10cSrcweir #endif 123cdf0e10cSrcweir 124