From 00bb99ac80741fc50ef8a289719373032f2391eb Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeaccessibility@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- ksayit/src/docbookclasses.cpp | 1056 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 1056 insertions(+) create mode 100644 ksayit/src/docbookclasses.cpp (limited to 'ksayit/src/docbookclasses.cpp') diff --git a/ksayit/src/docbookclasses.cpp b/ksayit/src/docbookclasses.cpp new file mode 100644 index 0000000..7e5c677 --- /dev/null +++ b/ksayit/src/docbookclasses.cpp @@ -0,0 +1,1056 @@ +// +// C++ Implementation: docbookclasses +// +// Description: +// +// +// Author: Robert Vogl , (C) 2004 +// +// Copyright: See COPYING file that comes with this distribution +// +// +// Qt includes +#include +#include +#include +#include +#include + +//KDE includes +#include +#include +#include +#include +#include + +// App specific includes +#include "parasaxparser.h" +#include "docbookclasses.h" + + +////////////////////////////////////// +// Interface +////////////////////////////////////// +ListViewInterface::ListViewInterface(ListViewInterface *parent, QString label) + : KListViewItem( parent, label ) +{ +} + +ListViewInterface::ListViewInterface(ListViewInterface *parent, ListViewInterface *after, QString label) : KListViewItem( parent, after, label ) +{ +} + +ListViewInterface::ListViewInterface(KListView *lv, QString label) + : KListViewItem( lv, label ) +{ +} + + +////////////////////////////////////// +// Classes for Roberts elements +////////////////////////////////////// +/** + * RobDocument + */ +RobDocument::RobDocument(KListView *lv, QString label) + : ListViewInterface( lv, label ) +{ + QPixmap pixmap = KGlobal::iconLoader()->loadIcon("contents", KIcon::Small); + this->setPixmap(0, pixmap); + + // new Concept (begin) + m_valueList.clear(); + m_valueList.append( QString("RobDocument") ); // XmlContextName + m_valueList.append( (bool)false ); // isEditable + m_valueList.append( (int)0 ); // MaxLines + m_valueList.append(QString::null); // Summary + m_valueList.append(QString::null); // RawData + m_valueList.append("

" + i18n("unnamed") + "

"); // RTFHeader + m_valueList.append(QString::null); // RTFData + m_valueList.append(i18n("unnamed") + "\n"); // SpeakerHeader + m_valueList.append(QString::null); // SpeakerData + // new Concept (end) +} + +RobDocument::~RobDocument() +{ +} + +bool RobDocument::setValue( unsigned int index, QVariant data ) +{ + if ( index<1 || index > m_valueList.count() ) + return false; + + QValueList::Iterator it = m_valueList.at(index); + switch (index){ + case KSayItGlobal::ISEDITABLE: + *it = data; + break; + case KSayItGlobal::RTFHEADER: + *it = "

" + data.toString() + "

"; + break; + case KSayItGlobal::SPEAKERHEADER: + *it = data.toString() + "\n"; + break; + default: + return false; + } + return true; +} + +QVariant RobDocument::getValue( unsigned int index ) const +{ + if ( index > m_valueList.count() ) + return QVariant(); // a invalid QVariant + + QVariant data; + data = m_valueList[index]; + + return data; +} + + +////////////////////////////////////// +// Classes for Docbook elements +////////////////////////////////////// +/** + * Overview + */ +Overview::Overview(ListViewInterface *parent, ListViewInterface *after, QString label) + : ListViewInterface(parent, after, label) +{ + QPixmap pixmap = KGlobal::iconLoader()->loadIcon("filenew", KIcon::Small); + this->setPixmap(0, pixmap); + this->setText(3, "0"); // upmost element + + // new Concept (begin) + m_valueList.clear(); + m_valueList.append( QString("BookInfo") ); // XmlContextName + m_valueList.append( (bool)false ); // isEditable + m_valueList.append( (int)0 ); // MaxLines + m_valueList.append(QString::null); // Summary + m_valueList.append(QString::null); // RawData + m_valueList.append("

" + i18n("Overview") + "

