~ubuntu-branches/ubuntu/oneiric/xca/oneiric

« back to all changes in this revision

Viewing changes to lib/pki_base.h

  • Committer: Bazaar Package Importer
  • Author(s): Tino Keitel
  • Date: 2009-09-14 20:55:44 UTC
  • Revision ID: james.westby@ubuntu.com-20090914205544-l4qsm2tjimhd62vo
Tags: upstream-0.7.0
ImportĀ upstreamĀ versionĀ 0.7.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* vi: set sw=4 ts=4:
 
2
 *
 
3
 * Copyright (C) 2001 - 2007 Christian Hohnstaedt.
 
4
 *
 
5
 * All rights reserved.
 
6
 */
 
7
 
 
8
#ifndef PKI_BASE_H
 
9
#define PKI_BASE_H
 
10
 
 
11
#include <openssl/err.h>
 
12
#include <qstring.h>
 
13
#include <qlistview.h>
 
14
#include "db.h"
 
15
#include "base.h"
 
16
 
 
17
class pki_base : public QObject
 
18
{
 
19
        Q_OBJECT
 
20
 
 
21
        private:
 
22
                static int pki_counter;
 
23
        protected:
 
24
                int cols;
 
25
                const char *class_name;
 
26
                QString desc;
 
27
                int dataVersion;
 
28
                enum pki_type pkiType;
 
29
                /* model data */
 
30
                pki_base *parent;
 
31
 
 
32
                void my_error(const QString myerr) const;
 
33
                void check_oom(const void *ptr) const;
 
34
                void fopen_error(const QString fname);
 
35
 
 
36
        public:
 
37
                static bool ign_openssl_error();
 
38
                QList<pki_base*> childItems;
 
39
                pki_base(const QString d = "", pki_base *p = NULL);
 
40
                virtual void fload(const QString) {};
 
41
                virtual void writeDefault(const QString){};
 
42
                static int get_pki_counter(void);
 
43
                virtual void fromData(const unsigned char *, db_header_t *){};
 
44
                virtual void oldFromData(unsigned char *p, int size);
 
45
                virtual unsigned char *toData(int *) { return NULL; }
 
46
                virtual bool compare(pki_base *) { return false; };
 
47
                virtual ~pki_base();
 
48
                        QString getIntName() const;
 
49
                QString getUnderlinedName() const;
 
50
                        void setIntName(const QString &d);
 
51
                QString getClassName();
 
52
                static QString rmslashdot(const QString &fname);
 
53
 
 
54
                void openssl_error(const QString myerr = "") const;
 
55
                int getVersion();
 
56
                enum pki_type getType();
 
57
                void setParent(pki_base *p);
 
58
                virtual pki_base *getParent();
 
59
                pki_base *child(int row);
 
60
                void append(pki_base *item);
 
61
                void insert(int row, pki_base *item);
 
62
                int childCount();
 
63
                int row() const;
 
64
                pki_base *iterate(pki_base *pki = NULL);
 
65
                void takeChild(pki_base *pki);
 
66
                pki_base *takeFirst();
 
67
                int columns();
 
68
                virtual QVariant column_data(int col);
 
69
                virtual QVariant getIcon();
 
70
                const char *className() { return class_name; };
 
71
                uint32_t intFromData(const unsigned char **p);
 
72
                virtual void fromPEM_BIO(BIO *, QString) {};
 
73
};
 
74
 
 
75
#endif