1*53a9af0aSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*53a9af0aSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*53a9af0aSAndrew Rist * or more contributor license agreements. See the NOTICE file 5*53a9af0aSAndrew Rist * distributed with this work for additional information 6*53a9af0aSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*53a9af0aSAndrew Rist * to you under the Apache License, Version 2.0 (the 8*53a9af0aSAndrew Rist * "License"); you may not use this file except in compliance 9*53a9af0aSAndrew Rist * with the License. You may obtain a copy of the License at 10*53a9af0aSAndrew Rist * 11*53a9af0aSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*53a9af0aSAndrew Rist * 13*53a9af0aSAndrew Rist * Unless required by applicable law or agreed to in writing, 14*53a9af0aSAndrew Rist * software distributed under the License is distributed on an 15*53a9af0aSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*53a9af0aSAndrew Rist * KIND, either express or implied. See the License for the 17*53a9af0aSAndrew Rist * specific language governing permissions and limitations 18*53a9af0aSAndrew Rist * under the License. 19*53a9af0aSAndrew Rist * 20*53a9af0aSAndrew Rist *************************************************************/ 21*53a9af0aSAndrew Rist 22*53a9af0aSAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir 25cdf0e10cSrcweir #ifndef _FMRWRK_CONNCTR_HXX 26cdf0e10cSrcweir #define _FMRWRK_CONNCTR_HXX 27cdf0e10cSrcweir 28cdf0e10cSrcweir 29cdf0e10cSrcweir #include <vcl/window.hxx> 30cdf0e10cSrcweir #include <soldep/listmacr.hxx> 31cdf0e10cSrcweir #include <tools/stream.hxx> 32cdf0e10cSrcweir 33cdf0e10cSrcweir class DepWin; 34cdf0e10cSrcweir class ObjectWin; 35cdf0e10cSrcweir 36cdf0e10cSrcweir static Rectangle aEmptyRect( Point( 0, 0), Point( 0, 0)); 37cdf0e10cSrcweir 38cdf0e10cSrcweir class Connector 39cdf0e10cSrcweir { 40cdf0e10cSrcweir ObjectWin *mpStartWin, *mpEndWin; 41cdf0e10cSrcweir sal_uIntPtr mnStartId, mnEndId; 42cdf0e10cSrcweir Point mStart, mEnd, mCenter; 43cdf0e10cSrcweir DepWin* mpParent; 44cdf0e10cSrcweir 45cdf0e10cSrcweir sal_Bool bVisible; 46cdf0e10cSrcweir sal_Bool mbHideIndependend; 47cdf0e10cSrcweir static sal_Bool msbHideMode; 48cdf0e10cSrcweir 49cdf0e10cSrcweir 50cdf0e10cSrcweir public: 51cdf0e10cSrcweir double len; 52cdf0e10cSrcweir Connector( DepWin* pParent, WinBits nWinStyle ); 53cdf0e10cSrcweir ~Connector(); 54cdf0e10cSrcweir 55cdf0e10cSrcweir void Initialize( ObjectWin* pStartWin, ObjectWin* pEndWin, sal_Bool bVis = sal_False ); 56cdf0e10cSrcweir Point GetMiddle(); 57cdf0e10cSrcweir void Paint( const Rectangle& rRect ); 58cdf0e10cSrcweir void UpdatePosition( ObjectWin* pWin, sal_Bool bPaint = sal_True ); 59cdf0e10cSrcweir sal_uInt16 Save( SvFileStream& rOutFile ); 60cdf0e10cSrcweir sal_uInt16 Load( SvFileStream& rInFile ); GetStartId()61cdf0e10cSrcweir sal_uIntPtr GetStartId(){ return mnStartId; }; GetEndId()62cdf0e10cSrcweir sal_uIntPtr GetEndId(){ return mnEndId; }; GetStartWin()63cdf0e10cSrcweir ObjectWin* GetStartWin(){ return mpStartWin; }; GetEndWin()64cdf0e10cSrcweir ObjectWin* GetEndWin(){ return mpEndWin; }; 65cdf0e10cSrcweir ObjectWin* GetOtherWin( ObjectWin* pWin ); 66cdf0e10cSrcweir sal_uIntPtr GetOtherId( sal_uIntPtr nId ); 67cdf0e10cSrcweir sal_uIntPtr GetLen(); 68cdf0e10cSrcweir sal_Bool IsStart( ObjectWin* pWin ); SetHideIndependend(sal_Bool bHide)69cdf0e10cSrcweir void SetHideIndependend( sal_Bool bHide) { mbHideIndependend = bHide; }; 70cdf0e10cSrcweir IsVisible()71cdf0e10cSrcweir sal_Bool IsVisible() { return bVisible; } SetVisibility(sal_Bool visible)72cdf0e10cSrcweir void SetVisibility( sal_Bool visible ) { bVisible = visible; } 73cdf0e10cSrcweir void UpdateVisibility(); SetHideMode(sal_Bool bHide)74cdf0e10cSrcweir void SetHideMode(sal_Bool bHide) { msbHideMode = bHide; }; 75cdf0e10cSrcweir void DrawOutput( OutputDevice* pDevice, const Point& rOffset ); 76cdf0e10cSrcweir }; 77cdf0e10cSrcweir 78cdf0e10cSrcweir DECLARE_LIST( ConnectorList, Connector* ) 79cdf0e10cSrcweir 80cdf0e10cSrcweir #endif 81