Sequence.h

Go to the documentation of this file.
00001 #ifndef SEQUENCE_H
00002 #define SEQUENCE_H 
00003 
00004 #include <iostream.h>
00005 #include <qtl.h>
00006 #include <qstring.h>
00007 #include <qstringlist.h>
00008 #include <qvaluelist.h>
00009 
00010 class Sequence {
00011 
00012 public:
00013 
00014     static const int MAX_ITEM;
00015     static const QString itemString[];
00016     enum Item { INVALID = -1, FIRST_LANG_TERM, TEST_LANG_ALT, TEST_LANG_TERM, COMMENT, IMAGE };
00017 
00018     typedef QValueList<Item> ItemList;
00019 
00020     Sequence( const QString& seqStr = QString::null );
00021     Sequence( const Sequence& seq );
00022     ~Sequence(); 
00023 
00024     bool isEnabled() const;
00025     void setEnabled( bool isEnabled );
00026 
00027     bool contains( const Item& item ) const;
00028     bool isEmpty() const;
00029 
00030     void addGroup( ItemList group );
00031     void removeLastGroup();
00032     ItemList getGroupAt( int index ) const;
00033     int getGroupCount() const;
00034 
00035     static Item stringToItem( const QString& itemStr );
00036 
00037     QString toString() const;
00038     QString toHumanReadableString() const;
00039 
00040     friend QDataStream& operator<<( QDataStream& out, const Sequence& sequence );
00041     friend QDataStream& operator>>( QDataStream& in, Sequence& sequence );
00042 
00043 private:
00044 
00045     bool                    enabled;
00046     QValueList<ItemList>    groups;
00047 
00048 };
00049 
00050 QDataStream& operator<<( QDataStream& out, const Sequence& sequence );
00051 QDataStream& operator>>( QDataStream& in, Sequence& sequence );
00052 
00053 #endif
00054 

Generated on Sun Mar 1 17:30:47 2009 for toMOTko by  doxygen 1.5.6