"); // RTFHeader + m_valueList.append(QString::null); // RTFData + m_valueList.append(i18n("Overview") + "\n"); // SpeakerHeader + m_valueList.append(QString::null); // SpeakerData + // new Concept (end) +} + +Overview::~Overview() +{ +} + +bool Overview::setValue( unsigned int index, QVariant data ) +{ + if ( index<1 || index > m_valueList.count() ) + return false; + + QValueList::Iterator it = m_valueList.at(index); + switch (index){ + case KSayItGlobal::ISEDITABLE: + *it = data; + break; + default: + return false; + } + return true; +} + +QVariant Overview::getValue( unsigned int index ) const +{ + if ( index > m_valueList.count() ) + return QVariant(); // a invalid QVariant + + QVariant data; + data = m_valueList[index]; + + return data; +} + +/** + * Date + */ +Date::Date(ListViewInterface *parent, ListViewInterface *after, QString label) + : ListViewInterface(parent, after, label) +{ + QPixmap pixmap = KGlobal::iconLoader()->loadIcon("filenew", KIcon::Small); + this->setPixmap(0, pixmap); + this->setText(3, "00000001"); + + // new Concept (begin) + m_valueList.clear(); + m_valueList.append( QString("Date") ); // XmlContextName + m_valueList.append( (bool)false ); // isEditable + m_valueList.append( (int)1 ); // MaxLines + m_valueList.append(QString::null); // Summary + m_valueList.append(QString::null); // RawData + m_valueList.append("" + i18n("Date") +": "); // RTFHeader + m_valueList.append(QString::null); // RTFData + m_valueList.append(i18n("Date") + ": "); // SpeakerHeader + m_valueList.append(QString::null); // SpeakerData + // new Concept (end) +} + +Date::~Date() +{ +} + +bool Date::setValue( unsigned int index, QVariant data ) +{ + if ( index<1 || index > m_valueList.count() ) + return false; + + QValueList::Iterator it = m_valueList.at(index); + switch (index){ + case KSayItGlobal::ISEDITABLE: + *it = data; + break; + case KSayItGlobal::MAXLINES: + *it = data; + break; + case KSayItGlobal::RTFDATA: + *it = data.toString() + "
"; + break; + case KSayItGlobal::SPEAKERDATA: + *it = data; + break; + case KSayItGlobal::RAWDATA: + *it = data; + break; + default: + return false; + } + return true; +} + +QVariant Date::getValue( unsigned int index ) const +{ + if ( index > m_valueList.count() ) + return QVariant(); // a invalid QVariant + + QVariant data; + data = m_valueList[index]; + + return data; +} + +/** + * ReleaseInfo + */ +ReleaseInfo::ReleaseInfo(ListViewInterface *parent, ListViewInterface *after, QString label) + : ListViewInterface(parent, after, label) +{ + QPixmap pixmap = KGlobal::iconLoader()->loadIcon("filenew", KIcon::Small); + this->setPixmap(0, pixmap); + this->setText(3, "00000002"); + + // new Concept (begin) + m_valueList.clear(); + m_valueList.append( QString("ReleaseInfo") ); // XmlContextName + m_valueList.append( (bool)false ); // isEditable + m_valueList.append( (int)1 ); // MaxLines + m_valueList.append(QString::null); // Summary + m_valueList.append(QString::null); // RawData + m_valueList.append("" + i18n("Release") + ": "); // RTFHeader + m_valueList.append(QString::null); // RTFData + m_valueList.append(i18n("Release") + ": "); // SpeakerHeader + m_valueList.append(QString::null); // SpeakerData + // new Concept (end) +} + +ReleaseInfo::~ReleaseInfo() +{ +} + +bool ReleaseInfo::setValue( unsigned int index, QVariant data ) +{ + if ( index<1 || index > m_valueList.count() ) + return false; + + QValueList::Iterator it = m_valueList.at(index); + switch (index){ + case KSayItGlobal::ISEDITABLE: + *it = data; + break; + case KSayItGlobal::MAXLINES: + *it = data; + break; + case KSayItGlobal::RTFDATA: + *it = data.toString() + "
"; + break; + case KSayItGlobal::SPEAKERDATA: + *it = data; + break; + case KSayItGlobal::RAWDATA: + *it = data; + break; + default: + return false; + } + return true; +} + +QVariant ReleaseInfo::getValue( unsigned int index ) const +{ + if ( index > m_valueList.count() ) + return QVariant(); // a invalid QVariant + + QVariant data; + data = m_valueList[index]; + + return data; +} + +/** + * Authorgroup + */ +AuthorGroup::AuthorGroup(ListViewInterface *parent, ListViewInterface *after, QString label) + : ListViewInterface(parent, after, label) +{ + QPixmap pixmap = KGlobal::iconLoader()->loadIcon("kdmconfig", KIcon::Small); + this->setPixmap(0, pixmap); + this->setText(3, "00000003"); + + // new Concept (begin) + m_valueList.clear(); + m_valueList.append( QString("AuthorGroup") ); // XmlContextName + m_valueList.append( (bool)false ); // isEditable + m_valueList.append( (int)0 ); // MaxLines + m_valueList.append(QString::null); // Summary + m_valueList.append(QString::null); // RawData + m_valueList.append("

