Log In
New Account
  
Home My Page Project Cloud Code Snippets Project Openings Pierogi
Summary Forums Tracker Lists Tasks Docs News SCM Files
1 #ifndef PIRKEYSETMANAGER_H
2 #define PIRKEYSETMANAGER_H
4 #include "pirkeysetmetadata.h"
5 //#include "protocol.h"
6 #include "pirkeynames.h"
7 //#include "selectionwindow.h"
8 #include "pirselectkeysetform.h"
9 #include "pirkeysetwidgetitem.h"
11 #include <QString> // needed to work with QSettings data...
13 //#include <QtCore/QCoreApplication>
14 #include <QThread>
15 //#include <QStringList>
17 #include <map>
19 typedef std::map<unsigned int, PIRKeysetMetaData *> PIRKeysetCollection;
21 // Maps used to locate metadata using QSettings values:
22 typedef std::map<QString, unsigned int> PIRKeysetNameIndex;
23 typedef std::map<QString, PIRKeysetNameIndex> PIRKeysetMakeIndex;
25 class PIRKeysetManager
26 {
27 public:
28   PIRKeysetManager(
29     QObject *guiObject);
31   ~PIRKeysetManager();
33   void populateGuiWidget(
34     PIRSelectKeysetForm *widget) const;
36   bool keysetExists(
37     unsigned int keysetID) const;
39   bool findKeysetID(
40     QString make,
41     QString name,
42     unsigned int &id) const;
44   PIRKeysetWidgetItem *makeKeysetItem(
45     QString make,
46     QString name) const;
48   bool hasKey(
49     unsigned int keysetID,
50     PIRKeyName name) const;
52   PIRMakeName getMake(
53     unsigned int keysetID) const;
55   QString getDisplayName(
56     unsigned int keysetID) const;
58   void populateDeviceTypes(
59     PIRKeysetWidgetItem *kwi,
60     unsigned int keysetID) const;
62 private:
63   // This needs to be improved:
64   void populateKeyset(
65     PIRKeysetMetaData *keyset);
67   PIRKeysetCollection keysetsInfo;
68   PIRKeysetMakeIndex makeIndex;
70   // The counter will be used to generate unique ids for each keyset:
71   unsigned int counter;
73   QThread commandThread;
74 };
76 #endif // PIRKEYSETMANAGER_H

Terms of Use    Privacy Policy    Contribution Guidelines    Feedback

Powered By GForge Collaborative Development Environment