File indexing completed on 2023-05-30 10:41:17

0001 /*************************************************************************************
0002  *  Copyright (C) 2010 by Aleix Pol <aleixpol@kde.org>                               *
0003  *                                                                                   *
0004  *  This program is free software; you can redistribute it and/or                    *
0005  *  modify it under the terms of the GNU General Public License                      *
0006  *  as published by the Free Software Foundation; either version 2                   *
0007  *  of the License, or (at your option) any later version.                           *
0008  *                                                                                   *
0009  *  This program is distributed in the hope that it will be useful,                  *
0010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of                   *
0011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                    *
0012  *  GNU General Public License for more details.                                     *
0013  *                                                                                   *
0014  *  You should have received a copy of the GNU General Public License                *
0015  *  along with this program; if not, write to the Free Software                      *
0016  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA   *
0017  *************************************************************************************/
0018 
0019 #ifndef KALGEBRAMOBILE_H
0020 #define KALGEBRAMOBILE_H
0021 
0022 #include <QObject>
0023 #include <QSharedPointer>
0024 #include <analitza/variables.h>
0025 
0026 class QModelIndex;
0027 namespace Analitza {
0028     class PlotsModel;
0029 }
0030 
0031 class KAlgebraMobile : public QObject
0032 {
0033     Q_OBJECT
0034     Q_PROPERTY(QSharedPointer<Analitza::Variables> variables READ variables NOTIFY variablesChanged)
0035     public:
0036         explicit KAlgebraMobile(QObject* parent=0);
0037         
0038         static KAlgebraMobile* self();
0039         void notifyVariablesChanged() { variablesChanged(); }
0040         
0041     public Q_SLOTS:
0042         Analitza::PlotsModel* functionsModel();
0043         QSharedPointer<Analitza::Variables> variables() const;
0044         
0045     private Q_SLOTS:
0046         void functionRemoved(const QModelIndex& parent, int start, int end);
0047         void functionModified(const QModelIndex& idxA, const QModelIndex& idxB);
0048         void functionInserted(const QModelIndex& parent, int start, int end);
0049         
0050     Q_SIGNALS:
0051         void variablesChanged();
0052         
0053     private:
0054         static KAlgebraMobile* s_self;
0055         
0056         Analitza::PlotsModel* m_functionsModel;
0057         QSharedPointer<Analitza::Variables> m_vars;
0058 };
0059 
0060 #endif // KALGEBRAMOBILE_H