/usr/lib/Wt/examples/composer/Composer.h is in witty-examples 3.3.0-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 | // This may look like C code, but it's really -*- C++ -*-
/*
* Copyright (C) 2008 Emweb bvba, Kessel-Lo, Belgium.
*
* See the LICENSE file for terms of use.
*/
#ifndef COMPOSER_H_
#define COMPOSER_H_
#include <Wt/WCompositeWidget>
#include "Contact.h"
#include "Attachment.h"
namespace Wt {
class WLineEdit;
class WPushButton;
class WTable;
class WText;
class WTextArea;
}
class AddresseeEdit;
class AttachmentEdit;
class ContactSuggestions;
class OptionList;
class Option;
using namespace Wt;
/**
* @addtogroup composerexample
*/
/*@{*/
/*! \brief An E-mail composer widget.
*
* This widget is part of the %Wt composer example.
*/
class Composer : public WCompositeWidget
{
public:
/*! \brief Construct a new Composer
*/
Composer(WContainerWidget *parent = 0);
/*! \brief Set message To: contacts
*/
void setTo(const std::vector<Contact>& to);
/*! \brief Set subject.
*/
void setSubject(const WString& subject);
/*! \brief Set the message.
*/
void setMessage(const WString& message);
/*! \brief Set the address book, for autocomplete suggestions.
*/
void setAddressBook(const std::vector<Contact>& addressBook);
/*! \brief Get the To: contacts.
*/
std::vector<Contact> to() const;
/*! \brief Get the Cc: contacts.
*/
std::vector<Contact> cc() const;
/*! \brief Get the Bc: contacts.
*/
std::vector<Contact> bcc() const;
/*! \brief Get the subject.
*/
const WString& subject() const;
/*! \brief Get the list of attachments.
*
* The ownership of the attachment spool files is transferred
* to the caller as well, be sure to delete them !
*/
std::vector<Attachment> attachments() const;
/*! \brief Get the message.
*/
const WString& message() const;
public:
/*! \brief The message is ready to be sent...
*/
Wt::Signal<void> send;
/*! \brief The message must be discarded.
*/
Wt::Signal<void> discard;
private:
WContainerWidget *layout_;
WPushButton *topSendButton_, *topSaveNowButton_, *topDiscardButton_;
WPushButton *botSendButton_, *botSaveNowButton_, *botDiscardButton_;
WText *statusMsg_;
WTable *edits_;
//! To: Addressees edit.
AddresseeEdit *toEdit_;
//! Cc: Addressees edit.
AddresseeEdit *ccEdit_;
//! Bcc: Addressees edit.
AddresseeEdit *bccEdit_;
//! The suggestions popup for the addressee edits.
ContactSuggestions *contactSuggestions_;
//! The subject line edit.
WLineEdit *subject_;
//! OptionsList for editing Cc or Bcc
OptionList *options_;
//! Option for editing Cc:
Option *addcc_;
//! Option for editing Bcc:
Option *addbcc_;
//! Option for attaching a file.
Option *attachFile_;
//! Option for attaching another file.
Option *attachOtherFile_;
//! Array which holds all the attachments, including one extra invisible one.
std::vector<AttachmentEdit *> attachments_;
//! WTextArea for the main message.
WTextArea *message_;
//! state when waiting asyncrhonously for attachments to be uploaded
bool saving_, sending_;
//! number of attachments waiting to be uploaded during saving
int attachmentsPending_;
/*!\brief Add an attachment edit.
*/
void attachMore();
/*!\brief Remove the given attachment edit.
*/
void removeAttachment(AttachmentEdit *attachment);
/*! \brief Slot attached to the Send button.
*
* Tries to save the mail message, and if succesfull, sends it.
*/
void sendIt();
/*! \brief Slot attached to the Save now button.
*
* Tries to save the mail message, and gives feedback on failure
* and on success.
*/
void saveNow();
/*! \brief Slot attached to the Discard button.
*
* Discards the current message: emits the discard event.
*/
void discardIt();
/*! \brief Slotcalled when an attachment has been uploaded.
*
* This used during while saving the email and waiting
* for remaining attachments to be uploaded. It is connected
* to the AttachmentEdit control signals that are emitted when
* an attachment has been processed.
*/
void attachmentDone();
private:
// create the user-interface
void createUi();
/*! \brief All attachments have been processed, determine the result
* of saving the message.
*/
void saved();
/*! \brief Set the status, and apply the given style.
*/
void setStatus(const WString& text, const WString& style);
friend class AttachmentEdit;
};
/*@}*/
#endif // COMPOSER_H_
|