1 /*
2 ################################################################################
3 #  THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY  #
4 #  Read the zproject/README.md for information about making permanent changes. #
5 ################################################################################
6 */
7 
8 #ifndef QML_ZCERTSTORE_H
9 #define QML_ZCERTSTORE_H
10 
11 #include <QtQml>
12 
13 #include <czmq.h>
14 #include "qml_czmq_plugin.h"
15 
16 
17 class QmlZcertstore : public QObject
18 {
19     Q_OBJECT
20     Q_PROPERTY(bool isNULL READ isNULL)
21 
22 public:
23     zcertstore_t *self;
24 
QmlZcertstore()25     QmlZcertstore() { self = NULL; }
isNULL()26     bool isNULL() { return self == NULL; }
27 
28     static QObject* qmlAttachedProperties(QObject* object); // defined in QmlZcertstore.cpp
29 
30 public slots:
31     //  Override the default disk loader with a custom loader fn.
32     void setLoader (zcertstore_loader loader, zcertstore_destructor destructor, void *state);
33 
34     //  Look up certificate by public key, returns zcert_t object if found,
35     //  else returns NULL. The public key is provided in Z85 text format.
36     QmlZcert *lookup (const QString &publicKey);
37 
38     //  Insert certificate into certificate store in memory. Note that this
39     //  does not save the certificate to disk. To do that, use zcert_save()
40     //  directly on the certificate. Takes ownership of zcert_t object.
41     void insert (QmlZcert *certP);
42 
43     //  Empty certificate hashtable. This wrapper exists to be friendly to bindings,
44     //  which don't usually have access to struct internals.
45     void empty ();
46 
47     //  Print list of certificates in store to logging facility
48     void print ();
49 
50     //  Return a list of all the certificates in the store.
51     //  The caller takes ownership of the zlistx_t object and is responsible
52     //  for destroying it.  The caller does not take ownership of the zcert_t
53     //  objects.
54     QmlZlistx *certs ();
55 
56     //  Return the state stored in certstore
57     void *state ();
58 };
59 
60 class QmlZcertstoreAttached : public QObject
61 {
62     Q_OBJECT
63     QObject* m_attached;
64 
65 public:
QmlZcertstoreAttached(QObject * attached)66     QmlZcertstoreAttached (QObject* attached) {
67         Q_UNUSED (attached);
68     };
69 
70 public slots:
71     //  Self test of this class
72     void test (bool verbose);
73 
74     //  Create a new certificate store from a disk directory, loading and
75     //  indexing all certificates in that location. The directory itself may be
76     //  absent, and created later, or modified at any time. The certificate store
77     //  is automatically refreshed on any zcertstore_lookup() call. If the
78     //  location is specified as NULL, creates a pure-memory store, which you
79     //  can work with by inserting certificates at runtime.
80     QmlZcertstore *construct (const QString &location);
81 
82     //  Destroy a certificate store object in memory. Does not affect anything
83     //  stored on disk.
84     void destruct (QmlZcertstore *qmlSelf);
85 };
86 
87 
88 QML_DECLARE_TYPEINFO(QmlZcertstore, QML_HAS_ATTACHED_PROPERTIES)
89 
90 #endif
91 /*
92 ################################################################################
93 #  THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY  #
94 #  Read the zproject/README.md for information about making permanent changes. #
95 ################################################################################
96 */
97