Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/UIElements/Dialog.hpp

    r5605032 r94d131  
    1111#include<string>
    1212#include<list>
     13#include<vector>
    1314
    14 class MoleculeListClass;
     15class atom;
     16class element;
    1517class molecule;
    1618class Vector;
    17 class element;
    1819
    1920class Dialog
     
    2324  virtual ~Dialog();
    2425
    25   virtual void queryInt(const char *, int *)=0;
    26   virtual void queryDouble(const char*,double *)=0;
    27   virtual void queryString(const char*, std::string *)=0;
    28   virtual void queryMolecule(const char*,molecule**,MoleculeListClass*)=0;
    29   virtual void queryVector(const char*,Vector *,const double *const,bool)=0;
    30   virtual void queryElement(const char*,const element **)=0;
     26  virtual void queryEmpty(const char *, std::string = "")=0;
     27  virtual void queryBoolean(const char *, bool *, std::string = "")=0;
     28  virtual void queryInt(const char *, int *, std::string = "")=0;
     29  virtual void queryDouble(const char*,double *, std::string = "")=0;
     30  virtual void queryString(const char*, std::string *, std::string = "")=0;
     31  virtual void queryAtom(const char*,atom**,std::string = "")=0;
     32  virtual void queryMolecule(const char*,molecule**, std::string = "")=0;
     33  virtual void queryVector(const char*,Vector *,const double *const,bool, std::string = "")=0;
     34  virtual void queryBox(const char*,double ** const, std::string = "")=0;
     35  virtual void queryElement(const char*, std::vector<element *> *, std::string = "")=0;
    3136
    3237  virtual bool display();
     
    4550  //base class for all queries
    4651  class Query {
     52    friend class Dialog;
    4753  public:
    48     Query(std::string _title);
     54    Query(std::string _title, std::string _description = "");
    4955    virtual ~Query();
    5056    virtual bool handle()=0;
     
    5258  protected:
    5359    const std::string getTitle() const;
     60    const std::string getDescription() const;
    5461  private:
    55     std::string title;
     62    std::string title;  //!< short title of the query
     63    std::string description; //!< longer description for tooltips or for help
     64  };
     65
     66  // Empty Query is just meant for showing text, such as version, help, initial message or alike
     67  class EmptyQuery : public Query {
     68  public:
     69    EmptyQuery(std::string title, std::string _description = "");
     70    virtual ~EmptyQuery();
     71    virtual bool handle()=0;
     72    virtual void setResult();
    5673  };
    5774
    5875  //Specialized classes for certain types. GUI-Types are not specialized at this time
     76  class BooleanQuery : public Query {
     77  public:
     78    BooleanQuery(std::string title,bool *_target, std::string _description = "");
     79    virtual ~BooleanQuery();
     80    virtual bool handle()=0;
     81    virtual void setResult();
     82  protected:
     83    bool tmp;
     84  private:
     85    bool *target;
     86  };
     87
    5988  class IntQuery : public Query {
    6089  public:
    61     IntQuery(std::string title,int *_target);
     90    IntQuery(std::string title,int *_target, std::string _description = "");
    6291    virtual ~IntQuery();
    6392    virtual bool handle()=0;
     
    71100  class DoubleQuery : public Query {
    72101  public:
    73     DoubleQuery(std::string title,double *_target);
     102    DoubleQuery(std::string title,double *_target, std::string _description = "");
    74103    virtual ~DoubleQuery();
    75104    virtual bool handle()=0;
     
    83112  class StringQuery : public Query {
    84113  public:
    85     StringQuery(std::string title,std::string *_target);
     114    StringQuery(std::string title,std::string *_target, std::string _description = "");
    86115    virtual ~StringQuery();
    87116    virtual bool handle()=0;
     
    93122  };
    94123
    95 
    96124  class MoleculeQuery : public Query {
    97125  public:
    98     MoleculeQuery(std::string title, molecule **_target, MoleculeListClass *_molecules);
     126    MoleculeQuery(std::string title, molecule **_target, std::string _description = "");
    99127    virtual ~MoleculeQuery();
    100128    virtual bool handle()=0;
     
    102130  protected:
    103131    molecule *tmp;
    104     MoleculeListClass *molecules;
    105132  private:
    106133    molecule **target;
    107134  };
    108135
     136  class AtomQuery : public Query {
     137  public:
     138    AtomQuery(std::string title, atom **_target, std::string _description = "");
     139    virtual ~AtomQuery();
     140    virtual bool handle()=0;
     141    virtual void setResult();
     142  protected:
     143    atom *tmp;
     144  private:
     145    atom **target;
     146  };
     147
    109148  class VectorQuery : public Query {
    110149  public:
    111       VectorQuery(std::string title,Vector *_target,const double *const _cellSize,bool _check);
     150      VectorQuery(std::string title,Vector *_target,const double *const _cellSize,bool _check, std::string _description = "");
    112151      virtual ~VectorQuery();
    113152      virtual bool handle()=0;
     
    121160  };
    122161
     162  class BoxQuery : public Query {
     163  public:
     164      BoxQuery(std::string title,double ** const _cellSize, std::string _description = "");
     165      virtual ~BoxQuery();
     166      virtual bool handle()=0;
     167      virtual void setResult();
     168    protected:
     169      double *tmp;
     170    private:
     171      double **target;
     172  };
     173
    123174  class ElementQuery : public Query {
    124175  public:
    125     ElementQuery(std::string title, const element**_target);
     176    ElementQuery(std::string title, std::vector<element *> *_target, std::string _description = "");
    126177    virtual ~ElementQuery();
    127178    virtual bool handle()=0;
    128179    virtual void setResult();
    129180  protected:
    130     const element *tmp;
     181    std::vector<element *> elements;
    131182  private:
    132     const element **target;
     183    std::vector<element *> * const target;
    133184  };
    134185
     
    140191};
    141192
     193
    142194#endif /* DIALOG_HPP_ */
Note: See TracChangeset for help on using the changeset viewer.