author | harlekin <harlekin> | 2003-12-08 13:37:32 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2003-12-08 13:37:32 (UTC) |
commit | 3b37149813d940535b12ba3b1edd938c41804a1b (patch) (unidiff) | |
tree | 0e35a3b28fb147514f22a6a6cb5aaf246e4c5670 /noncore/net/mail/settings.h | |
parent | 3d49fc2f7bba9c9e8856e5f4f7ec6c15ef84c252 (diff) | |
download | opie-3b37149813d940535b12ba3b1edd938c41804a1b.zip opie-3b37149813d940535b12ba3b1edd938c41804a1b.tar.gz opie-3b37149813d940535b12ba3b1edd938c41804a1b.tar.bz2 |
beginning of the new mailer
-rw-r--r-- | noncore/net/mail/settings.h | 166 |
1 files changed, 166 insertions, 0 deletions
diff --git a/noncore/net/mail/settings.h b/noncore/net/mail/settings.h new file mode 100644 index 0000000..22184a5 --- a/dev/null +++ b/noncore/net/mail/settings.h | |||
@@ -0,0 +1,166 @@ | |||
1 | #ifndef SETTINGS_H | ||
2 | #define SETTINGS_H | ||
3 | |||
4 | #include <qobject.h> | ||
5 | #include <qlist.h> | ||
6 | |||
7 | class Account | ||
8 | { | ||
9 | |||
10 | public: | ||
11 | Account(); | ||
12 | virtual ~Account() {} | ||
13 | |||
14 | void remove(); | ||
15 | void setAccountName( QString name ) { accountName = name; } | ||
16 | const QString&getAccountName()const{ return accountName; } | ||
17 | const QString&getType()const{ return type; } | ||
18 | |||
19 | void setServer(const QString&str){ server = str; } | ||
20 | const QString&getServer()const{ return server; } | ||
21 | |||
22 | void setPort(const QString&str) { port = str; } | ||
23 | const QString&getPort()const{ return port; } | ||
24 | |||
25 | void setUser(const QString&str){ user = str; } | ||
26 | const QString&getUser()const{ return user; } | ||
27 | |||
28 | void setPassword(const QString&str) { password = str; } | ||
29 | const QString&getPassword()const { return password; } | ||
30 | |||
31 | void setSSL( bool b ) { ssl = b; } | ||
32 | bool getSSL() { return ssl; } | ||
33 | |||
34 | virtual QString getFileName() { return accountName; } | ||
35 | virtual void read() { qDebug( "base reading..." ); } | ||
36 | virtual void save() { qDebug( "base saving..." ); } | ||
37 | |||
38 | protected: | ||
39 | QString accountName, type, server, port, user, password; | ||
40 | bool ssl; | ||
41 | |||
42 | }; | ||
43 | |||
44 | class IMAPaccount : public Account | ||
45 | { | ||
46 | |||
47 | public: | ||
48 | IMAPaccount(); | ||
49 | IMAPaccount( QString filename ); | ||
50 | |||
51 | static QString getUniqueFileName(); | ||
52 | |||
53 | virtual void read(); | ||
54 | virtual void save(); | ||
55 | virtual QString getFileName(); | ||
56 | |||
57 | void setPrefix(const QString&str) {prefix=str;} | ||
58 | const QString&getPrefix()const{return prefix;} | ||
59 | |||
60 | private: | ||
61 | QString file,prefix; | ||
62 | |||
63 | }; | ||
64 | |||
65 | class POP3account : public Account | ||
66 | { | ||
67 | |||
68 | public: | ||
69 | POP3account(); | ||
70 | POP3account( QString filename ); | ||
71 | |||
72 | static QString getUniqueFileName(); | ||
73 | |||
74 | virtual void read(); | ||
75 | virtual void save(); | ||
76 | virtual QString getFileName(); | ||
77 | |||
78 | private: | ||
79 | QString file; | ||
80 | |||
81 | }; | ||
82 | |||
83 | class SMTPaccount : public Account | ||
84 | { | ||
85 | |||
86 | public: | ||
87 | SMTPaccount(); | ||
88 | SMTPaccount( QString filename ); | ||
89 | |||
90 | static QString getUniqueFileName(); | ||
91 | |||
92 | virtual void read(); | ||
93 | virtual void save(); | ||
94 | virtual QString getFileName(); | ||
95 | |||
96 | void setName( QString str ) { name = str; } | ||
97 | QString getName() { return name; } | ||
98 | void setMail( QString str ) { mail = str; } | ||
99 | QString getMail() { return mail; } | ||
100 | void setOrg( QString str ) { org = str; } | ||
101 | QString getOrg() { return org; } | ||
102 | void setUseCC( bool b ) { useCC = b; } | ||
103 | bool getUseCC() { return useCC; } | ||
104 | void setCC( QString str ) { cc = str; } | ||
105 | QString getCC() { return cc; } | ||
106 | void setUseBCC( bool b ) { useBCC = b; } | ||
107 | bool getUseBCC() { return useBCC; } | ||
108 | void setBCC( QString str ) { bcc = str; } | ||
109 | QString getBCC() { return bcc; } | ||
110 | void setUseReply( bool b ) { useReply = b; } | ||
111 | bool getUseReply() { return useReply; } | ||
112 | void setReply( QString str ) { reply = str; } | ||
113 | QString getReply() { return reply; } | ||
114 | void setSignature( QString str ) { signature = str; } | ||
115 | QString getSignature() { return signature; } | ||
116 | void setLogin( bool b ) { login = b; } | ||
117 | bool getLogin() { return login; } | ||
118 | |||
119 | private: | ||
120 | QString file, name, mail, org, cc, bcc, reply, signature; | ||
121 | bool useCC, useBCC, useReply, login; | ||
122 | |||
123 | }; | ||
124 | |||
125 | class NNTPaccount : public Account | ||
126 | { | ||
127 | |||
128 | public: | ||
129 | NNTPaccount(); | ||
130 | NNTPaccount( QString filename ); | ||
131 | |||
132 | static QString getUniqueFileName(); | ||
133 | |||
134 | virtual void read(); | ||
135 | virtual void save(); | ||
136 | virtual QString getFileName(); | ||
137 | |||
138 | void setLogin( bool b ) { login = b; } | ||
139 | bool getLogin() { return login; } | ||
140 | |||
141 | private: | ||
142 | QString file; | ||
143 | bool login; | ||
144 | |||
145 | }; | ||
146 | |||
147 | class Settings : public QObject | ||
148 | { | ||
149 | Q_OBJECT | ||
150 | |||
151 | public: | ||
152 | Settings(); | ||
153 | QList<Account> getAccounts(); | ||
154 | void addAccount(Account *account); | ||
155 | void delAccount(Account *account); | ||
156 | void saveAccounts(); | ||
157 | void readAccounts(); | ||
158 | static void checkDirectory(); | ||
159 | |||
160 | private: | ||
161 | void updateAccounts(); | ||
162 | QList<Account> accounts; | ||
163 | |||
164 | }; | ||
165 | |||
166 | #endif | ||