summaryrefslogblamecommitdiffstats
path: root/src/xsession.h
blob: 27e431ebb08313d43af660b2cda1581b32f5643c (plain) (tree)




















                                                           

                                 

     






                                      
 


                                 
 
                       








                                                             

                                                                









                                
#ifndef VMCHOOSER_XSESSION_H_
#define VMCHOOSER_XSESSION_H_

#include <QString>
#include <QList>
#include <QDomDocument>
#include <QDir>
#include <QProcess>
#include "session.h"

class XSession : public Session {
  public:
    void init(const QString& name, const QString& exec,
              const QString& comment, const QString& icon);
    bool init(const QString& filename);

    bool isActive() const;
    bool isLocked() const;
    bool isValid() const;
    int priority() const;

    SectionType section() const {
        return SECTION_XSESSION;
    }

    QString shortDescription() const {
        return this->name_;
    }

    QString description() const {
        return this->comment_;
    }

    QString execCommand() const {
        return this->exec_;
    }

    QIcon icon() const;

    bool run() const;

    int type() const;

    bool operator<(const Session& other) const;

    static QList<Session*> readSessions(const QString& path);

    bool containsKeywords(const QList<QString>& keywords) const;

  private:
    QString name_;
    QString exec_;
    QString comment_;
    QString icon_;

    QProcess *_process;
};

#endif /*VMCHOOSER_XSESSION_H_*/