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

libkleo

dn.h

Go to the documentation of this file.
00001 /*
00002     dn.h
00003 
00004     This file is part of libkleopatra, the KDE keymanagement library
00005     Copyright (c) 2004 Klarälvdalens Datakonsult AB
00006 
00007     Libkleopatra is free software; you can redistribute it and/or
00008     modify it under the terms of the GNU General Public License as
00009     published by the Free Software Foundation; either version 2 of the
00010     License, or (at your option) any later version.
00011 
00012     Libkleopatra is distributed in the hope that it will be useful,
00013     but WITHOUT ANY WARRANTY; without even the implied warranty of
00014     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015     General Public License for more details.
00016 
00017     You should have received a copy of the GNU General Public License
00018     along with this program; if not, write to the Free Software
00019     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00020 
00021     In addition, as a special exception, the copyright holders give
00022     permission to link the code of this program with any edition of
00023     the Qt library by Trolltech AS, Norway (or with modified versions
00024     of Qt that use the same license as Qt), and distribute linked
00025     combinations including the two.  You must obey the GNU General
00026     Public License in all respects for all of the code used other than
00027     Qt.  If you modify this file, you may extend this exception to
00028     your version of the file, but you are not obligated to do so.  If
00029     you do not wish to do so, delete this exception statement from
00030     your version.
00031 */
00032 
00033 #ifndef __KLEO_DN_H__
00034 #define __KLEO_DN_H__
00035 
00036 #include "kleo/kleo_export.h"
00037 
00038 #include <QtCore/QString>
00039 #include <QtCore/QVector>
00040 
00041 class QStringList;
00042 class QWidget;
00043 
00044 namespace Kleo {
00045   class DNAttributeOrderConfigWidget;
00046 }
00047 
00048 namespace Kleo {
00049 
00053   class KLEO_EXPORT DNAttributeMapper {
00054     DNAttributeMapper();
00055     ~DNAttributeMapper();
00056   public:
00057     static const DNAttributeMapper * instance();
00058 
00059     QString name2label( const QString & s ) const;
00060     QStringList names() const;
00061 
00062     const QStringList & attributeOrder() const;
00063 
00064     void setAttributeOrder( const QStringList & order );
00065 
00066     DNAttributeOrderConfigWidget * configWidget( QWidget * parent=0 ) const;
00067 
00068   private:
00069     class Private;
00070     Private * d;
00071     static DNAttributeMapper * mSelf;
00072   };
00073 
00077   class KLEO_EXPORT DN  {
00078   public:
00079     class Attribute;
00080     typedef QVector<Attribute> AttributeList;
00081     typedef AttributeList::const_iterator const_iterator;
00082 
00083     DN();
00084     explicit DN( const QString & dn );
00085     explicit DN( const char * utf8DN );
00086     DN( const DN & other );
00087     ~DN();
00088 
00089     const DN & operator=( const DN & other );
00090 
00092     static QString escape( const QString & value );
00093 
00096     QString prettyDN() const;
00098     QString dn() const;
00099 
00100     QString operator[]( const QString & attr ) const;
00101 
00102     void append( const Attribute & attr );
00103 
00104     const_iterator begin() const;
00105     const_iterator end() const;
00106 
00107   private:
00108     void detach();
00109   private:
00110     class Private;
00111     Private * d;
00112   };
00113 
00114   class KLEO_EXPORT DN::Attribute {
00115   public:
00116     typedef DN::AttributeList List;
00117 
00118     explicit Attribute( const QString & name=QString(), const QString & value=QString() )
00119       : mName( name.toUpper() ), mValue( value ) {}
00120     Attribute( const Attribute & other )
00121       : mName( other.name() ), mValue( other.value() ) {}
00122 
00123     const Attribute & operator=( const Attribute & other ) {
00124       if ( this != &other ) {
00125     mName = other.name();
00126     mValue = other.value();
00127       }
00128       return *this;
00129     }
00130 
00131     const QString & name() const { return mName; }
00132     const QString & value() const { return mValue; }
00133 
00134     void setValue( const QString & value ) { mValue = value; }
00135     
00136   private:
00137     QString mName;
00138     QString mValue;
00139   };
00140 
00141 }
00142 
00143 #endif // __KLEO_DN_H__

libkleo

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

kdepim

Skip menu "kdepim"
  • akonadi
  •   clients
  •   kabc
  •   kcal
  •   kcm
  • akregator
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt
  • kdgantt1
  • kjots
  • kleopatra
  • kmail
  • kmobiletools
  • knode
  • knotes
  • kontact
  • kontactinterfaces
  • korganizer
  •   korgac
  • kpilot
  • ktimetracker
  •   doc
  • libkdepim
  • libkholidays
  • libkleo
  • libkpgp
  • maildir
Generated for kdepim by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal