1 // Description length bookkeeping and display for a single phoneme
2 // Copyright © 2009 The University of Chicago
6 class CPhoneListViewItem
;
9 #include <Q3ListViewItem>
13 #include "StringSurrogate.h"
14 #include "generaldefinitions.h"
15 #include "CompareFunc.h"
17 class CPhoneListViewItem
: public Q3ListViewItem
{
20 // construction/destruction.
22 CPhoneListViewItem(Q3ListView
* parent
= 0,
23 QString phoneme_text
= QString(), CPhone
* phoneme
= 0);
24 CPhoneListViewItem(Q3ListViewItem
* parent
,
25 QString phoneme_text
= QString(), CPhone
* phoneme
= 0);
26 // implicitly defined destructor
30 CPhoneListViewItem(const CPhoneListViewItem
& x
)
31 : Q3ListViewItem(x
), m_MyPhone(x
.m_MyPhone
) { }
32 CPhoneListViewItem
& operator=(const CPhoneListViewItem
& x
)
34 Q3ListViewItem::operator=(x
);
35 m_MyPhone
= x
.m_MyPhone
;
39 // Qt3 list view item interface.
41 virtual QString
text(int column_index
) const;
42 int compare(Q3ListViewItem
* other
, int column
, bool ascending
) const;
43 virtual QString
key(int column
, bool ascending
) const;
45 // underlying unigram object.
47 CPhone
* GetPhone() const { return m_MyPhone
; }
48 void SetPhone(CPhone
* pPhone
) { m_MyPhone
= pPhone
; }
51 class CPhone
: public CLParse
54 CPhone(CMiniLexicon
* mini
= NULL
);
55 CPhone(QString
&, CMiniLexicon
* mini
= NULL
);
56 CPhone(CStringSurrogate
, CMiniLexicon
* mini
= NULL
);
58 bool operator==(CPhone
& );
59 bool operator<( CPhone
& );
63 void SetLogFreq (double);
64 void PhoneListDisplay( Q3ListView
*);
65 static ePhoneSortStyle m_SortStyle
;