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

kmobiletools

at_jobs.h

Go to the documentation of this file.
00001 /***************************************************************************
00002    Copyright (C) 2007
00003    by Marco Gulino <marco@kmobiletools.org>,
00004    Alexander Rensmann <zerraxys@gmx.net>
00005 
00006    This program is free software; you can redistribute it and/or modify
00007    it under the terms of the GNU General Public License as published by
00008    the Free Software Foundation; either version 2 of the License, or
00009    (at your option) any later version.
00010 
00011    This program is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014    GNU General Public License for more details.
00015 
00016    You should have received a copy of the GNU General Public License
00017    along with this program; if not, write to the
00018    Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019    Boston, MA 02110-1301, USA.
00020  ***************************************************************************/
00021 
00022 #ifndef ATJOBSS_H
00023 #define ATJOBSS_H
00024 
00025 #include <libkmobiletools/enginedata.h>
00026 #include <libkmobiletools/engine.h>
00027 #include <libkmobiletools/sms.h>
00028 
00029 #include "sms_defs.h"
00030 
00031 #include <q3ptrlist.h>
00032 #include <kabc/addressee.h>
00033 #include <q3ptrvector.h>
00034 #include "atabilities.h"
00035 
00036 #define odd(a) ( a % 2 == 1 )
00037 #define even(a) ( a % 2 == 0 )
00038 
00039 
00040 
00041 namespace KMobileTools{
00042     class SerialManager;
00043 }
00044 
00045 class QStringList;
00046 class AT_Engine;
00047 
00050 class kmobiletoolsATJob : public KMobileTools::Job
00051 {
00052     public:
00053       explicit kmobiletoolsATJob(KMobileTools::SerialManager *device, AT_Engine* parent = 0);
00054       kmobiletoolsATJob(KMobileTools::Job *pjob, KMobileTools::SerialManager *device, AT_Engine* parent = 0);
00059         static QStringList formatBuffer( QString buffer );
00063         static QStringList parseList( QString list, char begins='C' );
00068         static QStringList parseMultiList( QString list );
00071         QString decodeString( const QString &text );
00074         QString encodeString( const QString &text );
00075 
00076         static QString parseInfo( const QString &buffer );
00077     protected:
00078         KMobileTools::SerialManager *p_device;
00079         AT_Engine *engine;
00080         int i_retry;
00081 };
00082 
00083 class initPhoneJob : public kmobiletoolsATJob
00084 {
00085     public:
00086       explicit initPhoneJob( KMobileTools::SerialManager *device, AT_Engine* parent = 0);
00087         JobType type()            { return KMobileTools::Job::initPhone; }
00088     protected:
00089         void run ();
00090 };
00091 
00092 class PollStatus : public kmobiletoolsATJob
00093 {
00094     public:
00095       PollStatus (KMobileTools::Job *pjob, KMobileTools::SerialManager *device, AT_Engine* parent = 0 );
00096         int phoneCharge()     { return i_charge; }
00097         KMobileTools::EngineData::ChargeType phoneChargeType() {
00098             return m_chargeType;
00099         }
00100         int phoneSignal()     { return i_signal; }
00101         bool ringing()        { return b_calling; }
00102         JobType type()            { return KMobileTools::Job::pollStatus; }
00103     protected:
00104         void run ();
00105     private:
00106         int i_charge, i_signal;
00107         KMobileTools::EngineData::ChargeType m_chargeType;
00108         bool b_calling;
00109 };
00110 
00111 class FetchPhoneInfos : public kmobiletoolsATJob
00112 {
00113     public:
00114       FetchPhoneInfos (KMobileTools::Job *pjob, KMobileTools::SerialManager *device, AT_Engine* parent = 0 );
00115       explicit FetchPhoneInfos (KMobileTools::SerialManager *device, AT_Engine* parent = 0 );
00116       QString rawManufacturer() const { return s_manufacturer; }
00117         QString model() const { return s_model; }
00118         QString imei() const { return s_imei; }
00119         QString revision() const { return s_revision; }
00120         QString smsCenter() const { return s_smscenter; }
00121         JobType type()            { return KMobileTools::Job::fetchPhoneInfos; }
00122 
00123     protected:
00124         void run () ;
00125     private:
00126         QString s_manufacturer, s_model, s_imei, s_revision, s_smscenter;
00127 };
00128 
00135 class SelectCharacterSet : public kmobiletoolsATJob
00136 {
00137     public:
00138       SelectCharacterSet( KMobileTools::Job *pjob, const QString &characterSet, KMobileTools::SerialManager *device, AT_Engine* parent = 0);
00139         JobType type()            { return KMobileTools::Job::selectCharacterSet; }
00140     protected:
00141         void run ();
00142         QString characterSet;
00143 };
00144 
00150 class SelectSMSSlot : public kmobiletoolsATJob
00151 {
00152     public:
00153       SelectSMSSlot( KMobileTools::Job *pjob, QString slot, KMobileTools::SerialManager *device, AT_Engine* parent = 0);
00154         JobType type()            { return KMobileTools::Job::selectSMSSlot; }
00155         const QString getReadSlot() { return readSlot;}
00156         bool done() { return b_done;}
00157     protected:
00158         void run ();
00159         QString readSlot;
00160         bool b_done;
00161 };
00162 
00165 class TestPhoneFeatures : public kmobiletoolsATJob
00166 {
00167     public:
00168       TestPhoneFeatures (KMobileTools::Job *pjob, KMobileTools::SerialManager *device, AT_Engine* parent);
00169       TestPhoneFeatures (KMobileTools::SerialManager *device, AT_Engine* parent);
00170       JobType type()            { return KMobileTools::Job::testPhoneFeatures; }
00171         ATAbilities &getAbilities() { return abilities; }
00172     protected:
00173         void run ();
00174         ATAbilities abilities;
00175 };
00176 
00184 class SyncDateTime : public kmobiletoolsATJob
00185 {
00186     public:
00187       SyncDateTime( KMobileTools::Job *pjob, KMobileTools::SerialManager *device, AT_Engine* parent = 0 );
00188         JobType type()            { return KMobileTools::Job::syncDateTimeJob; }
00189     protected:
00190         void run ();
00191 };
00192 
00193 #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
  •   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