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 ***************************************************************************/
24 #include <QtXml/qdom.h>
25 #include <QtCore/QMap>
28 #include <k3listview.h>
30 typedef QList
<int> ParameterList_type
;
31 typedef QMap
<QString
, ParameterList_type
> EffectConfig_type
;
32 typedef std::vector
<QDomNode
> NodeList_type
;
34 namespace KSayItGlobal
{
35 static const int item_initial_id
= 100;
39 This abstract class is the interface to access the items of the TreeView.
42 class ListViewInterface
: public K3ListViewItem
45 ListViewInterface(ListViewInterface
*parent
=0, QString label
=QString());
46 ListViewInterface(ListViewInterface
*parent
=0, ListViewInterface
*after
=0, QString label
=QString());
47 ListViewInterface(K3ListView
*lv
=0, QString label
=QString());
49 // ~ListViewItemInterface();
52 * \returns The header of the item in RTF format. Supposed to be shown to
53 * the user if KSayIt is not in edit mode.
55 virtual QString
getRTFHeader() const = 0;
58 * \returns The body text of the item in RTF format. Supposed to be shown to
59 * the user if KSayIt is not in edit mode.
61 virtual QString
getRTFData() const = 0;
64 * \returns The header of the item that is deliverd to the TTS system.
66 virtual QString
getHeader() const = 0;
69 * \returns The body text of the item that is delivered to the TTS system.
71 virtual QString
getData() const = 0;
74 * \returns The raw data of the item including all DocBook tags. Supposed to
75 * be shown to the user if KSayIt is in edit mode.
77 virtual QString
getRawData() const = 0;
80 * Stores the given string to the item and updates the corresponding DOM node.
81 * \param data The new data stored to the DOM node. Unless otherwise noted
82 * embedded XML tags are not allowed.
84 virtual void setData(const QString
&data
, QDomDocument
&doc
) = 0;
87 * Called on the delete action of the item.
89 virtual void deleteAction() = 0;
92 * \returns The identifier of the item as defined by
93 * the \p id attribute in \p ContextMenus.xml.
94 * Returns \p QString() if no identifier is needed.
96 virtual QString
getXmlContextName() const = 0;
99 * Stores alist of nodes that are associated to this TreeView
100 * element. The order of nodes within the list is significant.
101 * \param list List of \p QDomNode objects.
103 virtual void setNodes( const NodeList_type
&list
) = 0;
106 * \param list A reference to a list that returns the nodes
107 * associated to this TreeView element.
109 virtual void getNodes( NodeList_type
&list
) const = 0;
111 virtual void setEditable(bool editable
) = 0;
113 virtual bool isEditable() const = 0;