Adding Macros!
[pierogi] / macros / pirmacro.h
index fe0b583..a803eeb 100644 (file)
@@ -6,7 +6,10 @@
 #include <QString>
 
 class PIRMacroCommandItem;
+class PIRMacroPack;
 class QListWidget;
+class QSettings;
+class MainWindow;
 
 #include <list>
 typedef std::list<PIRMacroCommandItem *> CommandSequence;
@@ -17,22 +20,55 @@ class PIRMacro: public QObject, public QTreeWidgetItem
 
 public:
   PIRMacro(
-    QTreeWidgetItem *parent,
-    QString n,
-    char k);
+    PIRMacroPack *parent,
+    QString name,
+    char key,
+    unsigned int buttonID,
+    MainWindow *mw);
+
+  ~PIRMacro();
 
   QString getName();
 
-  char getKeyMapping();
+  void setName(
+    QString name);
+
+  char getKey();
+
+  void setKey(
+    char key);
+
+  unsigned int getButtonID();
+
+  void setButtonID(
+    unsigned int id);
 
   void appendCommand(
     PIRMacroCommandItem *c);
 
+  bool deleteCommand(
+    int index);
+
+  bool moveUp(
+    int index);
+
+  bool moveDown(
+    int index);
+
   void populateList(
     QListWidget *lw);
 
   bool executeMacro();
 
+  void storeSettings(
+    QSettings &settings);
+
+  QString getCommandType(
+    int index);
+
+  QString getCommandName(
+    int index);
+
 signals:
   void macroCompleted();
 
@@ -40,12 +76,15 @@ private slots:
   void startNextCommand();
 
 private:
-  QString name;
-  char keyMapping;
+  char key;
+  unsigned int buttonID;
   CommandSequence commands;
   CommandSequence::iterator currentCommand;
+  unsigned int preMacroKeysetID;
 
   static bool macroRunning; // only one macro can run at a time!
+
+  MainWindow *mainWindow;
 };
 
 #endif // PIRMACRO_H