![]() |
IOT
0.5
I Only Think
|
00001 // -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*- 00002 00003 /* IOT Copyright (C) 2010 CEG development team 00004 * 00005 * This program is free software; you can redistribute it and/or modify 00006 * it under the terms of the GNU General Public License version 2 00007 * as published by the Free Software Foundation. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program; if not, write to the Free Software 00016 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00017 * 00018 * Authors: CEG <ceg@ionlythink.com>, http://www.ionlythink.com 00019 */ 00020 00021 #ifndef LAYER_H 00022 #define LAYER_H 00023 00024 #include <QProcess> 00025 00026 #include "AbstractScene.h" 00027 #include "Window.h" 00028 00029 class MainController; 00030 class IAction; 00031 00036 class Layer : public AbstractScene 00037 { 00038 Q_OBJECT 00039 public: 00040 Layer(Ceg::Window const &, MainController &); 00041 ~Layer(); 00042 00043 void setProcess(QProcess *); 00044 00045 virtual QRect getGeometry() const; 00046 virtual IAction * keyPressEvent(int key) ; 00047 virtual void initialize(QList<QGraphicsRectItem *> const & sceneItems); // Ajout des items a la scene 00048 00049 private: 00050 void moveVertically() const; // Gere le mouvement vertical 00051 IAction * moveHorizontally(); // Gere le mouvement horizontal 00052 00053 private slots: 00054 void on_processError(QProcess::ProcessError error); 00055 void on_processFinished( int exitCode, QProcess::ExitStatus exitStatus ); 00056 00057 signals: 00058 void actionEmitted(IAction &); //signal d'action 00059 00060 private: 00061 Ceg::Window _host; // la fenetre qui est calquee 00062 IAction * _menuAction; // Correspond a l'action retourne lorsque l'utilisateur sort du calque 00063 QProcess * _process; // Le process correspondant au programme lance 00064 MainController & _mainC; 00065 }; 00066 00067 #endif // LAYER_H