kgpg
#include <KGpgKeyNode.h>
Public Types | |
typedef QList< const KGpgKeyNode * > | ConstList |
typedef QList< KGpgKeyNode * > | List |
Public Types inherited from KGpgSignableNode | |
typedef QList< const KGpgSignableNode * > | const_List |
typedef QList< KGpgSignableNode * > | List |
Public Types inherited from KGpgNode | |
typedef QList< KGpgNode * > | List |
Public Slots | |
void | expand () |
Signals | |
void | expanded () |
Public Member Functions | |
KGpgKeyNode (KGpgRootNode *parent, const KgpgCore::KgpgKey &k) | |
virtual | ~KGpgKeyNode () |
void | addRef (KGpgRefNode *node) |
bool | canEncrypt () const |
bool | compareId (const QString &other) const |
virtual KgpgCore::KgpgKey * | copyKey () const |
void | delRef (KGpgRefNode *node) |
QString | getBeautifiedFingerprint () const |
virtual QString | getComment () const |
virtual QDateTime | getCreation () const |
virtual QString | getEmail () const |
virtual unsigned int | getEncryptionKeySize () const |
virtual QDateTime | getExpiration () const |
const QString & | getFingerprint () const |
QList< KGpgGroupMemberNode * > | getGroupRefs (void) const |
QList< KGpgGroupNode * > | getGroups (void) const |
virtual QString | getId () const |
const KgpgCore::KgpgKey * | getKey () const |
virtual KGpgKeyNode * | getKeyNode (void) |
virtual const KGpgKeyNode * | getKeyNode (void) const |
virtual QString | getName () const |
KGpgSignNode::List | getSignatures (const bool subkeys) const |
virtual QString | getSignCount () const |
virtual unsigned int | getSignKeySize () const |
KGpgSignNode::List | getSignRefs (void) const |
virtual QString | getSize () const |
virtual KgpgCore::KgpgKeyTrust | getTrust () const |
virtual KgpgCore::KgpgItemType | getType () const |
const KGpgSignableNode * | getUid (const unsigned int index) const |
virtual bool | hasChildren () const |
bool | isSecret () const |
void | setKey (const KgpgCore::KgpgKey &key) |
Public Member Functions inherited from KGpgSignableNode | |
KGpgSignableNode (KGpgExpandableNode *parent=NULL) | |
virtual | ~KGpgSignableNode () |
KGpgSignNode::List | getSignatures (void) const |
bool | operator< (const KGpgSignableNode &other) const |
bool | operator< (const KGpgSignableNode *other) const |
Public Member Functions inherited from KGpgExpandableNode | |
virtual | ~KGpgExpandableNode () |
virtual void | deleteChild (KGpgNode *child) |
virtual KGpgNode * | getChild (const int index) const |
virtual int | getChildCount () |
virtual int | getChildIndex (KGpgNode *node) const |
virtual const KGpgNode::List & | getChildren () const |
virtual bool | wasExpanded () const |
Public Member Functions inherited from KGpgNode | |
virtual | ~KGpgNode () |
virtual QString | getNameComment () const |
KGpgExpandableNode * | getParentKeyNode () const |
KGpgExpandableNode * | toExpandableNode () |
const KGpgExpandableNode * | toExpandableNode () const |
KGpgGroupMemberNode * | toGroupMemberNode () |
const KGpgGroupMemberNode * | toGroupMemberNode () const |
KGpgGroupNode * | toGroupNode () |
const KGpgGroupNode * | toGroupNode () const |
KGpgKeyNode * | toKeyNode () |
const KGpgKeyNode * | toKeyNode () const |
KGpgOrphanNode * | toOrphanNode () |
const KGpgOrphanNode * | toOrphanNode () const |
KGpgRefNode * | toRefNode () |
const KGpgRefNode * | toRefNode () const |
KGpgRootNode * | toRootNode () |
const KGpgRootNode * | toRootNode () const |
KGpgSignableNode * | toSignableNode () |
const KGpgSignableNode * | toSignableNode () const |
KGpgSignNode * | toSignNode () |
const KGpgSignNode * | toSignNode () const |
KGpgSubkeyNode * | toSubkeyNode () |
const KGpgSubkeyNode * | toSubkeyNode () const |
KGpgUatNode * | toUatNode () |
const KGpgUatNode * | toUatNode () const |
KGpgUidNode * | toUidNode () |
const KGpgUidNode * | toUidNode () const |
Public Member Functions inherited from QObject | |
QObject (QObject *parent) | |
QObject (QObject *parent, const char *name) | |
virtual | ~QObject () |
bool | blockSignals (bool block) |
QObject * | child (const char *objName, const char *inheritsClass, bool recursiveSearch) const |
const QObjectList & | children () const |
const char * | className () const |
bool | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const |
void | deleteLater () |
void | destroyed (QObject *obj) |
bool | disconnect (const QObject *receiver, const char *method) |
bool | disconnect (const char *signal, const QObject *receiver, const char *method) |
void | dumpObjectInfo () |
void | dumpObjectTree () |
QList< QByteArray > | dynamicPropertyNames () const |
virtual bool | event (QEvent *e) |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
T | findChild (const QString &name) const |
QList< T > | findChildren (const QRegExp ®Exp) const |
QList< T > | findChildren (const QString &name) const |
bool | inherits (const char *className) const |
void | insertChild (QObject *object) |
void | installEventFilter (QObject *filterObj) |
bool | isA (const char *className) const |
bool | isWidgetType () const |
void | killTimer (int id) |
virtual const QMetaObject * | metaObject () const |
void | moveToThread (QThread *targetThread) |
const char * | name () const |
const char * | name (const char *defaultName) const |
QString | objectName () const |
QObject * | parent () const |
QVariant | property (const char *name) const |
void | removeChild (QObject *object) |
void | removeEventFilter (QObject *obj) |
void | setName (const char *name) |
void | setObjectName (const QString &name) |
void | setParent (QObject *parent) |
bool | setProperty (const char *name, const QVariant &value) |
bool | signalsBlocked () const |
int | startTimer (int interval) |
QThread * | thread () const |
Static Public Member Functions | |
static KgpgCore::KgpgItemType | getType (const KgpgCore::KgpgKey *k) |
Static Public Member Functions inherited from QObject | |
bool | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) |
bool | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) |
bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) |
bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method) |
QString | tr (const char *sourceText, const char *disambiguation, int n) |
QString | trUtf8 (const char *sourceText, const char *disambiguation, int n) |
Protected Member Functions | |
QList< KGpgRefNode * > | getRefsOfType (const KgpgCore::KgpgItemType &type) const |
virtual void | readChildren () |
Protected Member Functions inherited from KGpgExpandableNode | |
KGpgExpandableNode (KGpgExpandableNode *parent=NULL) | |
Protected Member Functions inherited from KGpgNode | |
KGpgNode (KGpgExpandableNode *parent) | |
Protected Member Functions inherited from QObject | |
bool | checkConnectArgs (const char *signal, const QObject *object, const char *method) |
virtual void | childEvent (QChildEvent *event) |
virtual void | connectNotify (const char *signal) |
virtual void | customEvent (QEvent *event) |
virtual void | disconnectNotify (const char *signal) |
int | receivers (const char *signal) const |
QObject * | sender () const |
int | senderSignalIndex () const |
virtual void | timerEvent (QTimerEvent *event) |
Protected Attributes | |
QList< KGpgRefNode * > | m_refs |
Protected Attributes inherited from KGpgExpandableNode | |
KGpgNode::List | children |
Protected Attributes inherited from KGpgNode | |
KGpgItemModel * | m_model |
KGpgExpandableNode * | m_parent |
Additional Inherited Members | |
Static Protected Member Functions inherited from QObject | |
QByteArray | normalizeSignalSlot (const char *signalSlot) |
Properties inherited from QObject | |
objectName | |
Detailed Description
A public key with or without corresponding secret key.
Definition at line 33 of file KGpgKeyNode.h.
Member Typedef Documentation
typedef QList<const KGpgKeyNode *> KGpgKeyNode::ConstList |
Definition at line 51 of file KGpgKeyNode.h.
Definition at line 50 of file KGpgKeyNode.h.
Constructor & Destructor Documentation
|
explicit |
Definition at line 33 of file KGpgKeyNode.cpp.
|
virtual |
Definition at line 40 of file KGpgKeyNode.cpp.
Member Function Documentation
void KGpgKeyNode::addRef | ( | KGpgRefNode * | node | ) |
Notify this key that a KGpgRefNode now references this key.
- Parameters
-
node object that takes the reference
Definition at line 211 of file KGpgKeyNode.cpp.
bool KGpgKeyNode::canEncrypt | ( | ) | const |
return if this key can be used for encryption
Definition at line 355 of file KGpgKeyNode.cpp.
bool KGpgKeyNode::compareId | ( | const QString & | other | ) | const |
compare the id of this node to the given other node
- Parameters
-
other key id to compare to
- Returns
- if ids are identical
This handles different length of the id string.
Definition at line 339 of file KGpgKeyNode.cpp.
|
virtual |
Creates a copy of the KgpgKey that belongs to this class.
Definition at line 174 of file KGpgKeyNode.cpp.
void KGpgKeyNode::delRef | ( | KGpgRefNode * | node | ) |
Remove a reference to this object.
- Parameters
-
node node that no longer has the reference
Note that this must not be called as reply when this object emits updated(NULL)
Definition at line 218 of file KGpgKeyNode.cpp.
|
slot |
read all subitems
This will read in all subitems (e.g. subkeys, signatures). When this is done the expanded() signal is emitted. The signal is emitted immediately if the key has been expanded before.
This will not update the child items in case they are already present. Use KGpgItemModel::refreshKey() instead.
Definition at line 361 of file KGpgKeyNode.cpp.
|
signal |
QString KGpgKeyNode::getBeautifiedFingerprint | ( | ) | const |
Print the full key fingerprint with spaces inserted.
For display purposes you normally don't want to print the full fingerprint as is because it's too many hex characters at once. This function returns the fingerprint in the format usually used for printing this out, i.e. with a space after each fourth hex character.
- Returns
- the full fingerprint with spaces inserted
Definition at line 137 of file KGpgKeyNode.cpp.
|
virtual |
Reimplemented from KGpgNode.
Definition at line 149 of file KGpgKeyNode.cpp.
|
virtual |
Reimplemented from KGpgNode.
Definition at line 107 of file KGpgKeyNode.cpp.
|
virtual |
Reimplemented from KGpgNode.
Definition at line 95 of file KGpgKeyNode.cpp.
|
virtual |
Returns the size of the first encryption subkey.
- Returns
- encryption key size in bits
Definition at line 205 of file KGpgKeyNode.cpp.
|
virtual |
Reimplemented from KGpgNode.
Definition at line 101 of file KGpgKeyNode.cpp.
const QString & KGpgKeyNode::getFingerprint | ( | ) | const |
Definition at line 75 of file KGpgKeyNode.cpp.
QList< KGpgGroupMemberNode * > KGpgKeyNode::getGroupRefs | ( | void | ) | const |
returns a list of all group member nodes that reference this key
Definition at line 250 of file KGpgKeyNode.cpp.
QList< KGpgGroupNode * > KGpgKeyNode::getGroups | ( | void | ) | const |
returns a list of all groups this key is member of
Definition at line 226 of file KGpgKeyNode.cpp.
|
virtual |
Reimplemented from KGpgNode.
Definition at line 113 of file KGpgKeyNode.cpp.
const KgpgKey * KGpgKeyNode::getKey | ( | ) | const |
Returns a reference to the key used in this object.
This allows direct access to the values of the key e.g. for KgpgKeyInfo.
Definition at line 193 of file KGpgKeyNode.cpp.
|
virtual |
returns the key node this node belongs to
- Returns
- this node if the node itself is a key or it's parent otherwise
Implements KGpgSignableNode.
Definition at line 119 of file KGpgKeyNode.cpp.
|
virtual |
Implements KGpgSignableNode.
Definition at line 131 of file KGpgKeyNode.cpp.
|
virtual |
Reimplemented from KGpgNode.
Definition at line 89 of file KGpgKeyNode.cpp.
|
protected |
Definition at line 237 of file KGpgKeyNode.cpp.
KGpgSignNode::List KGpgKeyNode::getSignatures | ( | const bool | subkeys | ) | const |
returns a list of signatures to this key
- Parameters
-
subkeys if signatures on subkeys should be included
Definition at line 274 of file KGpgKeyNode.cpp.
|
virtual |
Return the number of signatures of the primary user id.
This is different from the number of children of this node as there is usually at least one subkey and there may also be additional user ids or attributes. This does not count the signatures to those slave objects, only the ones that are direct children of this node.
- Returns
- the number of signatures to the primary user id
Reimplemented from KGpgSignableNode.
Definition at line 166 of file KGpgKeyNode.cpp.
|
virtual |
Returns the size of the signing key.
- Returns
- signing key size in bits
Definition at line 199 of file KGpgKeyNode.cpp.
KGpgSignNode::List KGpgKeyNode::getSignRefs | ( | void | ) | const |
returns a list of all sign nodes that reference this key
Definition at line 261 of file KGpgKeyNode.cpp.
|
virtual |
Returns a string describing the size of this object.
Subclasses may return a value that makes sense for whatever object they represent.
The default implementation returns an empty string.
Reimplemented from KGpgNode.
Definition at line 81 of file KGpgKeyNode.cpp.
|
virtual |
Reimplemented from KGpgNode.
Definition at line 69 of file KGpgKeyNode.cpp.
|
static |
Definition at line 60 of file KGpgKeyNode.cpp.
|
virtual |
Returns the item type of this object.
Since every subclass returns a distinct value you can use the result of this function to decide which cast to take. Note that there are subclasses (KGpgKeyNode, KGpgGroupMemberNode) that can return two different values.
Implements KGpgNode.
Definition at line 48 of file KGpgKeyNode.cpp.
const KGpgSignableNode * KGpgKeyNode::getUid | ( | const unsigned int | index | ) | const |
get the user id or user attribute with the given number
- Parameters
-
index the index of the user id to return
- Returns
- the requested subitem or NULL if that is not present
User ids indexes are 1-based, so 0 is not a valid index. Passing 1 as index will return the object itself, representing the primary user id.
Definition at line 312 of file KGpgKeyNode.cpp.
|
virtual |
check if there are any child nodes
The default implementation returns true if any child nodes were loaded. This may be reimplemented by child classes so they can indicate that there are child nodes before actually loading them.
This method indicates if there are children if this node is expanded. In contrast wasExpanded() will only return true if the child nodes are actually present in memory.
Reimplemented from KGpgExpandableNode.
Definition at line 54 of file KGpgKeyNode.cpp.
bool KGpgKeyNode::isSecret | ( | ) | const |
Return if this key has a private key.
Definition at line 125 of file KGpgKeyNode.cpp.
|
protectedvirtual |
reimplemented in every base class to read in the child data
This allows the child objects to delay the loading of the child objects until they are really needed to avoid time consuming operations for data never used.
Implements KGpgExpandableNode.
Definition at line 155 of file KGpgKeyNode.cpp.
void KGpgKeyNode::setKey | ( | const KgpgCore::KgpgKey & | key | ) |
Replaces the current key information with the new one.
All sub-items (i.e. signatures, user ids ...) will be deleted. This must only be used when the id of both new and old key is the same.
Definition at line 180 of file KGpgKeyNode.cpp.
Member Data Documentation
|
protected |
Definition at line 46 of file KGpgKeyNode.h.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:42:08 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.