Wtx ~ Wt Extension Library
WtxLib
ModelProvider.cpp
1 
2 #include <Wt/WStandardItemModel.h>
3 
4 #include "ModelProvider.h"
5 
6 Wtx::Web::Calendar::ModelProvider::ModelProvider
7 (
8  const std::string & name,
9  const std::string & dateStart,
10  const std::string & dateEnd,
11  const std::string & timeStart,
12  const std::string & timeEnd,
13  const std::string & subject,
14  const std::string & body
15 )
16 : Wt::WObject(),
17  m_name(name)
18 {
19  setMapping
20  (
21  dateStart,
22  dateEnd,
23  timeStart,
24  timeEnd,
25  subject,
26  body
27  );
28 }
29 
30 std::shared_ptr<Wt::WAbstractItemModel> Wtx::Web::Calendar::ModelProvider::getModel( const Wt::WDate & date, const std::vector<std::string> & fieldList )
31 {
32  return std::make_shared<Wt::WStandardItemModel>();
33 }
34 
35 const std::string & Wtx::Web::Calendar::ModelProvider::name() const
36 {
37  return m_name;
38 }
39 
40 const std::string & Wtx::Web::Calendar::ModelProvider::dateStart() const
41 {
42  return m_dateStart;
43 }
44 
45 const std::string & Wtx::Web::Calendar::ModelProvider::dateEnd() const
46 {
47  return m_dateEnd;
48 }
49 
50 const std::string & Wtx::Web::Calendar::ModelProvider::timeStart() const
51 {
52  return m_timeStart;
53 }
54 
55 const std::string & Wtx::Web::Calendar::ModelProvider::timeEnd() const
56 {
57  return m_timeEnd;
58 }
59 
60 const std::string & Wtx::Web::Calendar::ModelProvider::subject() const
61 {
62  return m_subject;
63 }
64 
65 const std::string & Wtx::Web::Calendar::ModelProvider::body() const
66 {
67  return m_body;
68 }
69 
70 void Wtx::Web::Calendar::ModelProvider::setMapping
71 (
72  const std::string & dateStart,
73  const std::string & dateEnd,
74  const std::string & timeStart,
75  const std::string & timeEnd,
76  const std::string & subject,
77  const std::string & body
78 )
79 {
80  m_dateStart = dateStart;
81  m_dateEnd = dateEnd;
82  m_timeStart = timeStart;
83  m_timeEnd = timeEnd;
84  m_subject = subject;
85  m_body = body;
86 
87 }
88 
89 
90