1 /***************************************************************************
5 copyright : (C) 2003 by voglrobe
6 email : voglrobe@saphir
7 ***************************************************************************/
9 /***************************************************************************
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
16 ***************************************************************************/
29 #include <klistview.h>
31 typedef QList
<int> ParameterList_type
;
32 typedef QMap
<QString
, ParameterList_type
> EffectConfig_type
;
33 typedef std::vector
<QDomNode
> NodeList_type
;
35 namespace KSayItGlobal
{
36 static const int item_initial_id
= 100;
40 This abstract class is the interface to access the items of the TreeView.
43 class ListViewInterface
: public KListViewItem
46 ListViewInterface(ListViewInterface
*parent
=0, QString label
=QString::null
);
47 ListViewInterface(ListViewInterface
*parent
=0, ListViewInterface
*after
=0, QString label
=QString::null
);
48 ListViewInterface(KListView
*lv
=0, QString label
=QString::null
);
50 // ~ListViewItemInterface();
53 * \returns The header of the item in RTF format. Supposed to be shown to
54 * the user if KSayIt is not in edit mode.
56 virtual QString
getRTFHeader() const = 0;
59 * \returns The body text of the item in RTF format. Supposed to be shown to
60 * the user if KSayIt is not in edit mode.
62 virtual QString
getRTFData() const = 0;
65 * \returns The header of the item that is deliverd to the TTS system.
67 virtual QString
getHeader() const = 0;
70 * \returns The body text of the item that is delivered to the TTS system.
72 virtual QString
getData() const = 0;
75 * \returns The raw data of the item including all DocBook tags. Supposed to
76 * be shown to the user if KSayIt is in edit mode.
78 virtual QString
getRawData() const = 0;
81 * Stores the given string to the item and updates the corresponding DOM node.
82 * \param data The new data stored to the DOM node. Unless otherwise noted
83 * embedded XML tags are not allowed.
85 virtual void setData(const QString
&data
, QDomDocument
&doc
) = 0;
88 * Called on the delete action of the item.
90 virtual void deleteAction() = 0;
93 * \returns The identifier of the item as defined by
94 * the \p id attribute in \p ContextMenus.xml.
95 * Returns \p QString::null if no identifier is needed.
97 virtual QString
getXmlContextName() const = 0;
100 * Stores alist of nodes that are associated to this TreeView
101 * element. The order of nodes within the list is significant.
102 * \param list List of \p QDomNode objects.
104 virtual void setNodes( const NodeList_type
&list
) = 0;
107 * \param list A reference to a list that returns the nodes
108 * associated to this TreeView element.
110 virtual void getNodes( NodeList_type
&list
) const = 0;
112 virtual void setEditable(bool editable
) = 0;
114 virtual bool isEditable() const = 0;