-rw-r--r-- | noncore/net/mail/settings.h | 146 |
1 files changed, 0 insertions, 146 deletions
diff --git a/noncore/net/mail/settings.h b/noncore/net/mail/settings.h deleted file mode 100644 index caa5dfc..0000000 --- a/noncore/net/mail/settings.h +++ b/dev/null | |||
@@ -1,146 +0,0 @@ | |||
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 setLogin( bool b ) { login = b; } | ||
97 | bool getLogin() { return login; } | ||
98 | |||
99 | private: | ||
100 | QString file, name, mail, org, cc, bcc, reply, signature; | ||
101 | bool useCC, useBCC, useReply, login; | ||
102 | |||
103 | }; | ||
104 | |||
105 | class NNTPaccount : public Account | ||
106 | { | ||
107 | |||
108 | public: | ||
109 | NNTPaccount(); | ||
110 | NNTPaccount( QString filename ); | ||
111 | |||
112 | static QString getUniqueFileName(); | ||
113 | |||
114 | virtual void read(); | ||
115 | virtual void save(); | ||
116 | virtual QString getFileName(); | ||
117 | |||
118 | void setLogin( bool b ) { login = b; } | ||
119 | bool getLogin() { return login; } | ||
120 | |||
121 | private: | ||
122 | QString file; | ||
123 | bool login; | ||
124 | |||
125 | }; | ||
126 | |||
127 | class Settings : public QObject | ||
128 | { | ||
129 | Q_OBJECT | ||
130 | |||
131 | public: | ||
132 | Settings(); | ||
133 | QList<Account> getAccounts(); | ||
134 | void addAccount(Account *account); | ||
135 | void delAccount(Account *account); | ||
136 | void saveAccounts(); | ||
137 | void readAccounts(); | ||
138 | static void checkDirectory(); | ||
139 | |||
140 | private: | ||
141 | void updateAccounts(); | ||
142 | QList<Account> accounts; | ||
143 | |||
144 | }; | ||
145 | |||
146 | #endif | ||