#ifndef SYSFSBLPATH_H
#define SYSFSBLPATH_H   1

#define SYSFSBLPATH     "/sys/class/backlight"
#define SYSFSIFACEFILE  "brightness"
#define SYSFSIFACEMAX   "max_brightness"

#include <qstring.h>
#include <qdir.h>
#include <qfile.h>

class sysfsBlPath {

  QString sysfsblpath,
          blpath,
          blbrightness,
          blmaxbrightness,
          bliface;
  QDir  sysfsdir,
        bldir;
  bool  validblpath;
  int   brightness,
        maxbrightness;

  public:
    sysfsBlPath ( const QString sysblp = SYSFSBLPATH );
    ~sysfsBlPath();

    bool find_sysfsBlPath();
    const QString get_sysfsBlPath();
    const QString get_blPath();
    const QString get_blIface();
    bool valid_blPath();
    int get_brightness();
    int get_maxbrightness();

  protected:
    QString add_path_element (QString &s, const QString e);
    int qfile_read_int (QFile &f, bool &ok);
};

#endif

