don't use staticly allocated widgets
[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 #include <QVBoxLayout>
13
14 #include "alg/glsequence.hpp"
15
16 class SequenceDescription : public QFrame
17 {
18   Q_OBJECT 
19
20 public:
21   SequenceDescription(QWidget *parent=0);
22   SequenceDescription(boost::shared_ptr<GlSequence>, QWidget *);
23   
24   void setName(std::string name);
25   boost::shared_ptr<GlSequence> glsequence();
26   std::string name() const; 
27   int length() const;
28   int position() const;
29
30 public slots:
31   //! Display the passed GlSequence information
32   void setGlSequence(boost::shared_ptr<GlSequence>);
33   //! set the name for our sequence
34   void setName(const QString& name);
35   void setPosition(int pos);
36
37 signals:
38   void glsequenceChanged(boost::shared_ptr<GlSequence>);
39   void nameChanged(const QString& name);
40   void positionChanged(int pos);
41
42 private:
43   QVBoxLayout *layout;
44   QLineEdit *name_label;
45   QLabel *length_label;
46   QLabel *position_label;
47
48   boost::shared_ptr<GlSequence> glsequence_;
49   int pos;
50
51   void createWidget();
52   //! format the length and set the QLabel
53   void setLength(int length);
54 };
55 #endif