source: SMSSender/frontend/gui/ui/importcontacts/importerpages/contactfilesmodel.h @ 317:7baa63a067a2

separation-frontend-backend
Last change on this file since 317:7baa63a067a2 was 317:7baa63a067a2, checked in by Sämy Zehnder <saemy.zehnder@…>, 8 years ago
  • Rearranges frontend/gui/ui/ to make it flatter.
File size: 2.0 KB
Line 
1/*
2 smssender - A frontend for fast and easy SMS sending over different gateways.
3 Copyright (C) 2007-2014, gorrión. See http://smssender.gorrion.ch
4
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program.  If not, see <http://www.gnu.org/licenses/>.
17 */
18#ifndef UI_CFI_CONTACTFILESMODEL_H
19#define UI_CFI_CONTACTFILESMODEL_H
20
21#include <QAbstractTableModel>
22#include <QList>
23#include <QString>
24
25#include "frontend/business/contactimporter/contactfilesimporter.h"
26
27namespace UI {
28namespace CFI {
29
30class ContactFilesModel: public QAbstractTableModel {
31    Q_OBJECT
32
33public:
34    enum Columns {
35        ColActivated = 0,
36        ColFilename  = 1,
37
38        MaxCol     = ColFilename
39    };
40
41    explicit ContactFilesModel(ContactFilesImporterDataManager *m_dataManager);
42
43public: /* QAbstractTableModel */
44    QVariant      headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
45    QVariant      data(const QModelIndex& index, int role = Qt::DisplayRole) const;
46    bool          setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole);
47    int           columnCount(const QModelIndex& parent = QModelIndex()) const;
48    int           rowCount(const QModelIndex& parent = QModelIndex()) const;
49    Qt::ItemFlags flags(const QModelIndex& index) const;
50
51    QString       dataObject(const QModelIndex& index) const;
52
53private slots:
54    void onDataChanged();
55
56private:
57    ContactFilesImporterDataManager * const m_dataManager;
58};
59
60} // namespace CFI
61} // namespace UI
62
63#endif /* UI_CFI_CONTACTFILESMODEL_H */
Note: See TracBrowser for help on using the repository browser.