" + i18n("Author(s)")+ "

"); // RTFHeader + m_valueList.append(QString::null); // RTFData + m_valueList.append(i18n("Author(s)") + "\n"); // SpeakerHeader + m_valueList.append(QString::null); // SpeakerData + // new Concept (end) +} + +AuthorGroup::~AuthorGroup() +{ +} + +bool AuthorGroup::setValue( unsigned int index, QVariant data ) +{ + if ( index<1 || index > m_valueList.count() ) + return false; + + QValueList::Iterator it = m_valueList.at(index); + switch (index){ + case KSayItGlobal::ISEDITABLE: + *it = data; + break; + default: + return false; + } + return true; +} + +QVariant AuthorGroup::getValue( unsigned int index ) const +{ + if ( index > m_valueList.count() ) + return QVariant(); // a invalid QVariant + + QVariant data; + data = m_valueList[index]; + + return data; +} + + +/** + * Author + */ +Author::Author(ListViewInterface *parent, ListViewInterface *after, QString label) + : ListViewInterface(parent, after, label) +{ + QPixmap pixmap = KGlobal::iconLoader()->loadIcon("personal", KIcon::Small); + this->setPixmap(0, pixmap); + + // new Concept (begin) + m_valueList.clear(); + m_valueList.append( QString("Author") ); // XmlContextName + m_valueList.append( (bool)false ); // isEditable + m_valueList.append( (int)1 ); // MaxLines + m_valueList.append(QString::null); // Summary + m_valueList.append(QString::null); // RawData + m_valueList.append("" + i18n("Author") + ": "); // RTFHeader + m_valueList.append(QString::null); // RTFData + m_valueList.append(i18n("Author") + ": "); // SpeakerHeader + m_valueList.append(QString::null); // SpeakerData + // new Concept (end) +} + +Author::~Author() +{ +} + +// void Author::setData(const QString &data, QDomDocument &) +// { +// // canonify string +// QString m_data = data; +// m_data.replace( QRegExp("\n"), "" ); // remove Newlines +// m_data.replace( QRegExp(" {2,}"), " " ); // remove multiple spaces +// m_data.replace( QRegExp("[\t|\r]{1,}"), ""); // remove Tabs +// // split string "firstname surname" +// QString firstname = m_data.section(' ', 0, 0); +// QString surname = m_data.section(' ', 1, 1); +// // update node elements +// m_node1.setNodeValue(firstname); +// m_node2.setNodeValue(surname); +// // update Listview +// this->setText(1, firstname + " " + surname); +// } + +bool Author::setValue( unsigned int index, QVariant data ) +{ + if ( index<1 || index > m_valueList.count() ) + return false; + + QValueList::Iterator it = m_valueList.at(index); + switch (index){ + case KSayItGlobal::ISEDITABLE: + *it = data; + break; + case KSayItGlobal::MAXLINES: + *it = data; + break; + case KSayItGlobal::RTFDATA: + *it = data.toString() + "
"; + break; + case KSayItGlobal::SPEAKERDATA: + *it = data; + this->setText( 1, data.toString() ); + break; + case KSayItGlobal::RAWDATA: + *it = data; + break; + default: + return false; + } + return true; +} + +QVariant Author::getValue( unsigned int index ) const +{ + if ( index > m_valueList.count() ) + return QVariant(); // a invalid QVariant + + QVariant data; + data = m_valueList[index]; + + return data; +} + +/** + * KeywordSet + */ +KeywordSet::KeywordSet(ListViewInterface *parent, ListViewInterface *after, QString label) + : ListViewInterface(parent, after, label) +{ + QPixmap pixmap = KGlobal::iconLoader()->loadIcon("txt", KIcon::Small); + this->setPixmap(0, pixmap); + this->setText(3, "00000004"); + + // new Concept (begin) + m_valueList.clear(); + m_valueList.append( QString("KeywordSet") ); // XmlContextName + m_valueList.append( (bool)false ); // isEditable + m_valueList.append( (int)0 ); // MaxLines + m_valueList.append(QString::null); // Summary + m_valueList.append(QString::null); // RawData + m_valueList.append("

