sAlarm 0.5
salarm/scheduler/schedulermodel.h
00001 /*
00002  * sAlarm - Scheduler
00003  * http://salarm.seberm.com
00004  *
00005  * Copyright (C) 2009-2010 Otto Sabart <seberm[at]gmail[dot]com>
00006  * 
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License
00009  * version 3 as published by the Free Software Foundation.
00010  * 
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  * 
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00019  */
00020 
00021 
00022 #ifndef SCHEDULERMODEL_H
00023 #define SCHEDULERMODEL_H
00024 
00025 #include <QAbstractItemModel>
00026 #include <QModelIndex>
00027 #include <QVariant>
00028 
00029 class Schedule;
00030 
00031 
00032 class SchedulerModel : public QAbstractItemModel {
00033 
00034 Q_OBJECT
00035 
00036 public:
00038 
00041     //explicit SchedulerModel(QObject *parent = 0);
00042         SchedulerModel(const QStringList &headers, QObject *parent = 0); 
00043         
00045         ~SchedulerModel();
00046         
00047         int rowCount(const QModelIndex &parent) const;
00048         int columnCount(const QModelIndex &parent) const;
00049         QVariant data(const QModelIndex &index, int role) const;
00050         QVariant headerData(int section, Qt::Orientation orientation, int role) const;
00051         bool setHeaderData(int section, Qt::Orientation orientation, const QVariant &value, int role);
00052         Qt::ItemFlags flags(const QModelIndex &index) const;
00053         bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::DisplayRole);
00054         bool insertRows(int position, int rows, const QModelIndex &index = QModelIndex());
00055         //bool insertColumns(int position, int columns, const QModelIndex &parent);
00056         bool removeRows(int position, int rows, const QModelIndex &index = QModelIndex());
00057         //bool removeColumns(int position, int columns, const QModelIndex &parent);
00058         
00059         QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const;
00060         QModelIndex parent(const QModelIndex &child) const;
00061         
00062         
00063 private:
00064         Schedule* m_rootItem;
00065         
00066         Schedule* getItem(const QModelIndex &index) const;
00067         
00068         
00069 signals:
00070 
00071 public slots:
00072 
00073 };
00074 
00075 #endif // SCHEDULERMODEL_H
 All Classes Functions Enumerations