• Skip to content
  • Skip to link menu
KDE 4.3 API Reference
  • KDE API Reference
  • KDE-PIM Libraries
  • Sitemap
  • Contact Us
 

kpimidentities

signature.h

00001 /*
00002     Copyright (c) 2002-2004 Marc Mutz <mutz@kde.org>
00003     Copyright (c) 2007 Tom Albers <tomalbers@kde.nl>
00004     Author: Stefan Taferner <taferner@kde.org>
00005 
00006     This library is free software; you can redistribute it and/or modify it
00007     under the terms of the GNU Library General Public License as published by
00008     the Free Software Foundation; either version 2 of the License, or (at your
00009     option) any later version.
00010 
00011     This library is distributed in the hope that it will be useful, but WITHOUT
00012     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00013     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00014     License for more details.
00015 
00016     You should have received a copy of the GNU Library General Public License
00017     along with this library; see the file COPYING.LIB.  If not, write to the
00018     Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00019     02110-1301, USA.
00020 */
00021 
00022 #ifndef KPIMIDENTITIES_SIGNATURE_H
00023 #define KPIMIDENTITIES_SIGNATURE_H
00024 
00025 #include "kpimidentities_export.h"
00026 
00027 #include <kdemacros.h>
00028 
00029 #include <QtCore/QString>
00030 #include <QtCore/QStringList>
00031 #include <QtCore/QList>
00032 #include <QtCore/QHash>
00033 #include <QtCore/QVariant>
00034 
00035 namespace KPIMIdentities
00036 {
00037   class Signature;
00038 }
00039 class KConfigGroup;
00040 class KRichTextEdit;
00041 
00042 namespace KPIMIdentities
00043 {
00044 
00045   KPIMIDENTITIES_EXPORT QDataStream &operator<<
00046   ( QDataStream &stream, const KPIMIdentities::Signature &sig );
00047   KPIMIDENTITIES_EXPORT QDataStream &operator>>
00048   ( QDataStream &stream, KPIMIdentities::Signature &sig );
00049 
00054   class KPIMIDENTITIES_EXPORT Signature
00055   {
00056       friend class Identity;
00057 
00058       friend KPIMIDENTITIES_EXPORT QDataStream &operator<< ( QDataStream &stream, const Signature &sig );
00059       friend KPIMIDENTITIES_EXPORT QDataStream &operator>> ( QDataStream &stream, Signature &sig );
00060 
00061     public:
00063       enum Type {
00064         Disabled = 0,
00065         Inlined = 1,
00066         FromFile = 2,
00067         FromCommand = 3
00068       };
00069 
00074       enum Placement {
00075         Start,                   
00076         End,                     
00077         AtCursor                 
00078       };
00079 
00081       bool operator== ( const Signature &other ) const;
00082 
00084       Signature();
00086       Signature( const QString &text );
00088       Signature( const QString &url, bool isExecutable );
00089 
00091       QString rawText( bool *ok=0 ) const;
00092 
00095       QString withSeparator( bool *ok=0 ) const;
00096 
00099       void setText( const QString &text );
00100       QString text() const;
00101 
00104       void setUrl( const QString &url, bool isExecutable=false );
00105       QString url() const;
00106 
00108       Type type() const;
00109       void setType( Type type );
00110 
00116       void setInlinedHtml( bool isHtml );
00117 
00122       bool isInlinedHtml() const;
00123 
00124 
00143       void insertIntoTextEdit( KRichTextEdit *textEdit,
00144                                Placement placement = End, bool addSeparator = true );
00145 
00167       static void insertPlainSignatureIntoTextEdit( const QString &signature,
00168                                                     KRichTextEdit *textEdit,
00169                                                     Placement placement = End,
00170                                                     bool isHtml = false );
00171 
00172     protected:
00173       void writeConfig( KConfigGroup &config ) const;
00174       void readConfig( const KConfigGroup &config );
00175 
00176     private:
00177       QString textFromFile( bool *ok ) const;
00178       QString textFromCommand( bool *ok ) const;
00179 
00180       QString mUrl;
00181       QString mText;
00182       Type    mType;
00183       bool mInlinedHtml;
00184   };
00185 
00186 }
00187 
00188 #endif /*kpim_signature_h*/

kpimidentities

Skip menu "kpimidentities"
  • Main Page
  • Alphabetical List
  • Class List
  • File List
  • Class Members

KDE-PIM Libraries

Skip menu "KDE-PIM Libraries"
  • akonadi
  • kabc
  • kblog
  • kcal
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  • kldap
  • kmime
  • kpimidentities
  • kpimtextedit
  •   richtextbuilders
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Generated for KDE-PIM Libraries by doxygen 1.5.8
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