blob: 4521f3be0ceecf1f541f8f1fbef281510d35eff9 [file] [log] [blame]
Dan Sinclair1770c022016-03-14 14:14:16 -04001// Copyright 2014 PDFium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
dsinclair65395182016-05-18 11:09:47 -07007#ifndef XFA_FDE_CFDE_TXTEDTPARAG_H_
8#define XFA_FDE_CFDE_TXTEDTPARAG_H_
Dan Sinclair1770c022016-03-14 14:14:16 -04009
dsinclairb696f7d2016-05-02 06:49:58 -070010#include <stdint.h>
Dan Sinclair1770c022016-03-14 14:14:16 -040011
12class CFDE_TxtEdtEngine;
13
dsinclairb696f7d2016-05-02 06:49:58 -070014class CFDE_TxtEdtParag {
Dan Sinclair1770c022016-03-14 14:14:16 -040015 public:
16 explicit CFDE_TxtEdtParag(CFDE_TxtEdtEngine* pEngine);
17 ~CFDE_TxtEdtParag();
18
dsinclairb696f7d2016-05-02 06:49:58 -070019 int32_t GetTextLength() const { return m_nCharCount; }
20 int32_t GetStartIndex() const { return m_nCharStart; }
21 int32_t GetLineCount() const { return m_nLineCount; }
22
23 void SetTextLength(int32_t len) { m_nCharCount = len; }
24 void IncrementTextLength(int32_t len) { m_nCharCount += len; }
25 void SetStartIndex(int32_t idx) { m_nCharStart = idx; }
26 void IncrementStartIndex(int32_t val) { m_nCharStart += val; }
27 void DecrementStartIndex(int32_t val) { m_nCharStart -= val; }
28 void SetLineCount(int32_t count) { m_nLineCount = count; }
29
30 void GetLineRange(int32_t nLineIndex, int32_t& nStart, int32_t& nCount) const;
Dan Sinclair1770c022016-03-14 14:14:16 -040031 void LoadParag();
32 void UnloadParag();
33 void CalcLines();
dsinclairb696f7d2016-05-02 06:49:58 -070034
35 private:
Dan Sinclair1770c022016-03-14 14:14:16 -040036 int32_t m_nCharStart;
37 int32_t m_nCharCount;
38 int32_t m_nLineCount;
tsepezc14c9582016-06-10 13:19:16 -070039 int32_t* m_lpData;
Dan Sinclair1770c022016-03-14 14:14:16 -040040 CFDE_TxtEdtEngine* m_pEngine;
41};
42
dsinclair65395182016-05-18 11:09:47 -070043#endif // XFA_FDE_CFDE_TXTEDTPARAG_H_