LibreOffice Module svx (master)  1
textchain.cxx
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 #include <textchain.hxx>
21 #include <svx/svdotext.hxx>
22 
23 /*
24  * Definition of Properties Interface
25 */
26 
28 {
29  ImpChainLinkProperties *pLinkProperties = GetLinkProperties(pTarget);
30  return pLinkProperties->aCursorEvent;
31 }
32 void TextChain::SetCursorEvent(const SdrTextObj *pTarget, CursorChainingEvent const & rPropParam)
33 {
34  ImpChainLinkProperties *pLinkProperties = GetLinkProperties(pTarget);
35  pLinkProperties->aCursorEvent = rPropParam;
36 }
37 
39 {
40  ImpChainLinkProperties *pLinkProperties = GetLinkProperties(pTarget);
41  return pLinkProperties->aNilChainingEvent;
42 }
43 void TextChain::SetNilChainingEvent(const SdrTextObj *pTarget, bool b)
44 {
45  ImpChainLinkProperties *pLinkProperties = GetLinkProperties(pTarget);
46  pLinkProperties->aNilChainingEvent = b;
47 }
48 
50 {
51  ImpChainLinkProperties *pLinkProperties = GetLinkProperties(pTarget);
52  return pLinkProperties->aPreChainingSel;
53 }
54 void TextChain::SetPreChainingSel(const SdrTextObj *pTarget, ESelection const & rPropParam)
55 {
56  ImpChainLinkProperties *pLinkProperties = GetLinkProperties(pTarget);
57  pLinkProperties->aPreChainingSel = rPropParam;
58 }
59 
61 {
62  ImpChainLinkProperties *pLinkProperties = GetLinkProperties(pTarget);
63  return pLinkProperties->aPostChainingSel;
64 }
65 void TextChain::SetPostChainingSel(const SdrTextObj *pTarget, ESelection const & rPropParam)
66 {
67  ImpChainLinkProperties *pLinkProperties = GetLinkProperties(pTarget);
68  pLinkProperties->aPostChainingSel = rPropParam;
69 }
70 
72 {
73  ImpChainLinkProperties *pLinkProperties = GetLinkProperties(pTarget);
74  return pLinkProperties->aIsPartOfLastParaInNextLink;
75 }
77 {
78  ImpChainLinkProperties *pLinkProperties = GetLinkProperties(pTarget);
79  pLinkProperties->aIsPartOfLastParaInNextLink = b;
80 }
81 
83 {
84  ImpChainLinkProperties *pLinkProperties = GetLinkProperties(pTarget);
85  return pLinkProperties->aSwitchingToNextBox;
86 }
87 void TextChain::SetSwitchingToNextBox(const SdrTextObj *pTarget, bool b)
88 {
89  ImpChainLinkProperties *pLinkProperties = GetLinkProperties(pTarget);
90  pLinkProperties->aSwitchingToNextBox = b;
91 }
92 
93 /* End Definition of Properties Interface */
94 
95 /* TextChain */
96 
97 // NOTE: All getters in the class assume that the guy is in the chain
98 
100 {
101 }
102 
104 {
105  // XXX: Should free all LinkProperties
106 }
107 
108 namespace {
109 
110 ChainLinkId GetId(const SdrTextObj *pLink)
111 {
112  return pLink->GetName();
113 }
114 
115 }
116 
118 {
119  // if the guy does not already have properties in the map make them
120  ChainLinkId aLinkId = GetId(pLink);
121  if (maLinkPropertiesMap.find(aLinkId) == maLinkPropertiesMap.end()) {
123  }
124 
125  return maLinkPropertiesMap[aLinkId];
126 }
127 
128 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
ESelection const & GetPostChainingSel(const SdrTextObj *)
Definition: textchain.cxx:60
void SetPreChainingSel(const SdrTextObj *, ESelection const &)
Definition: textchain.cxx:54
ESelection const & GetPreChainingSel(const SdrTextObj *)
Definition: textchain.cxx:49
void SetNilChainingEvent(const SdrTextObj *, bool)
Definition: textchain.cxx:43
OUString ChainLinkId
Definition: textchain.hxx:33
bool GetSwitchingToNextBox(const SdrTextObj *)
Definition: textchain.cxx:82
void SetSwitchingToNextBox(const SdrTextObj *, bool)
Definition: textchain.cxx:87
CursorChainingEvent const & GetCursorEvent(const SdrTextObj *)
Definition: textchain.cxx:27
bool GetNilChainingEvent(const SdrTextObj *)
Definition: textchain.cxx:38
ESelection aPreChainingSel
Definition: textchain.hxx:61
CursorChainingEvent
Definition: textchain.hxx:35
OUString GetName() const
Definition: svdobj.cxx:698
bool GetIsPartOfLastParaInNextLink(const SdrTextObj *)
Definition: textchain.cxx:71
void SetCursorEvent(const SdrTextObj *, CursorChainingEvent const &)
Definition: textchain.cxx:32
std::map< ChainLinkId, ImpChainLinkProperties * > maLinkPropertiesMap
Definition: textchain.hxx:100
void SetIsPartOfLastParaInNextLink(const SdrTextObj *, bool)
Definition: textchain.cxx:76
CursorChainingEvent aCursorEvent
Definition: textchain.hxx:60
ImpChainLinkProperties * GetLinkProperties(const SdrTextObj *)
Definition: textchain.cxx:117
ESelection aPostChainingSel
Definition: textchain.hxx:62
void SetPostChainingSel(const SdrTextObj *, ESelection const &)
Definition: textchain.cxx:65