Minor fix
[kdeaccessibility.git] / ksayit / src / Types.h
blob33e739e34729bc572643a2e72934cb60099a65e6
1 /***************************************************************************
2 Types.h - description
3 -------------------
4 begin : Fr Nov 21 2003
5 copyright : (C) 2003 by voglrobe
6 email : voglrobe@saphir
7 ***************************************************************************/
9 /***************************************************************************
10 * *
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. *
15 * *
16 ***************************************************************************/
18 #ifndef TYPES_H
19 #define TYPES_H
21 #include <vector>
23 // QT includes
24 #include <qdom.h>
26 #include <qmap.h>
28 // KDE includes
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;
39 /**
40 This abstract class is the interface to access the items of the TreeView.
41 @author Robert Vogl
43 class ListViewInterface : public KListViewItem
45 public:
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();
52 /**
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;
58 /**
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;
64 /**
65 * \returns The header of the item that is deliverd to the TTS system.
67 virtual QString getHeader() const = 0;
69 /**
70 * \returns The body text of the item that is delivered to the TTS system.
72 virtual QString getData() const = 0;
74 /**
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;
80 /**
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;
87 /**
88 * Called on the delete action of the item.
90 virtual void deleteAction() = 0;
92 /**
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;
99 /**
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;
118 #endif