929a999ccff3a9b9e21dfa8061936b46962b5510
[mussa.git] / qui / seqbrowser / SequenceDescription.hpp
1 #ifndef _SEQUENCE_DESCRIPTION_H
2 #define _SEQUENCE_DESCRIPTION_H
3
4 #include <boost/shared_ptr.hpp>
5
6 #include <string>
7
8 #include <QString>
9 #include <QLabel>
10 #include <QLineEdit>
11 #include <QFrame>
12
13 #include "alg/glsequence.hpp"
14
15 class SequenceDescription : public QFrame
16 {
17   Q_OBJECT 
18
19 public:
20   SequenceDescription(QWidget *parent=0);
21   SequenceDescription(boost::shared_ptr<GlSequence>, QWidget *);
22   void setName(std::string name);
23
24   boost::shared_ptr<GlSequence> glsequence();
25   std::string name() const; 
26   int length() const;
27   int position() const;
28
29 public slots:
30   //! Display the passed GlSequence information
31   void setGlSequence(boost::shared_ptr<GlSequence>);
32   //! set the name for our sequence
33   void setName(const QString& name);
34   void setPosition(int pos);
35
36 signals:
37   void glsequenceChanged(boost::shared_ptr<GlSequence>);
38   void nameChanged(const QString& name);
39   void positionChanged(int pos);
40
41 private:
42   QLineEdit name_label;
43   QLabel length_label;
44   QLabel position_label;
45
46   boost::shared_ptr<GlSequence> glsequence_;
47   int pos;
48
49   void createWidget();
50   //! format the length and set the QLabel
51   void setLength(int length);
52 };
53 #endif