Wittyshare  0.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
WsNewsLetter.h
Go to the documentation of this file.
1 /*
2 * Copyright (C) 2006-Today Guy Deleeuw
3 *
4 * See the LICENSE file for terms of use.
5 */
6 
7 #ifndef WsNewsLetter_H__
8 #define WsNewsLetter_H__ 1
9 
10 #include <Wt/WContainerWidget>
11 #include <Wt/WLineEdit>
12 #include <Wt/WPushButton>
13 
14 #include <WsModule/WsModule.h>
15 
16 #include "EmailToken.h"
17 
18 using namespace Wt;
19 
26 class WsNewsLetter : public Wt::WContainerWidget, public WsOptions {
27 public :
29  enum emailAvailability { ldapError, emailNotAvailable, emailAvailable, emailMultiple };
30 
32  WsNewsLetter(Wt::WContainerWidget* parent = 0);
33  ~WsNewsLetter();
34  void load();
35  void initDB();
36  emailAvailability isEmailExistInLdap(const std::string& email);
37  void emailNotInLdap(const std::string& email);
38  void multipleEmail(const std::string& email);
39  void sendEmail(const std::string& email, const std::string& sSubject, const std::string& sBody, const std::string& sBodyPlain);
40  std::string checkPath(const std::string& currentPath);
41  void registerValidEmail(const std::string& email);
42 
43 public slots :
44  void doLineEditChanged();
45  void doSubscribe();
46 
47 private :
48  Wt::WLineEdit* m_pLineEdit;
49  Wt::WPushButton* m_pButSubscribe;
50  dbo::Session session_;
51  dbo::backend::Sqlite3* sqlite3_;
52 };
53 
54 #endif // ifndef WsNewsLetter_H__
55 
dbo::backend::Sqlite3 * sqlite3_
Definition: WsNewsLetter.h:51
emailAvailability
descripte the result of the Ldap query
Definition: WsNewsLetter.h:29
Wt::WLineEdit * m_pLineEdit
Definition: WsNewsLetter.h:48
dbo::Session session_
Definition: WsNewsLetter.h:50
Wt::WPushButton * m_pButSubscribe
Definition: WsNewsLetter.h:49