" + i18n("Keywords") + "

"); // RTFHeader + m_valueList.append(QString::null); // RTFData + m_valueList.append(i18n("Keywords") + "\n"); // SpeakerHeader + m_valueList.append(QString::null); // SpeakerData + // new Concept (end) +} + +KeywordSet::~KeywordSet() +{ +} + +bool KeywordSet::setValue( unsigned int index, QVariant data ) +{ + if ( index<1 || index > m_valueList.count() ) + return false; + + QValueList::Iterator it = m_valueList.at(index); + switch (index){ + case KSayItGlobal::ISEDITABLE: + *it = data; + break; + default: + return false; + } + return true; +} + +QVariant KeywordSet::getValue( unsigned int index ) const +{ + if ( index > m_valueList.count() ) + return QVariant(); // a invalid QVariant + + QVariant data; + data = m_valueList[index]; + + return data; +} + +/** + * Keyword + */ +Keyword::Keyword(ListViewInterface *parent, ListViewInterface *after, QString label) + : ListViewInterface(parent, after, label) +{ + // new Concept (begin) + m_valueList.clear(); + m_valueList.append( QString("Keyword") ); // XmlContextName + m_valueList.append( (bool)false ); // isEditable + m_valueList.append( (bool)1 ); // MaxLines + m_valueList.append(QString::null); // Summary + m_valueList.append(QString::null); // RawData + m_valueList.append(QString::null); // RTFHeader + m_valueList.append(QString::null); // RTFData + m_valueList.append(QString::null); // SpeakerHeader + m_valueList.append(QString::null); // SpeakerData + // new Concept (end) +} + +Keyword::~Keyword() +{ +} + +bool Keyword::setValue( unsigned int index, QVariant data ) +{ + if ( index<1 || index > m_valueList.count() ) + return false; + + QValueList::Iterator it = m_valueList.at(index); + switch (index){ + case KSayItGlobal::ISEDITABLE: + *it = data; + break; + case KSayItGlobal::MAXLINES: + *it = data; + break; + case KSayItGlobal::RAWDATA: + *it = data; + this->setText( 0, data.toString() ); + break; + case KSayItGlobal::RTFDATA: + *it = data.toString() + "
"; + break; + case KSayItGlobal::SPEAKERDATA: + *it = data; + break; + default: + return false; + } + return true; +} + +QVariant Keyword::getValue( unsigned int index ) const +{ + if ( index > m_valueList.count() ) + return QVariant(); // a invalid QVariant + + QVariant data; + data = m_valueList[index]; + + return data; +} + + + +/** + * Abstract + */ +Abstract::Abstract(ListViewInterface *parent, ListViewInterface *after, QString label) + : ListViewInterface(parent, after, label) +{ + QPixmap pixmap = KGlobal::iconLoader()->loadIcon("filenew", KIcon::Small); + this->setPixmap(0, pixmap); + this->setText(3, "00000005"); + + // new Concept (begin) + m_valueList.clear(); + m_valueList.append( QString("Abstract") ); // XmlContextName + m_valueList.append( (bool)false ); // isEditable + m_valueList.append( (int)0 ); // MaxLines + m_valueList.append(QString::null); // Summary + m_valueList.append(QString::null); // RawData + m_valueList.append("

" + i18n("Abstract") + "

"); // RTFHeader + m_valueList.append(QString::null); // RTFData + m_valueList.append(i18n("Abstract") + "\n"); // SpeakerHeader + m_valueList.append(QString::null); // SpeakerData + // new Concept (end) +} + +Abstract::~Abstract() +{ +} + +bool Abstract::setValue( unsigned int index, QVariant data ) +{ + if ( index<1 || index > m_valueList.count() ) + return false; + + QValueList::Iterator it = m_valueList.at(index); + switch (index){ + case KSayItGlobal::ISEDITABLE: + *it = data; + break; + default: + return false; + } + return true; +} + +QVariant Abstract::getValue( unsigned int index ) const +{ + if ( index > m_valueList.count() ) + return QVariant(); // a invalid QVariant + + QVariant data; + data = m_valueList[index]; + + return data; +} + + +/** + * Para + */ +Para::Para(ListViewInterface *parent, ListViewInterface *after, QString label) + : ListViewInterface(parent, after, label) +{ + QPixmap pixmap = KGlobal::iconLoader()->loadIcon("leftjust", KIcon::Small); + this->setPixmap(0, pixmap); + + // new Concept (begin) + m_valueList.clear(); + m_valueList.append( QString("Para") ); // XmlContextName + m_valueList.append( (bool)false ); // isEditable + m_valueList.append( (int)-1 ); // MaxLines + m_valueList.append(QString::null); // Summary + m_valueList.append(QString::null); // RawData + m_valueList.append(QString::null); // RTFHeader + m_valueList.append(QString::null); // RTFData + m_valueList.append(i18n("Paragraph") + "\n"); // SpeakerHeader + m_valueList.append(QString::null); // SpeakerData + // new Concept (end) +} + +Para::~Para() +{ +} + +bool Para::setValue( unsigned int index, QVariant data ) +{ + if ( index<1 || index > m_valueList.count() ) + return false; + + QValueList::Iterator it = m_valueList.at(index); + QString sData = QString::null; + ParaSaxParser *p = ParaSaxParser::Instance(); + switch (index){ + case KSayItGlobal::ISEDITABLE: + *it = data; + break; + case KSayItGlobal::MAXLINES: + *it = data; + break; + case KSayItGlobal::RTFDATA: + p->setData( "" + data.toString() + "" ); + p->getRTFText( sData ); + *it = "

" + sData + "

"; + break; + case KSayItGlobal::SPEAKERDATA: + p->setData( "" + data.toString() + "" ); + p->getText( sData ); + *it = sData; + break; + case KSayItGlobal::RAWDATA: + sData = data.toString(); + *it = sData; + break; + default: + return false; + } + return true; +} + +QVariant Para::getValue( unsigned int index ) const +{ + if ( index > m_valueList.count() ) + return QVariant(); // a invalid QVariant + + QVariant data; + data = m_valueList[index]; + + return data; +} + + +/** + * Chapter + */ +Chapter::Chapter(ListViewInterface *parent, ListViewInterface *after, QString label) + : ListViewInterface(parent, after, label) +{ + QPixmap pixmap = KGlobal::iconLoader()->loadIcon("leftjust", KIcon::Small); + this->setPixmap(0, pixmap); + + // new Concept (begin) + m_valueList.clear(); + m_valueList.append( QString("Chapter") ); // XmlContextName + m_valueList.append( (bool)false ); // isEditable + m_valueList.append( (int)0 ); // MaxLines + m_valueList.append(QString::null); // Summary + m_valueList.append(QString::null); // RawData + m_valueList.append(QString::null); // RTFHeader + m_valueList.append(QString::null); // RTFData + m_valueList.append(QString::null); // SpeakerHeader + m_valueList.append(QString::null); // SpeakerData + // new Concept (end) +} + +Chapter::~Chapter() +{ +} + +bool Chapter::setValue( unsigned int index, QVariant data ) +{ + if ( index<1 || index > m_valueList.count() ) + return false; + + QValueList::Iterator it = m_valueList.at(index); + switch (index){ + case KSayItGlobal::ISEDITABLE: + *it = data; + break; + case KSayItGlobal::RTFHEADER: + *it = "

" + data.toString() + "

"; + break; + case KSayItGlobal::SPEAKERHEADER: + *it = data.toString() + "\n"; + break; + default: + return false; + } + return true; +} + +QVariant Chapter::getValue( unsigned int index ) const +{ + if ( index > m_valueList.count() ) + return QVariant(); // a invalid QVariant + + QVariant data; + data = m_valueList[index]; + + return data; +} + + +/** + * Sect1 + */ +Sect1::Sect1(ListViewInterface *parent, ListViewInterface *after, QString label) + : ListViewInterface(parent, after, label) +{ + QPixmap pixmap = KGlobal::iconLoader()->loadIcon("leftjust", KIcon::Small); + this->setPixmap(0, pixmap); + + // new Concept (begin) + m_valueList.clear(); + m_valueList.append( QString("Sect1") ); // XmlContextName + m_valueList.append( (bool)false ); // isEditable + m_valueList.append( (int)0 ); // MaxLines + m_valueList.append(QString::null); // Summary + m_valueList.append(QString::null); // RawData + m_valueList.append(QString::null); // RTFHeader + m_valueList.append(QString::null); // RTFData + m_valueList.append(QString::null); // SpeakerHeader + m_valueList.append(QString::null); // SpeakerData + // new Concept (end) +} + +Sect1::~Sect1() +{ +} + +bool Sect1::setValue( unsigned int index, QVariant data ) +{ + if ( index<1 || index > m_valueList.count() ) + return false; + + QValueList::Iterator it = m_valueList.at(index); + switch (index){ + case KSayItGlobal::ISEDITABLE: + *it = data; + break; + case KSayItGlobal::RTFHEADER: + *it = "

" + data.toString() + "

"; + break; + case KSayItGlobal::SPEAKERHEADER: + *it = data.toString() + "\n"; + break; + default: + return false; + } + return true; +} + +QVariant Sect1::getValue( unsigned int index ) const +{ + if ( index > m_valueList.count() ) + return QVariant(); // a invalid QVariant + + QVariant data; + data = m_valueList[index]; + + return data; +} + +/** + * Sect2 + */ +Sect2::Sect2(ListViewInterface *parent, ListViewInterface *after, QString label) + : ListViewInterface(parent, after, label) +{ + QPixmap pixmap = KGlobal::iconLoader()->loadIcon("leftjust", KIcon::Small); + this->setPixmap(0, pixmap); + + // new Concept (begin) + m_valueList.clear(); + m_valueList.append( QString("Sect2") ); // XmlContextName + m_valueList.append( (bool)false ); // isEditable + m_valueList.append( (int)0 ); // MaxLines + m_valueList.append(QString::null); // Summary + m_valueList.append(QString::null); // RawData + m_valueList.append(QString::null); // RTFHeader + m_valueList.append(QString::null); // RTFData + m_valueList.append(QString::null); // SpeakerHeader + m_valueList.append(QString::null); // SpeakerData + // new Concept (end) +} + +Sect2::~Sect2() +{ +} + +bool Sect2::setValue( unsigned int index, QVariant data ) +{ + if ( index<1 || index > m_valueList.count() ) + return false; + + QValueList::Iterator it = m_valueList.at(index); + switch (index){ + case KSayItGlobal::ISEDITABLE: + *it = data; + break; + case KSayItGlobal::RTFHEADER: + *it = "

" + data.toString() + "

