lok: calc - send other views our selection in their co-ordinates.
[LibreOffice.git] / include / svx / textchain.hxx
blobcba226c98ff28e699ae4c0e547cd26d5a3aab17e
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_SVX_TEXTCHAIN_HXX
21 #define INCLUDED_SVX_TEXTCHAIN_HXX
23 #include <editeng/editdata.hxx>
24 #include <map>
26 class ImpChainLinkProperties;
27 class SdrTextObj;
28 class SdrModel;
30 namespace rtl {
31 class OUString;
34 typedef OUString ChainLinkId;
36 enum class CursorChainingEvent
38 TO_NEXT_LINK,
39 TO_PREV_LINK,
40 UNCHANGED,
41 NULL_EVENT
44 class ImpChainLinkProperties
46 protected:
47 friend class TextChain;
49 ImpChainLinkProperties() {
50 aNilChainingEvent = false;
51 aCursorEvent = CursorChainingEvent::NULL_EVENT;
52 aPreChainingSel = ESelection(0,0,0,0);
53 aPostChainingSel = ESelection(0,0,0,0);
54 aIsPartOfLastParaInNextLink = false; // XXX: Should come from file
55 aSwitchingToNextBox = false;
58 private:
59 // NOTE: Remember to set default value in constructor when adding field
60 bool aNilChainingEvent;
61 CursorChainingEvent aCursorEvent;
62 ESelection aPreChainingSel;
63 ESelection aPostChainingSel;
64 bool aIsPartOfLastParaInNextLink;
65 bool aSwitchingToNextBox;
69 class TextChain
71 public:
72 ~TextChain();
74 ImpChainLinkProperties *GetLinkProperties(const SdrTextObj *);
76 // Specific Link Properties
77 CursorChainingEvent const & GetCursorEvent(const SdrTextObj *);
78 void SetCursorEvent(const SdrTextObj *, CursorChainingEvent const &);
80 bool GetNilChainingEvent(const SdrTextObj *);
81 void SetNilChainingEvent(const SdrTextObj *, bool);
83 ESelection const & GetPreChainingSel(const SdrTextObj *);
84 void SetPreChainingSel(const SdrTextObj *, ESelection const &);
86 ESelection const & GetPostChainingSel(const SdrTextObj *);
87 void SetPostChainingSel(const SdrTextObj *, ESelection const &);
89 // return whether a paragraph is split between this box and the next
90 bool GetIsPartOfLastParaInNextLink(const SdrTextObj *);
91 void SetIsPartOfLastParaInNextLink(const SdrTextObj *, bool );
93 // return whether we are currently moving the cursor to the next box (useful to know whether we should prevent SetOutlinerParaObject invocations in SdrTextObj::EndTextEdit)
94 bool GetSwitchingToNextBox(const SdrTextObj *);
95 void SetSwitchingToNextBox(const SdrTextObj *, bool);
97 protected:
98 TextChain();
100 private:
101 std::map< ChainLinkId, ImpChainLinkProperties *> maLinkPropertiesMap;
103 friend class SdrModel;
106 #endif // INCLUDED_SVX_TEXTCHAIN_HXX
108 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */