• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepim API Reference
  • KDE Home
  • Contact Us
 

libkleo

  • sources
  • kde-4.12
  • kdepim
  • libkleo
  • kleo
dn.h
Go to the documentation of this file.
1 /*
2  dn.h
3 
4  This file is part of libkleopatra, the KDE keymanagement library
5  Copyright (c) 2004 Klarälvdalens Datakonsult AB
6 
7  Libkleopatra is free software; you can redistribute it and/or
8  modify it under the terms of the GNU General Public License as
9  published by the Free Software Foundation; either version 2 of the
10  License, or (at your option) any later version.
11 
12  Libkleopatra is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 
21  In addition, as a special exception, the copyright holders give
22  permission to link the code of this program with any edition of
23  the Qt library by Trolltech AS, Norway (or with modified versions
24  of Qt that use the same license as Qt), and distribute linked
25  combinations including the two. You must obey the GNU General
26  Public License in all respects for all of the code used other than
27  Qt. If you modify this file, you may extend this exception to
28  your version of the file, but you are not obligated to do so. If
29  you do not wish to do so, delete this exception statement from
30  your version.
31 */
32 
33 #ifndef __KLEO_DN_H__
34 #define __KLEO_DN_H__
35 
36 #include "kleo/kleo_export.h"
37 
38 #include <QtCore/QString>
39 #include <QtCore/QVector>
40 
41 class QStringList;
42 class QWidget;
43 
44 namespace Kleo {
45  class DNAttributeOrderConfigWidget;
46 }
47 
48 namespace Kleo {
49 
53  class KLEO_EXPORT DNAttributeMapper {
54  DNAttributeMapper();
55  ~DNAttributeMapper();
56  public:
57  static const DNAttributeMapper * instance();
58 
59  QString name2label( const QString & s ) const;
60  QStringList names() const;
61 
62  const QStringList & attributeOrder() const;
63 
64  void setAttributeOrder( const QStringList & order );
65 
66  DNAttributeOrderConfigWidget * configWidget( QWidget * parent=0 ) const;
67 
68  private:
69  class Private;
70  Private * d;
71  static DNAttributeMapper * mSelf;
72  };
73 
77  class KLEO_EXPORT DN {
78  public:
79  class Attribute;
80  typedef QVector<Attribute> AttributeList;
81  typedef AttributeList::const_iterator const_iterator;
82 
83  DN();
84  explicit DN( const QString & dn );
85  explicit DN( const char * utf8DN );
86  DN( const DN & other );
87  ~DN();
88 
89  const DN & operator=( const DN & other );
90 
92  static QString escape( const QString & value );
93 
96  QString prettyDN() const;
98  QString dn() const;
103  QString dn( const QString & sep ) const;
104 
105  QString operator[]( const QString & attr ) const;
106 
107  void append( const Attribute & attr );
108 
109  const_iterator begin() const;
110  const_iterator end() const;
111 
112  private:
113  void detach();
114  private:
115  class Private;
116  Private * d;
117  };
118 
119  class KLEO_EXPORT DN::Attribute {
120  public:
121  typedef DN::AttributeList List;
122 
123  explicit Attribute( const QString & name=QString(), const QString & value=QString() )
124  : mName( name.toUpper() ), mValue( value ) {}
125  Attribute( const Attribute & other )
126  : mName( other.name() ), mValue( other.value() ) {}
127 
128  const Attribute & operator=( const Attribute & other ) {
129  if ( this != &other ) {
130  mName = other.name();
131  mValue = other.value();
132  }
133  return *this;
134  }
135 
136  const QString & name() const { return mName; }
137  const QString & value() const { return mValue; }
138 
139  void setValue( const QString & value ) { mValue = value; }
140 
141  private:
142  QString mName;
143  QString mValue;
144  };
145 
146 }
147 
148 #endif // __KLEO_DN_H__
name
const char * name
Definition: kconfigbasedkeyfilter.cpp:124
Attribute
QWidget
Kleo::DN::operator=
const Attribute & operator=(const Attribute &other)
Definition: dn.h:128
QString
Kleo::DNAttributeMapper
DN Attribute mapper.
Definition: dn.h:53
Kleo::DN::value
const QString & value() const
Definition: dn.h:137
Kleo::DN::AttributeList
QVector< Attribute > AttributeList
Definition: dn.h:79
Kleo::DNAttributeOrderConfigWidget
Definition: dnattributeorderconfigwidget.h:48
KLEO_EXPORT
#define KLEO_EXPORT
Definition: kleo_export.h:41
Kleo::DN::List
DN::AttributeList List
Definition: dn.h:121
Kleo::DN
DN parser and reorderer.
Definition: dn.h:77
Kleo::DN::Attribute
Attribute(const Attribute &other)
Definition: dn.h:125
kleo_export.h
Kleo::DN::setValue
void setValue(const QString &value)
Definition: dn.h:139
Kleo::DN::Attribute
Attribute(const QString &name=QString(), const QString &value=QString())
Definition: dn.h:123
Kleo::DN::name
const QString & name() const
Definition: dn.h:136
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:57:48 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

libkleo

Skip menu "libkleo"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal