xref: /aoo4110/main/soldep/inc/soldep/connctr.hxx (revision b1cdbd2c)
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 
25 #ifndef _FMRWRK_CONNCTR_HXX
26 #define _FMRWRK_CONNCTR_HXX
27 
28 
29 #include <vcl/window.hxx>
30 #include <soldep/listmacr.hxx>
31 #include <tools/stream.hxx>
32 
33 class DepWin;
34 class ObjectWin;
35 
36 static Rectangle aEmptyRect( Point( 0, 0), Point( 0, 0));
37 
38 class Connector
39 {
40 	ObjectWin *mpStartWin, *mpEndWin;
41 	sal_uIntPtr mnStartId, mnEndId;
42 	Point mStart, mEnd, mCenter;
43 	DepWin* mpParent;
44 
45 	sal_Bool bVisible;
46     sal_Bool mbHideIndependend;
47 	static sal_Bool msbHideMode;
48 
49 
50 public:
51 	double len;
52 	Connector( DepWin* pParent, WinBits nWinStyle );
53 	~Connector();
54 
55 	void 	Initialize( ObjectWin* pStartWin, ObjectWin* pEndWin, sal_Bool bVis = sal_False );
56 	Point 	GetMiddle();
57 	void	Paint( const Rectangle& rRect );
58 	void	UpdatePosition( ObjectWin* pWin, sal_Bool bPaint = sal_True );
59 	sal_uInt16	Save( SvFileStream& rOutFile );
60 	sal_uInt16	Load( SvFileStream& rInFile );
GetStartId()61 	sal_uIntPtr	GetStartId(){ return mnStartId; };
GetEndId()62 	sal_uIntPtr	GetEndId(){ return mnEndId; };
GetStartWin()63 	ObjectWin*	GetStartWin(){ return mpStartWin; };
GetEndWin()64 	ObjectWin*	GetEndWin(){ return mpEndWin; };
65 	ObjectWin*	GetOtherWin( ObjectWin* pWin );
66 	sal_uIntPtr	GetOtherId( sal_uIntPtr nId );
67 	sal_uIntPtr	GetLen();
68 	sal_Bool 	IsStart( ObjectWin* pWin );
SetHideIndependend(sal_Bool bHide)69     void    SetHideIndependend( sal_Bool bHide) { mbHideIndependend = bHide; };
70 
IsVisible()71 	sal_Bool 	IsVisible() { return bVisible; }
SetVisibility(sal_Bool visible)72     void    SetVisibility( sal_Bool visible ) { bVisible = visible; }
73 	void	UpdateVisibility();
SetHideMode(sal_Bool bHide)74 	void	SetHideMode(sal_Bool bHide) { msbHideMode = bHide; };
75     void    DrawOutput( OutputDevice* pDevice, const Point& rOffset  );
76 };
77 
78 DECLARE_LIST( ConnectorList, Connector* )
79 
80 #endif
81