summaryrefslogtreecommitdiffabout
path: root/kmicromail/libmailwrapper/settings.h
authorzautrix <zautrix>2004-07-03 16:33:12 (UTC)
committer zautrix <zautrix>2004-07-03 16:33:12 (UTC)
commite3b89230f065c48c84b48c88edb6eb088374c487 (patch) (side-by-side diff)
tree162ea2ef909a6f82ccfcedf45d80d6c821174912 /kmicromail/libmailwrapper/settings.h
parent2dd6ac0b2d24c91d35ce674a6c26351352df2b15 (diff)
downloadkdepimpi-e3b89230f065c48c84b48c88edb6eb088374c487.zip
kdepimpi-e3b89230f065c48c84b48c88edb6eb088374c487.tar.gz
kdepimpi-e3b89230f065c48c84b48c88edb6eb088374c487.tar.bz2
Initial revision
Diffstat (limited to 'kmicromail/libmailwrapper/settings.h') (more/less context) (ignore whitespace changes)
-rw-r--r--kmicromail/libmailwrapper/settings.h164
1 files changed, 164 insertions, 0 deletions
diff --git a/kmicromail/libmailwrapper/settings.h b/kmicromail/libmailwrapper/settings.h
new file mode 100644
index 0000000..ba3ec89
--- a/dev/null
+++ b/kmicromail/libmailwrapper/settings.h
@@ -0,0 +1,164 @@
+#ifndef SETTINGS_H
+#define SETTINGS_H
+
+#include "maildefines.h"
+
+/* OPIE */
+
+/* QT */
+#include <qobject.h>
+#include <qlist.h>
+
+class Account
+{
+
+public:
+ Account();
+ virtual ~Account() {}
+
+ void remove();
+ void setAccountName( QString name ) { accountName = name; }
+ const QString&getAccountName()const{ return accountName; }
+ MAILLIB::ATYPE getType()const{ return type; }
+
+ void setServer(const QString&str){ server = str; }
+ const QString&getServer()const{ return server; }
+
+ void setPort(const QString&str) { port = str; }
+ const QString&getPort()const{ return port; }
+
+ void setUser(const QString&str){ user = str; }
+ const QString&getUser()const{ return user; }
+
+ void setPassword(const QString&str) { password = str; }
+ const QString&getPassword()const { return password; }
+
+ void setSSL( bool b ) { ssl = b; }
+ bool getSSL() { return ssl; }
+
+ void setConnectionType( int x ) { connectionType = x; }
+ int ConnectionType() { return connectionType; }
+
+
+ void setOffline(bool b) {offline = b;}
+ bool getOffline()const{return offline;}
+
+ virtual QString getFileName() { return accountName; }
+ virtual void read() { ; }
+ virtual void save() { ; }
+
+protected:
+ QString accountName, server, port, user, password;
+ bool ssl;
+ int connectionType;
+ bool offline;
+ MAILLIB::ATYPE type;
+};
+
+class IMAPaccount : public Account
+{
+
+public:
+ IMAPaccount();
+ IMAPaccount( QString filename );
+
+ static QString getUniqueFileName();
+
+ virtual void read();
+ virtual void save();
+ virtual QString getFileName();
+
+ void setPrefix(const QString&str) {prefix=str;}
+ const QString&getPrefix()const{return prefix;}
+
+private:
+ QString file,prefix;
+
+};
+
+class POP3account : public Account
+{
+
+public:
+ POP3account();
+ POP3account( QString filename );
+
+ static QString getUniqueFileName();
+
+ virtual void read();
+ virtual void save();
+ virtual QString getFileName();
+
+private:
+ QString file;
+
+};
+
+class SMTPaccount : public Account
+{
+
+public:
+ SMTPaccount();
+ SMTPaccount( QString filename );
+
+ static QString getUniqueFileName();
+
+ virtual void read();
+ virtual void save();
+ virtual QString getFileName();
+
+ void setLogin( bool b ) { login = b; }
+ bool getLogin() { return login; }
+
+private:
+ QString file, name, mail, org, cc, bcc, reply, signature;
+ bool useCC, useBCC, useReply, login;
+
+};
+
+class NNTPaccount : public Account
+{
+
+public:
+ NNTPaccount();
+ NNTPaccount( QString filename );
+
+ static QString getUniqueFileName();
+
+ virtual void read();
+ virtual void save();
+ virtual QString getFileName();
+
+ void setLogin( bool b ) { login = b; }
+ bool getLogin() { return login; }
+
+ void setGroups( QStringList list ) { subscribedGroups = list; }
+ QStringList getGroups() { return subscribedGroups; }
+
+private:
+ QString file;
+ bool login;
+ QStringList subscribedGroups;
+
+};
+
+class Settings : public QObject
+{
+ Q_OBJECT
+
+public:
+ Settings();
+ QList<Account> getAccounts();
+ void addAccount(Account *account);
+ void delAccount(Account *account);
+ void saveAccounts();
+ void readAccounts();
+ static void checkDirectory();
+
+private:
+ void updateAccounts();
+ QList<Account> accounts;
+
+};
+
+#endif