xref: /trunk/main/sw/source/core/inc/blink.hxx (revision 1d2dbeb0)
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 #ifndef	_BLINK_HXX
24 #define	_BLINK_HXX
25 
26 class SwLinePortion;
27 class SwRootFrm;
28 class SwTxtFrm;
29 
30 #include <vcl/timer.hxx>
31 #include <tools/gen.hxx>
32 
33 #include <svl/svarray.hxx>
34 
35 class SwBlinkPortion
36 {
37     Point               aPos;
38 	const SwLinePortion	*pPor;
39 	const SwRootFrm		*pFrm;
40     sal_uInt16              nDir;
41 public:
SwBlinkPortion(const SwLinePortion * pPortion,sal_uInt16 nDirection)42     SwBlinkPortion( const SwLinePortion* pPortion, sal_uInt16 nDirection )
43             { pPor = pPortion; nDir = nDirection; }
SwBlinkPortion(const SwBlinkPortion * pBlink,const SwLinePortion * pPort)44 	SwBlinkPortion( const SwBlinkPortion* pBlink, const SwLinePortion* pPort )
45     {   pPor = pPort; pFrm = pBlink->pFrm; aPos = pBlink->aPos; nDir = pBlink->nDir; }
SetPos(const Point & aNew)46 	void SetPos( const Point& aNew ){ aPos = aNew; }
GetPos() const47 	const Point& GetPos() const{ return aPos; }
SetRootFrm(const SwRootFrm * pNew)48 	void SetRootFrm( const SwRootFrm* pNew ){ pFrm = pNew; }
GetRootFrm() const49 	const SwRootFrm* GetRootFrm() const{ return pFrm; }
GetPortion() const50 	const SwLinePortion *GetPortion() const{ return pPor; }
GetDirection() const51     sal_uInt16 GetDirection() const { return nDir; }
operator <(const SwBlinkPortion & rBlinkPortion) const52 	sal_Bool operator<( const SwBlinkPortion& rBlinkPortion ) const
53 	{ return (long)pPor < (long)rBlinkPortion.pPor; }
operator ==(const SwBlinkPortion & rBlinkPortion) const54 	sal_Bool operator==( const SwBlinkPortion& rBlinkPortion ) const
55 	{ return (long)pPor == (long)rBlinkPortion.pPor; }
56 };
57 
58 typedef SwBlinkPortion* SwBlinkPortionPtr;
59 SV_DECL_PTRARR_SORT_DEL(SwBlinkList, SwBlinkPortionPtr, 0, 10)
60 
61 class SwBlink
62 {
63 	SwBlinkList		aList;
64 	AutoTimer		aTimer;
65 	sal_Bool			bVisible;
66 public:
67 	SwBlink();
68 	~SwBlink();
69 
70 	DECL_LINK( Blinker, Timer * );
71 
72     void Insert( const Point& rPoint, const SwLinePortion* pPor,
73                  const SwTxtFrm *pTxtFrm, sal_uInt16 nDir );
74 	void Replace( const SwLinePortion* pOld, const SwLinePortion* pNew );
75 	void Delete( const SwLinePortion* pPor );
76 	void FrmDelete( const SwRootFrm* pRoot );
IsVisible() const77 	inline sal_Bool IsVisible() const { return bVisible ; }
78 };
79 
80 // Blink-Manager, globale Variable, in Blink.Cxx angelegt
81 extern SwBlink *pBlink;
82 
83 
84 #endif
85 
86