Avogadro  1.1.0
/home/kitware/dashboards/avogadro/libavogadro/src/periodictableview.h
00001 /**********************************************************************
00002  PeriodicTableView - Periodic Table Graphics View for Avogadro
00003 
00004  Copyright (C) 2007-2009 by Marcus D. Hanwell
00005 
00006  This file is part of the Avogadro molecular editor project.
00007  For more information, see <http://avogadro.openmolecules.net/>
00008 
00009  Avogadro is free software; you can redistribute it and/or modify
00010  it under the terms of the GNU Lesser General Public License as published by
00011  the Free Software Foundation; either version 2.1 of the License, or
00012  (at your option) any later version.
00013 
00014  Avogadro is distributed in the hope that it will be useful,
00015  but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  GNU General Public License for more details.
00018 
00019  You should have received a copy of the GNU General Public License
00020  along with this program; if not, write to the Free Software
00021  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00022  02110-1301, USA.
00023  **********************************************************************/
00024 
00025 #ifndef PERIODICTABLEVIEW_H
00026 #define PERIODICTABLEVIEW_H
00027 
00028 #include <avogadro/global.h>
00029 
00030 #include <QGraphicsView>
00031 
00032 namespace Avogadro {
00033 
00043   class A_EXPORT PeriodicTableView : public QGraphicsView
00044   {
00045     Q_OBJECT
00046 
00047   public:
00052     explicit PeriodicTableView(QWidget *parent = 0);
00053 
00057     ~PeriodicTableView();
00058 
00059   private Q_SLOTS:
00063     void elementClicked(int element);
00064 
00065   Q_SIGNALS:
00069     void elementChanged(int element);
00070 
00071   private:
00075     int m_element;
00076 
00077   protected:
00082     bool event(QEvent *e);
00083 
00087     void mouseDoubleClickEvent(QMouseEvent *event);
00092     void keyPressEvent(QKeyEvent *event);
00093 
00094   public Q_SLOTS:
00100     void clearKeyPressBuffer();
00101 
00102   private:
00103     QString   m_keyPressBuffer;
00104   };
00105 
00106 } // End of Avogadro namespace
00107 
00108 #endif
00109