VTK
dox/GUISupport/Qt/Chart/vtkQtChartLegendModel.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkQtChartLegendModel.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00015 /*-------------------------------------------------------------------------
00016   Copyright 2008 Sandia Corporation.
00017   Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
00018   the U.S. Government retains certain rights in this software.
00019 -------------------------------------------------------------------------*/
00020 
00023 
00024 #ifndef _vtkQtChartLegendModel_h
00025 #define _vtkQtChartLegendModel_h
00026 
00027 
00028 #include "vtkQtChartExport.h"
00029 #include <QObject>
00030 #include <QPixmap> // Needed for return type
00031 #include <QString> // Needed for return type
00032 
00033 class vtkQtChartLegendModelInternal;
00034 class vtkQtPointMarker;
00035 class QPen;
00036 
00037 
00041 class VTKQTCHART_EXPORT vtkQtChartLegendModel : public QObject
00042 {
00043   Q_OBJECT
00044 
00045 public:
00049   vtkQtChartLegendModel(QObject *parent=0);
00050   virtual ~vtkQtChartLegendModel();
00051 
00058   int addEntry(const QPixmap &icon, const QString &text, bool visible);
00059 
00067   int insertEntry(
00068     int index, const QPixmap &icon, const QString &text, bool visible);
00069 
00073   void removeEntry(int index);
00074 
00076   void removeAllEntries();
00077 
00088   void startModifyingData();
00089 
00096   void finishModifyingData();
00097 
00102   int getNumberOfEntries() const;
00103 
00110   int getIndexForId(unsigned int id) const;
00111 
00118   QPixmap getIcon(int index) const;
00119 
00124   void setIcon(int index, const QPixmap &icon);
00125 
00132   QString getText(int index) const;
00133 
00138   void setText(int index, const QString &text);
00139 
00144   void setVisible(int index, bool visible);
00145 
00148   bool getVisible(int index) const;
00149 
00150 signals:
00154   void entryInserted(int index);
00155 
00159   void removingEntry(int index);
00160 
00164   void entryRemoved(int index);
00165 
00167   void entriesReset();
00168 
00172   void iconChanged(int index);
00173 
00177   void textChanged(int index);
00178 
00181   void visibilityChanged(int index);
00182 
00183 private:
00184   vtkQtChartLegendModelInternal *Internal; 
00185   bool InModify;                        
00186 };
00187 
00188 #endif