GweController.h

00001 /***************************************************************************
00002  *   Copyright (C) 2004 - 2006 by Raphael Langerhorst                      *
00003  *   raphael-langerhorst@gmx.at                                            *
00004  *                                                                         *
00005  *   Permission is hereby granted, free of charge, to any person obtaining *
00006  *   a copy of this software and associated documentation files (the       *
00007  *   "Software"), to deal in the Software without restriction, including   *
00008  *   without limitation the rights to use, copy, modify, merge, publish,   *
00009  *   distribute, sublicense, and/or sell copies of the Software, and to    *
00010  *   permit persons to whom the Software is furnished to do so, subject to *
00011  *   the following conditions:                                             *
00012  *                                                                         *
00013  *   The above copyright notice and this permission notice shall be        *
00014  *   included in all copies or substantial portions of the Software.       *
00015  *                                                                         *
00016  *   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,       *
00017  *   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF    *
00018  *   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*
00019  *   IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR     *
00020  *   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, *
00021  *   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR *
00022  *   OTHER DEALINGS IN THE SOFTWARE.                                       *
00023  ***************************************************************************/
00024 
00025 
00026 #ifndef GWECONTROLLERH
00027 #define GWECONTROLLERH
00028 
00029 #include <QObject>
00030 
00031 #include "GActionInterface.h"
00032 
00033 namespace GCS
00034 {
00035 
00036 class GElement;
00037 class GElementID;
00038 class GElementInfluence;
00039 class GEnergy;
00040 
00041 }
00042 
00043 namespace GWE
00044 {
00045 
00046 class GDataController;
00047 class GInformationInterface;
00048 
00070 class GweController : public QObject, public GActionInterface
00071 {
00072   Q_OBJECT
00073   
00074   protected:
00075   
00082     GDataController* Data;
00083     
00088     GInformationInterface* InformationInterface;
00089   
00090   public:
00091   
00096     GweController(GDataController* data, GInformationInterface* info, QObject *parent = 0);
00097   
00102     virtual ~GweController();
00103     
00104     // HELPER OBJECTS //
00105  
00109     virtual GDataController* getDataController();
00110     
00114     virtual const GDataController* getDataController() const;
00115     
00119     virtual GInformationInterface* getInformationInterface();
00120     
00125     virtual GActionInterface* getActionInterface();
00126     
00127   public:
00128     
00129     //BEGIN implementation GActionInterface
00130     
00131     virtual void performAction(const GCS::GElementID& element, const QString& action, QStringList params, const QString& agent = QString());
00132     
00133     virtual QStringList getAvailableActions(const GCS::GElementID& element) const;
00134     
00135     virtual QString getActionDescription(const GCS::GElementID& element, const QString& action) const;
00136     
00137     //END implementation GActionInterface
00138     
00139   protected:
00140   
00141     // USEFUL MANAGEMENT ROUTINES //
00142     
00143   protected slots:
00144   
00155     virtual void connectBasicElementSignals(const GCS::GElementID& id);
00156     
00157   protected:
00158     
00190     virtual QList<GCS::GElement*> findInRange(GCS::GElement* source, double range_factor, unsigned max_traverse_children = 0, unsigned max_traverse_parents = 1);
00191     
00192   public slots:
00193     
00194     virtual void executeOpenElement(const GCS::GElementID& id);
00195         
00196     // INFLUENCE MANAGEMENT //
00197   
00204     virtual void radiateInfluence(const GCS::GElementInfluence& influence, double radius_factor);
00205     
00211     virtual void routeInfluence(const GCS::GElementInfluence& influence, const GCS::GElementID& destination);
00212     
00220     virtual void removeElementWithNoEnergyLeft(const GCS::GEnergy& changedEnergy);
00221 
00232     virtual void shutdown();
00233     
00234   signals:
00235     
00240     void quit();
00241   
00242 };
00243 
00244 }
00245 
00246 #endif

Generated on Thu Nov 16 07:49:12 2006 for G System by  doxygen 1.4.7