LibreOffice Module sw (master)  1
blink.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #ifndef INCLUDED_SW_SOURCE_CORE_INC_BLINK_HXX
21 #define INCLUDED_SW_SOURCE_CORE_INC_BLINK_HXX
22 
23 class SwLinePortion;
24 class SwRootFrame;
25 class SwTextFrame;
26 
27 #include <vcl/timer.hxx>
28 #include <tools/gen.hxx>
29 #include <comphelper/stl_types.hxx>
30 
31 #include <set>
32 #include <memory>
33 
35 {
39  sal_uInt16 const nDir;
40 
41 public:
42  SwBlinkPortion(const SwLinePortion* pPortion, sal_uInt16 nDirection)
43  : pPor(pPortion)
44  , pFrame(nullptr)
45  , nDir(nDirection)
46  {
47  }
49  : aPos(pBlink->aPos)
50  , pPor(pPort)
51  , pFrame(pBlink->pFrame)
52  , nDir(pBlink->nDir)
53  {
54  }
55  void SetPos( const Point& aNew ){ aPos = aNew; }
56  const Point& GetPos() const{ return aPos; }
57  void SetRootFrame( const SwRootFrame* pNew ){ pFrame = pNew; }
58  const SwRootFrame* GetRootFrame() const{ return pFrame; }
59  const SwLinePortion *GetPortion() const{ return pPor; }
60  sal_uInt16 GetDirection() const { return nDir; }
61  bool operator<( const SwBlinkPortion& rBlinkPortion ) const
62  { return reinterpret_cast<sal_IntPtr>(pPor) < reinterpret_cast<sal_IntPtr>(rBlinkPortion.pPor); }
63 };
64 
65 typedef std::set<std::unique_ptr<SwBlinkPortion>,
67 
68 class SwBlink
69 {
70  SwBlinkSet m_List;
72  bool bVisible;
73 
74 public:
75  SwBlink();
76  ~SwBlink();
77 
78  DECL_LINK( Blinker, Timer *, void );
79 
80  void Insert( const Point& rPoint, const SwLinePortion* pPor,
81  const SwTextFrame *pTextFrame, sal_uInt16 nDir );
82  void Replace( const SwLinePortion* pOld, const SwLinePortion* pNew );
83  void Delete( const SwLinePortion* pPor );
84  void FrameDelete( const SwRootFrame* pRoot );
85  bool IsVisible() const { return bVisible ; }
86 };
87 
88 // Blink-Manager, global variable, see Blink.Cxx
89 extern SwBlink *pBlink;
90 
91 #endif
92 
93 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Represents the visualization of a paragraph.
Definition: txtfrm.hxx:149
SwBlinkPortion(const SwBlinkPortion *pBlink, const SwLinePortion *pPort)
Definition: blink.hxx:48
sal_uInt16 GetDirection() const
Definition: blink.hxx:60
const SwLinePortion * pPor
Definition: blink.hxx:37
const SwRootFrame * GetRootFrame() const
Definition: blink.hxx:58
SwBlinkPortion(const SwLinePortion *pPortion, sal_uInt16 nDirection)
Definition: blink.hxx:42
The root element of a Writer document layout.
Definition: rootfrm.hxx:79
const SwRootFrame * pFrame
Definition: blink.hxx:38
void SetPos(const Point &aNew)
Definition: blink.hxx:55
const Point & GetPos() const
Definition: blink.hxx:56
sal_uInt16 const nDir
Definition: blink.hxx:39
Point aPos
Definition: blink.hxx:36
bool operator<(const SwBlinkPortion &rBlinkPortion) const
Definition: blink.hxx:61
void SetRootFrame(const SwRootFrame *pNew)
Definition: blink.hxx:57
const SwLinePortion * GetPortion() const
Definition: blink.hxx:59
Base class for anything that can be part of a line in the Writer layout.
Definition: porlin.hxx:50