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 _SOLDEPTBOX_HXX 25 #define _SOLDEPTBOX_HXX 26 27 #include <vcl/toolbox.hxx> 28 #include <vcl/menu.hxx> 29 30 class SoldepToolBox : public ToolBox 31 { 32 protected: 33 // sal_uInt16 nBuildServerToolBoxId; 34 sal_Bool bDockable; 35 sal_Bool bCloseMode; 36 sal_Bool bOldFloatMode; 37 sal_Bool bBoxIsVisible; 38 sal_Bool bPin; 39 sal_Bool bPinable; 40 41 PopupMenu aMenu; 42 43 Rectangle aOutRect; 44 Rectangle aInRect; 45 46 Link aResizeHdl; 47 Link aMouseDownHdl; 48 49 Bitmap aPinedBitmap; 50 Bitmap aUnpinedBitmap; 51 52 void InitContextMenu(); 53 54 public: 55 SoldepToolBox( Window* pParent, const ResId& aId, sal_Bool bDAble = sal_True ); 56 ~SoldepToolBox(); 57 58 virtual void Command( const CommandEvent& rCEvt); 59 virtual void CallContextMenu( Window *pWin, Point aPos ); 60 virtual void Paint( const Rectangle& rRect ); 61 virtual void MouseButtonDown(const MouseEvent& rEvent); 62 virtual void MouseButtonUp(const MouseEvent& rEvent); 63 virtual void MouseMove(const MouseEvent& rEvent); 64 65 virtual void ToggleFloatingMode(); 66 // void SetFloatingWindow( FloatingWindow* pFW) { ToolBox::mpFloatWin = pFW; } 67 virtual void StartDocking(); 68 virtual void EndDocking( const Rectangle& rRect, sal_Bool bFloatMode ); 69 virtual sal_Bool Close(); 70 virtual void CloseDockingMode(); 71 72 //Called when toolbar droped Tracking(const TrackingEvent & rTEvt)73 virtual void Tracking( const TrackingEvent &rTEvt ) { Invalidate(); ToolBox::Tracking( rTEvt );} 74 75 virtual void Move(); 76 77 using DockingWindow::SetPosSizePixel; 78 void SetPosSizePixel( const Point& rNewPos, 79 const Size& rNewSize ); 80 81 void SetDockingRects( const Rectangle& rOutRect, 82 const Rectangle& rInRect ); 83 SetMouseDownHdl(const Link & rLink)84 void SetMouseDownHdl(const Link& rLink) { aMouseDownHdl = rLink; } GetMouseDownHdl()85 Link GetMouseDownHdl() { return aMouseDownHdl; } SetResizeHdl(const Link & rLink)86 void SetResizeHdl(const Link& rLink) { aResizeHdl = rLink; } 87 IsBoxVisible()88 sal_Bool IsBoxVisible() { return bBoxIsVisible; } 89 EnablePin(sal_Bool bEnable=sal_True)90 void EnablePin( sal_Bool bEnable = sal_True ) { bPinable = bEnable; Invalidate(); } 91 sal_Bool GetPin(); 92 void TogglePin(); 93 void SetPin(sal_Bool bP); 94 PopupMenu *GetContextMenu(); 95 DECL_LINK( MenuSelectHdl, Menu * ); 96 }; 97 98 #endif 99