use std::sync::{Arc, Mutex};

use crate::device::ConnectedDevice;

use super::psdk_const;

pub struct Lifecycle {
  pub connected_device: Arc<Mutex<dyn ConnectedDevice>>,
  pub enable_auto_newline: bool,
}

impl Lifecycle {
  pub fn simple(connected_device: Arc<Mutex<dyn ConnectedDevice>>) -> Self {
    Self::new(connected_device, psdk_const::DEF_ENABLED_NEWLINE)
  }

  pub fn new(
    connected_device: Arc<Mutex<dyn ConnectedDevice>>,
    enable_auto_newline: bool,
  ) -> Self {
    Self {
      connected_device,
      enable_auto_newline,
    }
  }
}

pub trait PsdkPrinterCommandEnumValue {
  fn command_value(&self) -> String;
}

pub trait PrinterTrait {}

pub enum CpclPrinter {
  Generic,
  Qr365Compress,
  Qr386Bitmap,
}

impl PrinterTrait for CpclPrinter {}

pub enum EscPrinter {
  Generic,
  By426bt,
  Qr285a,
  L12,
}

impl PrinterTrait for EscPrinter {}

pub enum TsplPrinter {
  Generic,
}

impl PrinterTrait for TsplPrinter {}

pub enum WifiPrinter {
  Generic,
}

impl PrinterTrait for WifiPrinter {}
