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

kmobiletools

sms.h

Go to the documentation of this file.
00001 /***************************************************************************
00002    Copyright (C) 2007
00003    by Marco Gulino <marco@kmobiletools.org>
00004 
00005    This program is free software; you can redistribute it and/or modify
00006    it under the terms of the GNU General Public License as published by
00007    the Free Software Foundation; either version 2 of the License, or
00008    (at your option) any later version.
00009 
00010    This program is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013    GNU General Public License for more details.
00014 
00015    You should have received a copy of the GNU General Public License
00016    along with this program; if not, write to the
00017    Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018    Boston, MA 02110-1301, USA.
00019  ***************************************************************************/
00020 #ifndef SMS_H
00021 #define SMS_H
00022 
00023 #include <libkmobiletools/kmobiletools_export.h>
00024 #include <kmime/kmime_content.h>
00025 #include <kmime/kmime_headers.h>
00026 
00027 #include <QtCore/QObject>
00028 #include <QtCore/QStringList>
00029 #include <kdatetime.h>
00034 class SMSPrivate;
00035 class SenderPrivate;
00036 class DestinationPrivate;
00037 namespace KMobileTools {
00038 typedef QHash<QString,QString> PhoneNumbers;
00039 
00040 class KMOBILETOOLS_EXPORT Sender : public KMime::Headers::Generics::Structured
00041 {
00042 public:
00043     Sender();
00044     virtual ~Sender();
00045     virtual const char *type() const;
00046     virtual void addNumber(const QString &number, const QString &displayname=QString() );
00047     virtual void clear();
00048     virtual bool isEmpty() const;
00049     virtual bool parse(const char *&scursor, const char *const send, bool isCRLF=false);
00050     virtual QByteArray as7BitString(bool withHeaderType=true) const;
00051     PhoneNumbers phoneNumbers() const;
00052 private:
00053     SenderPrivate *const d;
00054 };
00055 class KMOBILETOOLS_EXPORT Destination : public Sender
00056 {
00057 public:
00058     Destination();
00059     virtual const char *type() const;
00060 private:
00061     DestinationPrivate *const d;
00062 };
00063 
00064 class KMOBILETOOLS_EXPORT SMS : public KMime::Content
00065 {
00066 public:
00075     enum MemorySlot { Phone = 0x01, Sim = 0x02, DataCard = 0x04, Unknown = 0x08 };
00076 
00077     Q_DECLARE_FLAGS(MemorySlots, MemorySlot)
00078 
00079     SMS();
00080     KDE_CONSTRUCTOR_DEPRECATED SMS(const QStringList & numbers, const QString & text);
00081     KDE_CONSTRUCTOR_DEPRECATED SMS(const QStringList & numbers, const QString & text, const KDateTime & datetime);
00082 
00083     virtual ~SMS();
00084 
00085     enum SMSType
00086     { Unread=0x1, Read=0x2, Unsent=0x4, Sent=0x8, All=0xA };
00087     static QString SMSTypeString(SMSType smstype);
00088 
00089     static SMSType SMSIntType (const QString& type);
00090 
00091     bool isIncoming() const;
00092     void setText(const QString & text);
00093     virtual QString getText() const;
00094     virtual QStringList getMultiText() const;
00095     static QStringList getMultiText(const QString&);
00096     static int getMultiTextCount(const QString&);
00097     static int getMultiTextCount(int);
00098 
00099     virtual KDE_DEPRECATED QString getFrom() const;
00100     virtual QStringList getTo() const;
00101     void KDE_DEPRECATED setNumbers(const QStringList & numbers);
00102     virtual QString getDate() const;
00103     virtual KDateTime getDateTime() const;
00104     virtual void setRawSlot(const QString &rawSlot);
00105     virtual QString rawSlot() const;
00106     void setDateTime(const KDateTime & datetime);
00107 
00108     void KDE_DEPRECATED setFolder( int newFolder );
00109     int KDE_DEPRECATED  folder() const;
00110     QList<int> *idList();
00111 //     void setId( int newId ) { i_id = newId; }; // krazy:exclude=inline
00112 
00113     void KDE_DEPRECATED setSlot( int newSlot );
00114     SMSType type() const;
00115     void setType( SMSType newType );
00116     int slot() const;
00117     QString uid() const;
00118     bool operator ==(SMS* compSMS);
00119     bool unread() const;
00120     void setUnread(bool unread);
00121     bool writeToSlot( const QString &slotDir);
00122     bool exportMD(const QString &dir);
00123     bool exportCSV(const QString &filename);
00124     bool writeToSlotCSV( const QString &filename);
00125 
00126     // Headers
00127     KMime::Headers::Date *date() const;
00128    Sender *sender() const;
00129    Destination *destination()   const;
00130 
00131    void setSender(const QString& number, const QString &displayname=QString() );
00132    void addDestination(const QString& number, const QString &displayname=QString() );
00133 
00134 protected:
00135     virtual QByteArray assembleHeaders();
00136 
00137 private:
00138     SMSPrivate *const d;
00140 /*public Q_SLOTS:
00141 
00142 Q_SIGNALS:
00143     void updated();*/
00144 };
00145 }
00146 
00147 Q_DECLARE_OPERATORS_FOR_FLAGS(KMobileTools::SMS::MemorySlots)
00148 
00149 #endif

kmobiletools

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

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
  • 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