Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 1 | // 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 | |
dsinclair | 6539518 | 2016-05-18 11:09:47 -0700 | [diff] [blame] | 7 | #ifndef XFA_FDE_CFDE_TXTEDTPARAG_H_ |
| 8 | #define XFA_FDE_CFDE_TXTEDTPARAG_H_ |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 9 | |
dsinclair | b696f7d | 2016-05-02 06:49:58 -0700 | [diff] [blame] | 10 | #include <stdint.h> |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 11 | |
| 12 | class CFDE_TxtEdtEngine; |
| 13 | |
dsinclair | b696f7d | 2016-05-02 06:49:58 -0700 | [diff] [blame] | 14 | class CFDE_TxtEdtParag { |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 15 | public: |
| 16 | explicit CFDE_TxtEdtParag(CFDE_TxtEdtEngine* pEngine); |
| 17 | ~CFDE_TxtEdtParag(); |
| 18 | |
dsinclair | b696f7d | 2016-05-02 06:49:58 -0700 | [diff] [blame] | 19 | 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 Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 31 | void LoadParag(); |
| 32 | void UnloadParag(); |
| 33 | void CalcLines(); |
dsinclair | b696f7d | 2016-05-02 06:49:58 -0700 | [diff] [blame] | 34 | |
| 35 | private: |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 36 | int32_t m_nCharStart; |
| 37 | int32_t m_nCharCount; |
| 38 | int32_t m_nLineCount; |
tsepez | c14c958 | 2016-06-10 13:19:16 -0700 | [diff] [blame] | 39 | int32_t* m_lpData; |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 40 | CFDE_TxtEdtEngine* m_pEngine; |
| 41 | }; |
| 42 | |
dsinclair | 6539518 | 2016-05-18 11:09:47 -0700 | [diff] [blame] | 43 | #endif // XFA_FDE_CFDE_TXTEDTPARAG_H_ |