"; + break; + case KSayItGlobal::SPEAKERHEADER: + *it = data.toString() + "\n"; + break; + default: + return false; + } + return true; +} + +QVariant Sect2::getValue( unsigned int index ) const +{ + if ( index > m_valueList.count() ) + return QVariant(); // a invalid QVariant + + QVariant data; + data = m_valueList[index]; + + return data; +} + +/** + * Sect3 + */ +Sect3::Sect3(ListViewInterface *parent, ListViewInterface *after, QString label) + : ListViewInterface(parent, after, label) +{ + QPixmap pixmap = KGlobal::iconLoader()->loadIcon("leftjust", KIcon::Small); + this->setPixmap(0, pixmap); + + // new Concept (begin) + m_valueList.clear(); + m_valueList.append( QString("Sect3") ); // XmlContextName + m_valueList.append( (bool)false ); // isEditable + m_valueList.append( (int)0 ); // MaxLines + m_valueList.append(QString::null); // Summary + m_valueList.append(QString::null); // RawData + m_valueList.append(QString::null); // RTFHeader + m_valueList.append(QString::null); // RTFData + m_valueList.append(QString::null); // SpeakerHeader + m_valueList.append(QString::null); // SpeakerData + // new Concept (end) +} + +Sect3::~Sect3() +{ +} + +bool Sect3::setValue( unsigned int index, QVariant data ) +{ + if ( index<1 || index > m_valueList.count() ) + return false; + + QValueList::Iterator it = m_valueList.at(index); + switch (index){ + case KSayItGlobal::ISEDITABLE: + *it = data; + break; + case KSayItGlobal::RTFHEADER: + *it = "" + data.toString() + "
"; + break; + case KSayItGlobal::SPEAKERHEADER: + *it = data.toString() + "\n"; + break; + default: + return false; + } + return true; +} + +QVariant Sect3::getValue( unsigned int index ) const +{ + if ( index > m_valueList.count() ) + return QVariant(); // a invalid QVariant + + QVariant data; + data = m_valueList[index]; + + return data; +} + +/** + * Sect4 + */ +Sect4::Sect4(ListViewInterface *parent, ListViewInterface *after, QString label) + : ListViewInterface(parent, after, label) +{ + QPixmap pixmap = KGlobal::iconLoader()->loadIcon("leftjust", KIcon::Small); + this->setPixmap(0, pixmap); + + // new Concept (begin) + m_valueList.clear(); + m_valueList.append( QString("Sect4") ); // XmlContextName + m_valueList.append( (bool)false ); // isEditable + m_valueList.append( (int)0 ); // MaxLines + m_valueList.append(QString::null); // Summary + m_valueList.append(QString::null); // RawData + m_valueList.append(QString::null); // RTFHeader + m_valueList.append(QString::null); // RTFData + m_valueList.append(QString::null); // SpeakerHeader + m_valueList.append(QString::null); // SpeakerData + // new Concept (end) +} + +Sect4::~Sect4() +{ +} + +bool Sect4::setValue( unsigned int index, QVariant data ) +{ + if ( index<1 || index > m_valueList.count() ) + return false; + + QValueList::Iterator it = m_valueList.at(index); + switch (index){ + case KSayItGlobal::ISEDITABLE: + *it = data; + break; + case KSayItGlobal::RTFHEADER: + *it = "" + data.toString() + "
"; + break; + case KSayItGlobal::SPEAKERHEADER: + *it = data.toString() + "\n"; + break; + default: + return false; + } + return true; +} + +QVariant Sect4::getValue( unsigned int index ) const +{ + if ( index > m_valueList.count() ) + return QVariant(); // a invalid QVariant + + QVariant data; + data = m_valueList[index]; + + return data; +} + +/** + * Sect5 + */ +Sect5::Sect5(ListViewInterface *parent, ListViewInterface *after, QString label) + : ListViewInterface(parent, after, label) +{ + QPixmap pixmap = KGlobal::iconLoader()->loadIcon("leftjust", KIcon::Small); + this->setPixmap(0, pixmap); + + // new Concept (begin) + m_valueList.clear(); + m_valueList.append( QString("Sect5") ); // XmlContextName + m_valueList.append( (bool)false ); // isEditable + m_valueList.append( (int)0 ); // MaxLines + m_valueList.append(QString::null); // Summary + m_valueList.append(QString::null); // RawData + m_valueList.append(QString::null); // RTFHeader + m_valueList.append(QString::null); // RTFData + m_valueList.append(QString::null); // SpeakerHeader + m_valueList.append(QString::null); // SpeakerData + // new Concept (end) +} + +Sect5::~Sect5() +{ +} + +bool Sect5::setValue( unsigned int index, QVariant data ) +{ + if ( index<1 || index > m_valueList.count() ) + return false; + + QValueList::Iterator it = m_valueList.at(index); + switch (index){ + case KSayItGlobal::ISEDITABLE: + *it = data; + break; + case KSayItGlobal::RTFHEADER: + *it = "" + data.toString() + "
"; + break; + case KSayItGlobal::SPEAKERHEADER: + *it = data.toString() + "\n"; + break; + default: + return false; + } + return true; +} + +QVariant Sect5::getValue( unsigned int index ) const +{ + if ( index > m_valueList.count() ) + return QVariant(); // a invalid QVariant + + QVariant data; + data = m_valueList[index]; + + return data; +} + -- cgit v1.2.1