Libkleo
9#include "dnattributes.h"
11#include <libkleo_debug.h>
13#include <KLazyLocalizedString>
22 QStringLiteral(
"_X_"),
28class DNAttributeOrderStore
30 DNAttributeOrderStore()
31 : mAttributeOrder{defaultOrder}
36 static DNAttributeOrderStore *instance()
38 static DNAttributeOrderStore *self =
new DNAttributeOrderStore();
42 const QStringList &attributeOrder()
const
44 return mAttributeOrder.empty() ? defaultOrder : mAttributeOrder;
47 void setAttributeOrder(
const QStringList &order)
49 mAttributeOrder = order;
53 QStringList mAttributeOrder;
61 {QStringLiteral(
"CN"), kli18n(
"Common name") },
62 {QStringLiteral(
"SN"), kli18n(
"Surname") },
63 {QStringLiteral(
"GN"), kli18n(
"Given name") },
64 {QStringLiteral(
"L"), kli18n(
"Location") },
65 {QStringLiteral(
"T"), kli18n(
"Title") },
66 {QStringLiteral(
"OU"), kli18n(
"Organizational unit")},
67 {QStringLiteral(
"O"), kli18n(
"Organization") },
68 {QStringLiteral(
"PC"), kli18n(
"Postal code") },
69 {QStringLiteral(
"C"), kli18n(
"Country code") },
70 {QStringLiteral(
"SP"), kli18n(
"State or province") },
71 {QStringLiteral(
"DC"), kli18n(
"Domain component") },
72 {QStringLiteral(
"BC"), kli18n(
"Business category") },
73 {QStringLiteral(
"EMAIL"), kli18n(
"Email address") },
74 {QStringLiteral(
"MAIL"), kli18n(
"Mail address") },
75 {QStringLiteral(
"MOBILE"), kli18n(
"Mobile phone number")},
76 {QStringLiteral(
"TEL"), kli18n(
"Telephone number") },
77 {QStringLiteral(
"FAX"), kli18n(
"Fax number") },
78 {QStringLiteral(
"STREET"), kli18n(
"Street address") },
79 {QStringLiteral(
"UID"), kli18n(
"Unique ID") },
87 return DNAttributeOrderStore::instance()->attributeOrder();
91void Kleo::DNAttributes::setOrder(
const QStringList &order)
93 DNAttributeOrderStore::instance()->setAttributeOrder(order);
99 return ::defaultOrder;
104 return attributeNamesAndLabels.keys();
109 const QString key{name.trimmed().toUpper()};
110 if (DNAttributes::names().contains(key)) {
111 return attributeNamesAndLabels.value(key).toString();
113 qCWarning(LIBKLEO_LOG) <<
"Attribute " << key <<
" doesn't exit. Bug ?";
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Apr 4 2025 12:04:00 by
doxygen 1.13.2 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.