Wt examples  3.3.12
Composer.h
Go to the documentation of this file.
1 // This may look like C code, but it's really -*- C++ -*-
2 /*
3  * Copyright (C) 2008 Emweb bvba, Kessel-Lo, Belgium.
4  *
5  * See the LICENSE file for terms of use.
6  */
7 #ifndef COMPOSER_H_
8 #define COMPOSER_H_
9 
10 #include <Wt/WCompositeWidget>
11 
12 #include "Contact.h"
13 #include "Attachment.h"
14 
15 namespace Wt {
16 class WLineEdit;
17 class WPushButton;
18 class WTable;
19 class WText;
20 class WTextArea;
21 }
22 
23 class AddresseeEdit;
24 class AttachmentEdit;
25 class ContactSuggestions;
26 class OptionList;
27 class Option;
28 
29 using namespace Wt;
30 
35 
40 class Composer : public WCompositeWidget
41 {
42 public:
45  Composer(WContainerWidget *parent = 0);
46 
49  void setTo(const std::vector<Contact>& to);
50 
53  void setSubject(const WString& subject);
54 
57  void setMessage(const WString& message);
58 
61  void setAddressBook(const std::vector<Contact>& addressBook);
62 
65  std::vector<Contact> to() const;
66 
69  std::vector<Contact> cc() const;
70 
73  std::vector<Contact> bcc() const;
74 
77  const WString& subject() const;
78 
84  std::vector<Attachment> attachments() const;
85 
88  const WString& message() const;
89 
90 public:
93  Wt::Signal<void> send;
94 
97  Wt::Signal<void> discard;
98 
99 private:
100  WContainerWidget *layout_;
101 
102  WPushButton *topSendButton_, *topSaveNowButton_, *topDiscardButton_;
103  WPushButton *botSendButton_, *botSaveNowButton_, *botDiscardButton_;
104  WText *statusMsg_;
105 
106  WTable *edits_;
107 
114 
117 
119  WLineEdit *subject_;
120 
123 
132 
134  std::vector<AttachmentEdit *> attachments_;
135 
137  WTextArea *message_;
138 
140  bool saving_, sending_;
141 
144 
147  void attachMore();
148 
151  void removeAttachment(AttachmentEdit *attachment);
152 
157  void sendIt();
158 
164  void saveNow();
165 
170  void discardIt();
171 
179  void attachmentDone();
180 
181 private:
182  // create the user-interface
183  void createUi();
184 
188  void saved();
189 
192  void setStatus(const WString& text, const WString& style);
193 
194  friend class AttachmentEdit;
195 };
196 
199 #endif // COMPOSER_H_
Composer::botSendButton_
WPushButton * botSendButton_
Definition: Composer.h:103
Composer::attachFile_
Option * attachFile_
Option for attaching a file.
Definition: Composer.h:129
Composer::addcc_
Option * addcc_
Option for editing Cc:
Definition: Composer.h:125
Wt
Definition: AddresseeEdit.h:16
Composer::send
Wt::Signal< void > send
The message is ready to be sent...
Definition: Composer.h:93
Composer::contactSuggestions_
ContactSuggestions * contactSuggestions_
The suggestions popup for the addressee edits.
Definition: Composer.h:116
Composer::message_
WTextArea * message_
WTextArea for the main message.
Definition: Composer.h:137
Composer::statusMsg_
WText * statusMsg_
Definition: Composer.h:104
Composer::edits_
WTable * edits_
Definition: Composer.h:106
Composer::addbcc_
Option * addbcc_
Option for editing Bcc:
Definition: Composer.h:127
Composer::ccEdit_
AddresseeEdit * ccEdit_
Cc: Addressees edit.
Definition: Composer.h:111
Composer::attachOtherFile_
Option * attachOtherFile_
Option for attaching another file.
Definition: Composer.h:131
Composer::options_
OptionList * options_
OptionsList for editing Cc or Bcc.
Definition: Composer.h:122
Composer::subject_
WLineEdit * subject_
The subject line edit.
Definition: Composer.h:119
Option
A clickable option.
Definition: Option.h:31
Composer::attachmentsPending_
int attachmentsPending_
number of attachments waiting to be uploaded during saving
Definition: Composer.h:143
Composer
An E-mail composer widget.
Definition: Composer.h:40
Composer::attachments_
std::vector< AttachmentEdit * > attachments_
Array which holds all the attachments, including one extra invisible one.
Definition: Composer.h:134
AddresseeEdit
An edit field for an email addressee.
Definition: AddresseeEdit.h:31
Composer::sending_
bool sending_
Definition: Composer.h:140
Composer::discard
Wt::Signal< void > discard
The message must be discarded.
Definition: Composer.h:97
Composer::toEdit_
AddresseeEdit * toEdit_
To: Addressees edit.
Definition: Composer.h:109
OptionList
A list of options, separated by '|'.
Definition: OptionList.h:40
AttachmentEdit
An edit field for an email attachment.
Definition: AttachmentEdit.h:37
ContactSuggestions
A suggestion popup suggesting contacts from an addressbook.
Definition: ContactSuggestions.h:32
Contact.h
Composer::bccEdit_
AddresseeEdit * bccEdit_
Bcc: Addressees edit.
Definition: Composer.h:113
Composer::layout_
WContainerWidget * layout_
Definition: Composer.h:100
Composer::topSendButton_
WPushButton * topSendButton_
Definition: Composer.h:102
Attachment.h

Generated on Mon Sep 5 2022 for the C++ Web Toolkit (Wt) by doxygen 1.8.17