author | ulf69 <ulf69> | 2004-08-10 19:37:46 (UTC) |
---|---|---|
committer | ulf69 <ulf69> | 2004-08-10 19:37:46 (UTC) |
commit | 2666ac52add8d79e34a04a64e4d5f092dd3d3d7e (patch) (side-by-side diff) | |
tree | 268ecd1ce5d898f7bd6ce82f5d023b161dc38892 /libkdepim/externalapphandler.h | |
parent | 9f73ddc03d2b02934906193cf8db5ff0813fce0b (diff) | |
download | kdepimpi-2666ac52add8d79e34a04a64e4d5f092dd3d3d7e.zip kdepimpi-2666ac52add8d79e34a04a64e4d5f092dd3d3d7e.tar.gz kdepimpi-2666ac52add8d79e34a04a64e4d5f092dd3d3d7e.tar.bz2 |
added methods to check if a certain application is available
Diffstat (limited to 'libkdepim/externalapphandler.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libkdepim/externalapphandler.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/libkdepim/externalapphandler.h b/libkdepim/externalapphandler.h index 3ecf1b1..efcdd89 100644 --- a/libkdepim/externalapphandler.h +++ b/libkdepim/externalapphandler.h @@ -30,91 +30,110 @@ $Id$ #ifndef EXTERNALAPPHANDLER_H #define EXTERNALAPPHANDLER_H #include <qlist.h> class QCopEnvelope; class ExternalAppHandler; class DefaultAppItem { public: DefaultAppItem(int type, int id, const QString& label, const QString& channel, const QString& message, const QString& parameters, const QString& message2, const QString& parameters2) : _type(type), _id(id), _label(label), _channel(channel), _message(message), _parameters(parameters), _message2(message2), _parameters2(parameters2) { } DefaultAppItem() { } public: int _type; int _id; QString _label; QString _channel; QString _message; QString _parameters; // a list of parameters in stringrepresentation. Delimiter is ; QString _message2; QString _parameters2; // a list of parameters in stringrepresentation. Delimiter is ; }; class ExternalAppHandler { public: virtual ~ExternalAppHandler(); static ExternalAppHandler *instance(); enum Types { EMAIL = 0, PHONE = 1, SMS = 2, FAX = 3, PAGER = 4 }; + enum Availability { + UNDEFINED = -1, + UNAVAILABLE = 0, + AVAILABLE = 1 + }; + //calls the emailapplication with a number of attachments that need to be send bool mailAttachments( const QString& urls ); //calls the emailapplication and creates a mail with parameter emails as recipients bool mailToContacts( const QString& emails ); //calls the phoneapplication with the number bool callByPhone( const QString& phonenumber ); //calls the smsapplication with the number bool callBySMS( const QString& phonenumber ); //calls the pagerapplication with the number bool callByPager( const QString& pagernumber ); //calls the faxapplication with the number bool callByFax( const QString& faxnumber ); + bool isEmailAppAvailable(); + bool isSMSAppAvailable(); + bool isPhoneAppAvailable(); + bool isFaxAppAvailable(); + bool isPagerAppAvailable(); + + //loadConfig clears the cache and checks again if the applications are available or not void loadConfig(); QList<DefaultAppItem> getAvailableDefaultItems(Types); DefaultAppItem* getDefaultItem(Types, int); private: ExternalAppHandler(); QList<DefaultAppItem> mDefaultItems; + Availability mEmailAppAvailable; + Availability mPhoneAppAvailable; + Availability mFaxAppAvailable; + Availability mSMSAppAvailable; + Availability mPagerAppAvailable; + void addDefaultAppItem(Types type, int id, const QString& label, const QString& channel, const QString& message, const QString& parameters, const QString& message2, const QString& parameters2); QString& translateMessage(QString& message, const QString& emails) const; void passParameter(QCopEnvelope* e, const QString& parameters, const QString& param1) const; static ExternalAppHandler *sInstance; }; #endif |