00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef CHANNELCOLORS_H
00019 #define CHANNELCOLORS_H
00020
00021
00022 #include <qptrlist.h>
00023 #include <qcolor.h>
00024 #include <qvaluelist.h>
00025
00033 class ChannelColors {
00034
00035 public:
00036
00037 ChannelColors();
00038 virtual ~ChannelColors();
00039 ChannelColors(const ChannelColors& channelcolors);
00040
00041 private:
00042
00044 struct ChannelColor{
00045 int channelId;
00046 QColor color;
00047 QColor groupColor;
00048 QColor spikeGroupColor;
00049
00050 ChannelColor(int id,QColor c,QColor gc,QColor gdc){
00051 channelId = id;
00052 color = c;
00053 groupColor = gc;
00054 spikeGroupColor = gdc;
00055 }
00056 ChannelColor(const ChannelColor& origin):channelId(origin.channelId),
00057 color(origin.color),groupColor(origin.groupColor),spikeGroupColor(origin.spikeGroupColor){};
00058 ~ChannelColor(){};
00059 };
00060
00062 QPtrList<ChannelColor> channelList;
00063
00069 virtual ChannelColor* channelColor(int channelId) const;
00070
00076 virtual int channelColorIndex(int channelId) const;
00077
00078 public:
00079
00083 inline void removeAll(){channelList.clear();};
00084
00090 virtual QColor color(int identifier);
00091
00097 virtual QColor groupColor(int identifier);
00098
00104 virtual QColor spikeGroupColor(int identifier);
00105
00111 virtual void setColor(int identifier,QColor color);
00112
00118 virtual void setGroupColor(int identifier,QColor color);
00119
00125 virtual void setSpikeGroupColor(int identifier,QColor color);
00126
00132 virtual int channelId(int index);
00133
00139 virtual bool contains(int channelId);
00140
00145 virtual inline uint numberOfChannels() const {return channelList.count();};
00146
00155 virtual uint append(int channelId, QColor color,QColor groupColor,QColor spikeGroupColor);
00156
00164 virtual uint append(int channelId, QColor color);
00165
00174 virtual void insert(int channelId,int index,QColor color,QColor groupColor,QColor spikeGroupColor);
00175
00176
00182 virtual bool remove(int identifier);
00183
00184 };
00185
00186 #endif