• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeaccessibility API Reference
  • KDE Home
  • Contact Us
 

jovie

  • sources
  • kde-4.12
  • kdeaccessibility
  • jovie
  • libkttsd
talkerlistmodel.h
Go to the documentation of this file.
1 /***************************************************** vim:set ts=4 sw=4 sts=4:
2  Model for listing Talkers, typically in a QTreeView.
3  -------------------
4  Copyright : (C) 2005 by Gary Cramblitt <garycramblitt@comcast.net>
5  Copyright : (C) 2009 by Jeremy Whiting <jpwhiting@kde.org>
6  -------------------
7  Original author: Gary Cramblitt <garycramblitt@comcast.net>
8  Current Maintainer: Jeremy Whiting <jpwhiting@kde.org>
9 
10  This program is free software; you can redistribute it and/or modify
11  it under the terms of the GNU General Public License as published by
12  the Free Software Foundation; either version 2 of the License, or
13  (at your option) any later version.
14 
15  This program is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  GNU General Public License for more details.
19 
20  You should have received a copy of the GNU General Public License
21  along with this program; if not, write to the Free Software
22  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23 *******************************************************************************/
24 
25 #ifndef TALKERLISTMODEL_H
26 #define TALKERLISTMODEL_H
27 
28 // Qt includes.
29 #include <QtCore/QAbstractListModel>
30 #include <QtCore/QModelIndex>
31 
32 // KDE includes.
33 #include <kdemacros.h>
34 
35 // KTTS includes.
36 #include "talkercode.h"
37 
38 class KConfig;
39 
45 class KDE_EXPORT TalkerListModel : public QAbstractListModel
46 {
47  Q_OBJECT
48 public:
49  explicit TalkerListModel(TalkerCode::TalkerCodeList talkers = TalkerCode::TalkerCodeList(), QObject *parent = 0);
50 
51  // Inherited method overrides.
52  int rowCount(const QModelIndex &parent = QModelIndex()) const;
53  int columnCount(const QModelIndex &parent = QModelIndex()) const;
54  QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const;
55  QModelIndex parent(const QModelIndex & index ) const;
56  QVariant data(const QModelIndex &index, int role) const;
57  QVariant headerData(int section, Qt::Orientation orientation,
58  int role = Qt::DisplayRole) const;
59  Qt::ItemFlags flags(const QModelIndex &index) const;
60  bool removeRow(int row, const QModelIndex & parent = QModelIndex());
61 
65  const TalkerCode::TalkerCodeList datastore() const { return m_talkerCodes; }
66  void setDatastore(TalkerCode::TalkerCodeList talkers = TalkerCode::TalkerCodeList());
70  TalkerCode getRow(int row) const;
74  bool appendRow(TalkerCode& talker);
78  bool updateRow(int row, TalkerCode& talker);
82  bool swap(int i, int j);
86  void clear();
91  void loadTalkerCodesFromConfig(KConfig* config);
92 
93 private:
94  // Returns the displayable portion of the talkerCode corresponding to a column of the view.
95  QVariant dataColumn(const TalkerCode& talkerCode, int column) const;
96  // QList of TalkerCodes.
97  TalkerCode::TalkerCodeList m_talkerCodes;
98 };
99 
100 #endif // TALKERLISTMODEL_H
TalkerCode::TalkerCodeList
QList< TalkerCode > TalkerCodeList
Definition: talkercode.h:61
QAbstractListModel
QObject
talkercode.h
TalkerListModel
Model for list of configured talkers.
Definition: talkerlistmodel.h:45
TalkerCode
Definition: talkercode.h:38
TalkerListModel::datastore
const TalkerCode::TalkerCodeList datastore() const
The list of TalkerCodes for this model.
Definition: talkerlistmodel.h:65
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:32:25 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

jovie

Skip menu "jovie"
  • Main Page
  • Namespace List
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdeaccessibility API Reference

Skip menu "kdeaccessibility API Reference"
  • jovie

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal