File indexing completed on 2025-07-13 04:09:19

0001 /***************************************************************************
0002  *                                                                         *
0003  *   copyright : (C) 2007 The University of Toronto                        *
0004  *                   netterfield@astro.utoronto.ca                         *
0005  *   copyright : (C) 2005  University of British Columbia                  *
0006  *                   dscott@phas.ubc.ca                                    *
0007  *                                                                         *
0008  *   This program is free software; you can redistribute it and/or modify  *
0009  *   it under the terms of the GNU General Public License as published by  *
0010  *   the Free Software Foundation; either version 2 of the License, or     *
0011  *   (at your option) any later version.                                   *
0012  *                                                                         *
0013  ***************************************************************************/
0014 #ifndef EDITABLEVECTOR_H
0015 #define EDITABLEVECTOR_H
0016 
0017 #include "vector.h"
0018 #include "kst_export.h"
0019 
0020 //#include <QFile>
0021 
0022 /**A vector  with n editable pts
0023  *@author cbn
0024  */
0025 
0026 namespace Kst {
0027 
0028 class KSTCORE_EXPORT EditableVector : public Vector {
0029   Q_OBJECT
0030 
0031   public:
0032     virtual const QString& typeString() const;
0033     static const QString staticTypeString;
0034     static const QString staticTypeTag;
0035 
0036     void save(QXmlStreamWriter &s);
0037 
0038     void setSaveData(bool save);
0039 
0040     /** If value exceeds length, vector is resized
0041       * @sa Vector::change()
0042       */
0043     void setValue(const int& i,const double&val);
0044 
0045     virtual QString descriptionTip() const;
0046 
0047     void loadFromTmpFile(QFile &fp);
0048 
0049     ScriptInterface* createScriptInterface();
0050 
0051   protected:
0052     long double _sum;
0053     EditableVector(ObjectStore *store);
0054 
0055     friend class ObjectStore; 
0056 
0057     virtual QString _automaticDescriptiveName() const;
0058 };
0059 
0060 typedef SharedPtr<EditableVector> EditableVectorPtr;
0061 typedef ObjectList<EditableVector> EditableVectorList;
0062 
0063 }
0064 
0065 #endif
0066 // vim: ts=2 sw=2 et