LibreOffice Module sw (master)  1
txtcache.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 #ifndef INCLUDED_SW_SOURCE_CORE_TEXT_TXTCACHE_HXX
20 #define INCLUDED_SW_SOURCE_CORE_TEXT_TXTCACHE_HXX
21 
22 #include <swcache.hxx>
23 #include "porlay.hxx"
24 #include <memory>
25 
26 class SwTextFrame;
27 
28 class SwTextLine : public SwCacheObj
29 {
30  std::unique_ptr<SwParaPortion> pLine;
31 
32  virtual void UpdateCachePos() override;
33 
34 public:
35  SwTextLine( SwTextFrame const *pFrame, std::unique_ptr<SwParaPortion> pNew = nullptr );
36  virtual ~SwTextLine() override;
37 
38  SwParaPortion *GetPara() { return pLine.get(); }
39  const SwParaPortion *GetPara() const { return pLine.get(); }
40 
41  void SetPara(SwParaPortion* pNew, bool bDelete)
42  {
43  if (!bDelete)
44  (void)pLine.release();
45  pLine.reset(pNew);
46  }
47 };
48 
50 {
51 
52 protected:
53  virtual SwCacheObj *NewObj() override;
54 
55 public:
56  explicit SwTextLineAccess( const SwTextFrame *pOwner );
57 
59 
60  bool IsAvailable() const;
61 };
62 
63 #endif
64 
65 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Represents the visualization of a paragraph.
Definition: txtfrm.hxx:149
SwParaPortion * GetPara()
Definition: txtcache.cxx:49
SwParaPortion * GetPara()
Definition: txtcache.hxx:38
Collection of SwLineLayout instances, represents the paragraph text in Writer layout.
Definition: porlay.hxx:229
void SetPara(SwParaPortion *pNew, bool bDelete)
Definition: txtcache.hxx:41
SwTextLineAccess(const SwTextFrame *pOwner)
Definition: txtcache.cxx:64
virtual void UpdateCachePos() override
Definition: txtcache.cxx:37
virtual ~SwTextLine() override
Definition: txtcache.cxx:33
virtual SwCacheObj * NewObj() override
Can be use in NewObj.
Definition: txtcache.cxx:44
SwTextLine(SwTextFrame const *pFrame, std::unique_ptr< SwParaPortion > pNew=nullptr)
Definition: txtcache.cxx:27
const SwParaPortion * GetPara() const
Definition: txtcache.hxx:39
The Cache object base class Users of the Cache must derive a class from the SwCacheObj and store thei...
Definition: swcache.hxx:133
Access class for the Cache.
Definition: swcache.hxx:194
std::unique_ptr< SwParaPortion > pLine
Definition: txtcache.hxx:30
bool IsAvailable() const
Definition: txtcache.cxx:69
typedef void(CALLTYPE *GetFuncDataPtr)(sal_uInt16 &nNo