Home | History | Annotate | Download | only in qrcode
      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 
      7 #ifndef FXBARCODE_QRCODE_BC_QRCODERERRORCORRECTIONLEVEL_H_
      8 #define FXBARCODE_QRCODE_BC_QRCODERERRORCORRECTIONLEVEL_H_
      9 
     10 #include "core/fxcrt/fx_string.h"
     11 
     12 class CBC_QRCoderErrorCorrectionLevel {
     13  public:
     14   static CBC_QRCoderErrorCorrectionLevel* L;
     15   static CBC_QRCoderErrorCorrectionLevel* M;
     16   static CBC_QRCoderErrorCorrectionLevel* Q;
     17   static CBC_QRCoderErrorCorrectionLevel* H;
     18 
     19   static void Initialize();
     20   static void Finalize();
     21   static void Destroy();
     22   static CBC_QRCoderErrorCorrectionLevel* ForBits(int32_t bits);
     23 
     24   ~CBC_QRCoderErrorCorrectionLevel();
     25 
     26   int32_t Ordinal() const { return m_ordinal; }
     27   int32_t GetBits() const { return m_bits; }
     28   ByteString GetName() const { return m_name; }
     29 
     30  private:
     31   CBC_QRCoderErrorCorrectionLevel(int32_t ordinal,
     32                                   int32_t bits,
     33                                   const char* name);
     34   CBC_QRCoderErrorCorrectionLevel();
     35 
     36   int32_t m_ordinal;
     37   int32_t m_bits;
     38   ByteString m_name;
     39 };
     40 
     41 #endif  // FXBARCODE_QRCODE_BC_QRCODERERRORCORRECTIONLEVEL_H_
     42