]> ruin.nu Git - hbs.git/blobdiff - bs/fleetview.h
initial commit
[hbs.git] / bs / fleetview.h
diff --git a/bs/fleetview.h b/bs/fleetview.h
new file mode 100644 (file)
index 0000000..a2bbaaf
--- /dev/null
@@ -0,0 +1,83 @@
+/***************************************************************************
+                          fleetview.h  -  description
+                             -------------------
+    begin                : Sun Mar 10 2002
+    copyright            : (C) 2002 by Michael Andreen
+    email                : whale@linux.nu
+ ***************************************************************************/
+
+/***************************************************************************
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ ***************************************************************************/
+
+#ifndef FLEETVIEW_H
+#define FLEETVIEW_H
+
+#include <map>
+#include <vector>
+
+#include <qwidget.h>
+#include <qlayout.h>
+#include <qlabel.h>
+#include <qlineedit.h>
+#include <qsignalmapper.h>
+
+#include "fleet.h"
+
+class RoidsEditView;
+class ResourceView;
+
+/**
+  *@author Michael Andreen
+  */
+class FleetView : public QWidget
+{
+   Q_OBJECT
+public: 
+       FleetView(const Fleet* fleet, bool friendly, QWidget *parent=0, const char *name=0);
+       ~FleetView();
+
+       void viewFleet(const Fleet* fleet, bool friendly);
+
+       const Fleet* fleet();
+       bool isHome();
+       bool isFriendly();
+
+       bool isModified();
+       
+signals:
+       void fleetChanged(const Fleet*);
+
+protected slots:
+       void unitsChanged(const QString& number);
+
+protected:
+       void findNames();
+       void buildUnitTable();
+       void fillTable();
+       
+       QVBoxLayout* m_MainLayout;
+       QGridLayout* m_UnitsLayout;
+       QLabel*      m_UnitName; 
+
+       RoidsEditView* m_RoidsEditView;
+       ResourceView*  m_ResourceView;
+
+       Fleet* m_Fleet;
+       bool  m_bHome;
+       bool  m_bFriendly;
+
+       bool m_Modified;
+
+       std::vector<QString>      m_Names;
+       std::map<QString, QLabel*>    m_UnitsLabel;
+       std::map<QString, QLineEdit*> m_UnitsEdit;
+       std::map<QString, QLineEdit*> m_UnitsLostSurvivedView;
+};
+
+#endif