//---------------------------------------------------------------------------
#ifndef MainH
#define MainH
//---------------------------------------------------------------------------
#include <System.Classes.hpp>
#include <FMX.Controls.hpp>
#include <FMX.Forms.hpp>
#include "Winsoft.Android.Camera.hpp"
#include <FMX.ExtCtrls.hpp>
#include <FMX.Layouts.hpp>
#include <FMX.StdCtrls.hpp>
#include <FMX.Types.hpp>
#include <Androidapi.JNI.GraphicsContentViewText.hpp>
#include <FMX.Controls.Presentation.hpp>
#include <FMX.Objects.hpp>
#include "Winsoft.FireMonkey.Obr.hpp"
//---------------------------------------------------------------------------
class TFormMain : public TForm
{
__published:  // IDE-managed Components
  TImage *Image;
  TButton *ButtonSettings;
  TButton *ButtonStartStop;
  TButton *ButtonTakePicture;
  TACamera *ACamera;
  TLabel *LabelBarcode;
  TRectangle *Rectangle;
  void __fastcall ButtonSettingsClick(TObject *Sender);
  void __fastcall ButtonStartStopClick(TObject *Sender);
  void __fastcall FormCreate(TObject *Sender);
  void __fastcall ACameraDataReady(TObject *Sender);
  void __fastcall ButtonTakePictureClick(TObject *Sender);
    void __fastcall ACameraPermission(TObject *Sender);
private:  // User declarations
  _di_IFMXApplicationEventService FMXApplicationEventService;
  volatile float Scale;
  volatile bool Paused;
  volatile int RgbaDataWidth;
  volatile int RgbaDataHeight;
  DynamicArray<Cardinal> RgbaData;
  volatile bool Scanning;
  TBitmap *ScanBitmap;
  String ScanBarcode;
  TRectF ScanRectangle;
  bool __fastcall HandleAppEvent(TApplicationEvent AAppEvent, TObject *AContext);
  void __fastcall ACameraPictureTaken(TObject *Sender, System::TArray__1<System::Byte> Data);
  void __fastcall ACameraDisplayRationale(TObject *Sender, const _di_TProc APostRationaleProc);
public:    // User declarations
  __fastcall TFormMain(TComponent* Owner);
  void __fastcall Start();
  void __fastcall Stop();
};
//---------------------------------------------------------------------------
extern PACKAGE TFormMain *FormMain;
//---------------------------------------------------------------------------
#endif
