• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.8.5 API Reference
  • KDE Home
  • Contact Us
 

KTNEF Library

ktnefattach.cpp
Go to the documentation of this file.
00001 /*
00002     ktnefattach.cpp
00003 
00004     Copyright (C) 2002 Michael Goffioul <kdeprint@swing.be>
00005 
00006     This file is part of KTNEF, the KDE TNEF support library/program.
00007 
00008     This library is free software; you can redistribute it and/or
00009     modify it under the terms of the GNU Library General Public
00010     License as published by the Free Software Foundation; either
00011     version 2 of the License, or (at your option) any later version.
00012 
00013     This library is distributed in the hope that it will be useful,
00014     but WITHOUT ANY WARRANTY; without even the implied warranty of
00015     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016     Library General Public License for more details.
00017 
00018     You should have received a copy of the GNU Library General Public License
00019     along with this library; see the file COPYING.LIB.  If not, write to
00020     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00021     Boston, MA 02110-1301, USA.
00022  */
00031 #include "ktnefattach.h"
00032 #include "ktnefproperty.h"
00033 
00034 using namespace KTnef;
00035 
00040 //@cond PRIVATE
00041 class KTnef::KTNEFAttach::AttachPrivate
00042 {
00043   public:
00044     int     state_;
00045     int     size_;
00046     int     offset_;
00047     int     displaysize_;
00048     QString name_;
00049     int     index_;
00050     QString filename_;
00051     QString displayname_;
00052     QString mimetag_;
00053     QString extension_;
00054 };
00055 //@endcond
00056 
00057 KTNEFAttach::KTNEFAttach() : d( new KTnef::KTNEFAttach::AttachPrivate )
00058 {
00059   d->state_ = Unparsed;
00060   d->offset_ = -1;
00061   d->size_ = 0;
00062   d->displaysize_ = 0;
00063   d->index_ = -1;
00064 }
00065 
00066 KTNEFAttach::~KTNEFAttach()
00067 {
00068   delete d;
00069 }
00070 
00071 void KTNEFAttach::setTitleParsed()
00072 {
00073   d->state_ |= TitleParsed;
00074 }
00075 
00076 void KTNEFAttach::setDataParsed()
00077 {
00078   d->state_ |= DataParsed;
00079 }
00080 
00081 void KTNEFAttach::unsetDataParser()
00082 {
00083   d->state_ = ( d->state_ & ~DataParsed );
00084 }
00085 
00086 void KTNEFAttach::setInfoParsed()
00087 {
00088   d->state_ |= InfoParsed;
00089 }
00090 
00091 bool KTNEFAttach::titleParsed() const
00092 {
00093   return d->state_ & TitleParsed;
00094 }
00095 
00096 bool KTNEFAttach::dataParsed() const
00097 {
00098   return d->state_ & DataParsed;
00099 }
00100 
00101 bool KTNEFAttach::infoParsed() const
00102 {
00103   return d->state_ & InfoParsed;
00104 }
00105 
00106 bool KTNEFAttach::checkState( int state ) const
00107 {
00108   return d->state_ & state;
00109 }
00110 
00111 int KTNEFAttach::offset() const
00112 {
00113   return d->offset_;
00114 }
00115 
00116 void KTNEFAttach::setOffset( int n )
00117 {
00118   setDataParsed();
00119   d->offset_ = n;
00120 }
00121 
00122 int KTNEFAttach::size() const
00123 {
00124   return d->size_;
00125 }
00126 
00127 void KTNEFAttach::setSize( int s )
00128 {
00129   d->size_ = s;
00130 }
00131 
00132 int KTNEFAttach::displaySize() const
00133 {
00134   return d->displaysize_;
00135 }
00136 
00137 void KTNEFAttach::setDisplaySize( int s )
00138 {
00139   d->displaysize_ = s;
00140 }
00141 
00142 QString KTNEFAttach::name() const
00143 {
00144   return d->name_;
00145 }
00146 
00147 void KTNEFAttach::setName( const QString &str )
00148 {
00149   setTitleParsed();
00150   d->name_ = str;
00151 }
00152 
00153 int KTNEFAttach::index() const
00154 {
00155   return d->index_;
00156 }
00157 
00158 void KTNEFAttach::setIndex( int i )
00159 {
00160   setInfoParsed();
00161   d->index_ = i;
00162 }
00163 
00164 QString KTNEFAttach::fileName() const
00165 {
00166   return d->filename_;
00167 }
00168 
00169 void KTNEFAttach::setFileName( const QString &str )
00170 {
00171   d->filename_ = str;
00172 }
00173 
00174 QString KTNEFAttach::displayName() const
00175 {
00176   return d->displayname_;
00177 }
00178 
00179 void KTNEFAttach::setDisplayName( const QString &str )
00180 {
00181   d->displayname_ = str;
00182 }
00183 
00184 QString KTNEFAttach::mimeTag() const
00185 {
00186   return d->mimetag_;
00187 }
00188 
00189 void KTNEFAttach::setMimeTag( const QString &str )
00190 {
00191   d->mimetag_ = str;
00192 }
00193 
00194 QString KTNEFAttach::extension() const
00195 {
00196   return d->extension_;
00197 }
00198 
00199 void KTNEFAttach::setExtension( const QString &str )
00200 {
00201   d->extension_ = str;
00202 }
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Thu Aug 2 2012 15:26:14 by doxygen 1.7.5 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KTNEF Library

Skip menu "KTNEF Library"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdepimlibs-4.8.5 API Reference

Skip menu "kdepimlibs-4.8.5 API Reference"
  • akonadi
  •   contact
  •   kmime
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  •   richtextbuilders
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
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