summaryrefslogtreecommitdiff
path: root/xfa/fwl/cfwl_listitem.h
blob: c4af1d89b5672b56f85a3e3e98249b7aa4d91436 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Copyright 2016 PDFium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com

#ifndef XFA_FWL_CFWL_LISTITEM_H_
#define XFA_FWL_CFWL_LISTITEM_H_

#include "core/fxcrt/fx_coordinates.h"
#include "core/fxcrt/fx_string.h"

class CFX_DIBitmap;

class CFWL_ListItem {
 public:
  explicit CFWL_ListItem(const CFX_WideString& text);
  ~CFWL_ListItem();

  CFX_RectF GetRect() const { return m_rtItem; }
  void SetRect(const CFX_RectF& rect) { m_rtItem = rect; }

  uint32_t GetStyles() const { return m_dwStates; }
  void SetStyles(uint32_t dwStyle) { m_dwStates = dwStyle; }

  CFX_RectF GetCheckRect() const { return m_rtCheckBox; }
  void SetCheckRect(const CFX_RectF& rtCheck) { m_rtCheckBox = rtCheck; }

  uint32_t GetStates() const { return GetStyles() | GetCheckState(); }

  uint32_t GetCheckState() const { return m_dwCheckState; }
  void SetCheckState(uint32_t dwCheckState) { m_dwCheckState = dwCheckState; }

  CFX_DIBitmap* GetIcon() const { return m_pDIB; }

  CFX_WideString GetText() const { return m_wsText; }

 private:
  CFX_RectF m_rtItem;
  uint32_t m_dwStates;
  CFX_WideString m_wsText;
  CFX_DIBitmap* m_pDIB;
  uint32_t m_dwCheckState;
  CFX_RectF m_rtCheckBox;
};

#endif  // XFA_FWL_CFWL_LISTITEM_H_