LibreOffice Module svx (master)  1
textchainflow.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 #pragma once
21 
22 #include "textchain.hxx"
23 #include <memory>
24 
25 class SdrTextObj;
26 class SdrOutliner;
27 class NonOverflowingText;
28 class OverflowingText;
29 class TextChain;
30 class OutlinerParaObject;
31 class OFlowChainedText;
32 class UFlowChainedText;
33 
35 {
36 public:
37  TextChainFlow(SdrTextObj* pChainTarget);
38  virtual ~TextChainFlow();
39 
40  // Check for flow events in Outliner
41  virtual void CheckForFlowEvents(SdrOutliner*);
42 
44 
45  // Uses two outliners: one for the non-overflow text and one for overflowing (might be the same)
47 
48  bool IsOverflow() const;
49  bool IsUnderflow() const;
50 
51  SdrTextObj* GetLinkTarget() const;
52 
53 protected:
55 
56  TextChain* GetTextChain() const;
57 
60 
62 
63 private:
64  void impUpdateCursorInfo();
65 
66 protected:
67  std::unique_ptr<OFlowChainedText> mpOverflChText;
68  std::unique_ptr<UFlowChainedText> mpUnderflChText;
69  // Cursor related
73 
74 private:
79  bool bUnderflow;
80  bool bOverflow;
81 };
82 
83 // NOTE: EditingTextChainFlow might be strongly coupled with behavior in SdrTextObj::onChainingEvent
84 class EditingTextChainFlow final : public TextChainFlow
85 {
86 public:
88  virtual void CheckForFlowEvents(SdrOutliner*) override;
89 
90  //virtual void ExecuteOverflow(SdrOutliner *, SdrOutliner *) override;
91 
92 private:
93  virtual void impLeaveOnlyNonOverflowingText(SdrOutliner*) override;
94 
95  virtual void impSetFlowOutlinerParams(SdrOutliner*, SdrOutliner*) override;
96 
97  void impBroadcastCursorInfo() const;
98 };
99 
100 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void impUpdateCursorInfo()
bool IsOverflow() const
std::unique_ptr< UFlowChainedText > mpUnderflChText
virtual void impSetFlowOutlinerParams(SdrOutliner *, SdrOutliner *)
TextChain * mpTextChain
void ExecuteUnderflow(SdrOutliner *)
void impCheckForFlowEvents(SdrOutliner *, SdrOutliner *)
virtual void impSetFlowOutlinerParams(SdrOutliner *, SdrOutliner *) override
bool IsUnderflow() const
TextChainFlow(SdrTextObj *pChainTarget)
SdrTextObj * GetLinkTarget() const
void ExecuteOverflow(SdrOutliner *, SdrOutliner *)
void impBroadcastCursorInfo() const
virtual void impLeaveOnlyNonOverflowingText(SdrOutliner *) override
std::unique_ptr< OFlowChainedText > mpOverflChText
SdrTextObj * mpTargetLink
ESelection maOverflowPosSel
TextChain * GetTextChain() const
SdrTextObj * mpNextLink
EditingTextChainFlow(SdrTextObj *)
ESelection maPostChainingSel
virtual void impLeaveOnlyNonOverflowingText(SdrOutliner *)
void impMoveChainedTextToNextLink(SdrOutliner *)
virtual ~TextChainFlow()
bool mbPossiblyCursorOut
virtual void CheckForFlowEvents(SdrOutliner *)
virtual void CheckForFlowEvents(SdrOutliner *) override