Wt examples 4.7.2
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 bv, Herent, 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.h>
11
12#include "Contact.h"
13#include "Attachment.h"
14
15namespace Wt {
16class WLineEdit;
17class WPushButton;
18class WTable;
19class WText;
20class WTextArea;
21}
22
23class AddresseeEdit;
24class AttachmentEdit;
26class OptionList;
27class Option;
28
29using namespace Wt;
30
35
40class Composer : public WCompositeWidget
41{
42public:
45 Composer();
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
90public:
93 Wt::Signal<> send;
94
97 Wt::Signal<> discard;
98
99private:
100 WContainerWidget *layout_;
101
105
106 WTable *edits_;
107
114
117
119 WLineEdit *subject_;
120
123
132
134 std::vector<AttachmentEdit *> attachments_;
135
137 WTextArea *message_;
138
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
181private:
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
198
199#endif // COMPOSER_H_
An edit field for an email addressee.
Definition: AddresseeEdit.h:32
An edit field for an email attachment.
An E-mail composer widget.
Definition: Composer.h:41
WPushButton * botSaveNowButton_
Definition: Composer.h:103
void sendIt()
Slot attached to the Send button.
Definition: Composer.C:296
WText * statusMsg_
Definition: Composer.h:104
Option * attachOtherFile_
Option for attaching another file.
Definition: Composer.h:131
void setMessage(const WString &message)
Set the message.
Definition: Composer.C:50
void saved()
All attachments have been processed, determine the result of saving the message.
Definition: Composer.C:355
WTextArea * message_
WTextArea for the main message.
Definition: Composer.h:137
WPushButton * topSaveNowButton_
Definition: Composer.h:102
Wt::Signal send
The message is ready to be sent...
Definition: Composer.h:93
std::vector< Contact > bcc() const
Get the Bc: contacts.
Definition: Composer.C:65
Wt::Signal discard
The message must be discarded.
Definition: Composer.h:97
const WString & message() const
Get the message.
Definition: Composer.C:93
WPushButton * topSendButton_
Definition: Composer.h:102
void setStatus(const WString &text, const WString &style)
Set the status, and apply the given style.
Definition: Composer.C:349
AddresseeEdit * toEdit_
To: Addressees edit.
Definition: Composer.h:109
void discardIt()
Slot attached to the Discard button.
Definition: Composer.C:385
std::vector< Contact > to() const
Get the To: contacts.
Definition: Composer.C:55
void attachMore()
Add an attachment edit.
Definition: Composer.C:254
void saveNow()
Slot attached to the Save now button.
Definition: Composer.C:309
WPushButton * botSendButton_
Definition: Composer.h:103
bool saving_
state when waiting asyncrhonously for attachments to be uploaded
Definition: Composer.h:140
WLineEdit * subject_
The subject line edit.
Definition: Composer.h:119
WPushButton * topDiscardButton_
Definition: Composer.h:102
int attachmentsPending_
number of attachments waiting to be uploaded during saving
Definition: Composer.h:143
void setTo(const std::vector< Contact > &to)
Set message To: contacts.
Definition: Composer.C:40
ContactSuggestions * contactSuggestions_
The suggestions popup for the addressee edits.
Definition: Composer.h:116
Composer()
Construct a new Composer.
Definition: Composer.C:27
Option * attachFile_
Option for attaching a file.
Definition: Composer.h:129
WPushButton * botDiscardButton_
Definition: Composer.h:103
std::vector< AttachmentEdit * > attachments_
Array which holds all the attachments, including one extra invisible one.
Definition: Composer.h:134
WTable * edits_
Definition: Composer.h:106
Option * addbcc_
Option for editing Bcc:
Definition: Composer.h:127
AddresseeEdit * ccEdit_
Cc: Addressees edit.
Definition: Composer.h:111
bool sending_
Definition: Composer.h:140
void attachmentDone()
Slotcalled when an attachment has been uploaded.
Definition: Composer.C:338
WContainerWidget * layout_
Definition: Composer.h:100
void setSubject(const WString &subject)
Set subject.
Definition: Composer.C:45
void removeAttachment(AttachmentEdit *attachment)
Remove the given attachment edit.
Definition: Composer.C:271
const WString & subject() const
Get the subject.
Definition: Composer.C:75
Option * addcc_
Option for editing Cc:
Definition: Composer.h:125
void setAddressBook(const std::vector< Contact > &addressBook)
Set the address book, for autocomplete suggestions.
Definition: Composer.C:70
std::vector< Contact > cc() const
Get the Cc: contacts.
Definition: Composer.C:60
void createUi()
Definition: Composer.C:98
AddresseeEdit * bccEdit_
Bcc: Addressees edit.
Definition: Composer.h:113
OptionList * options_
OptionsList for editing Cc or Bcc.
Definition: Composer.h:122
std::vector< Attachment > attachments() const
Get the list of attachments.
Definition: Composer.C:80
A suggestion popup suggesting contacts from an addressbook.
A list of options, separated by '|'.
Definition: OptionList.h:41
A clickable option.
Definition: Option.h:32

Generated on Fri May 13 2022 for the C++ Web Toolkit (Wt) by doxygen 1.9.4