Home | History | Annotate | Download | only in pwl
      1 // Copyright 2017 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 FPDFSDK_PWL_CPWL_APPSTREAM_H_
      8 #define FPDFSDK_PWL_CPWL_APPSTREAM_H_
      9 
     10 #include "core/fxcrt/fx_string.h"
     11 #include "core/fxcrt/unowned_ptr.h"
     12 
     13 class CPDFSDK_Widget;
     14 class CPDF_Dictionary;
     15 class CPDF_Stream;
     16 
     17 class CPWL_AppStream {
     18  public:
     19   CPWL_AppStream(CPDFSDK_Widget* widget, CPDF_Dictionary* dict);
     20   ~CPWL_AppStream();
     21 
     22   void SetAsPushButton();
     23   void SetAsCheckBox();
     24   void SetAsRadioButton();
     25   void SetAsComboBox(const WideString* sValue);
     26   void SetAsListBox();
     27   void SetAsTextField(const WideString* sValue);
     28 
     29  private:
     30   void AddImage(const ByteString& sAPType, CPDF_Stream* pImage);
     31   void Write(const ByteString& sAPType,
     32              const ByteString& sContents,
     33              const ByteString& sAPState);
     34   void Remove(const ByteString& sAPType);
     35 
     36   ByteString GetBackgroundAppStream() const;
     37   ByteString GetBorderAppStream() const;
     38 
     39   UnownedPtr<CPDFSDK_Widget> widget_;
     40   UnownedPtr<CPDF_Dictionary> dict_;
     41 };
     42 
     43 #endif  // FPDFSDK_PWL_CPWL_APPSTREAM_H_
     44