#include "config.h"
#include <stdbool.h>
#include <stdio.h>
#include "private.h"
#include "mutt/lib.h"
#include "address/lib.h"
#include "config/lib.h"
#include "email/lib.h"
#include "core/lib.h"
#include "gui/lib.h"
#include "color/lib.h"
#include "ncrypt/lib.h"
#include "functions.h"
#include "globals.h"
#include "wdata.h"
#include <libintl.h>
Go to the source code of this file.
Macros | |
#define | MAX_ADDR_ROWS 5 |
Maximum number of rows to use for the To:, Cc:, Bcc: fields. | |
#define | MAX_USER_HDR_ROWS 5 |
Maximum number of rows to use for the Headers: field. | |
Functions | |
static void | calc_header_width_padding (int idx, const char *header, bool calc_max) |
Calculate the width needed for the compose labels. | |
static void | init_header_padding (void) |
Calculate how much padding the compose table will need. | |
static int | calc_address (struct AddressList *al, short cols, short *srows) |
Calculate how many rows an AddressList will need. | |
static int | calc_security (struct Email *e, short *rows, const struct ConfigSubset *sub) |
Calculate how many rows the security info will need. | |
static int | calc_user_hdrs (const struct ListHead *hdrs) |
Calculate how many rows are needed for user-defined headers. | |
static int | calc_envelope (struct MuttWindow *win, struct EnvelopeWindowData *wdata) |
Calculate how many rows the envelope will need. | |
static void | draw_floating (struct MuttWindow *win, int col, int row, const char *text) |
Draw a floating label. | |
static void | draw_header (struct MuttWindow *win, int row, enum HeaderField field) |
Draw an aligned label. | |
static void | draw_header_content (struct MuttWindow *win, int row, enum HeaderField field, const char *content) |
Draw content on a separate line aligned to header prompt. | |
static int | draw_crypt_lines (struct MuttWindow *win, struct EnvelopeWindowData *wdata, int row) |
Update the encryption info in the compose window. | |
static int | draw_envelope_addr (int field, struct AddressList *al, struct MuttWindow *win, int row, size_t max_lines) |
Write addresses to the compose window. | |
static int | draw_envelope_user_hdrs (struct MuttWindow *win, struct EnvelopeWindowData *wdata, int row) |
Write user-defined headers to the compose window. | |
static void | draw_envelope (struct MuttWindow *win, struct EnvelopeWindowData *wdata) |
Write the email headers to the compose window. | |
static int | env_recalc (struct MuttWindow *win) |
Recalculate the Window data - Implements MuttWindow::recalc() -. | |
static int | env_repaint (struct MuttWindow *win) |
Repaint the Window - Implements MuttWindow::repaint() -. | |
static int | env_color_observer (struct NotifyCallback *nc) |
Notification that a Color has changed - Implements observer_t -. | |
static int | env_config_observer (struct NotifyCallback *nc) |
Notification that a Config Variable has changed - Implements observer_t -. | |
static int | env_email_observer (struct NotifyCallback *nc) |
Notification that the Email has changed - Implements observer_t -. | |
static int | env_header_observer (struct NotifyCallback *nc) |
Notification that a User Header has changed - Implements observer_t -. | |
static int | env_window_observer (struct NotifyCallback *nc) |
Notification that a Window has changed - Implements observer_t -. | |
struct MuttWindow * | env_window_new (struct Email *e, struct Buffer *fcc, struct ConfigSubset *sub) |
Create the Envelope Window. | |
Variables | |
static int | HeaderPadding [HDR_ATTACH_TITLE] = { 0 } |
Number of padding spaces needed after each of the strings in Prompts after translation. | |
static int | MaxHeaderWidth = 0 |
Widest of the Prompts strings after translation. | |
const char *const | Prompts [] |
Names of header fields used in the envelope, e.g. From:, To: | |
static const char *const | AutocryptRecUiFlags [] |
Autocrypt "recommendation" strings. | |
Envelope Window.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Definition in file window.c.
#define MAX_ADDR_ROWS 5 |
#define MAX_USER_HDR_ROWS 5 |
|
static |
Calculate the width needed for the compose labels.
idx | Store the result at this index of HeaderPadding |
header | Header string |
calc_max | If true, calculate the maximum width |
Definition at line 161 of file window.c.
|
static |
Calculate how much padding the compose table will need.
The padding needed for each header is strlen() + max_width - strwidth().
calc_header_width_padding sets each entry in HeaderPadding to strlen - width. Then, afterwards, we go through and add max_width to each entry.
Definition at line 180 of file window.c.
|
static |
Calculate how many rows an AddressList will need.
[in] | al | Address List |
[in] | cols | Screen columns available |
[out] | srows | Rows needed |
num | Rows needed |
Definition at line 217 of file window.c.
|
static |
Calculate how many rows the security info will need.
e | |
rows | Rows needed |
sub | ConfigSubset |
num | Rows needed |
Definition at line 262 of file window.c.
|
static |
Calculate how many rows are needed for user-defined headers.
hdrs | Header List |
num | Rows needed, limited to MAX_USER_HDR_ROWS |
Definition at line 285 of file window.c.
|
static |
Calculate how many rows the envelope will need.
win | Window to draw on |
wdata | Envelope Window data |
num | Rows needed |
Definition at line 304 of file window.c.
|
static |
Draw a floating label.
win | Window to draw on |
col | Column to draw at |
row | Row to draw at |
text | Text to display |
Definition at line 340 of file window.c.
|
static |
|
static |
Draw content on a separate line aligned to header prompt.
win | Window to draw on |
row | Row to draw at |
field | Field to display, e.g. HDR_FROM |
content | Text to display |
Content will be truncated if it is wider than the window.
Definition at line 369 of file window.c.
|
static |
Update the encryption info in the compose window.
win | Window to draw on |
wdata | Envelope Window data |
row | Window row to start drawing |
num | Number of lines used |
Definition at line 383 of file window.c.
|
static |
Write addresses to the compose window.
field | Field to display, e.g. HDR_FROM |
al | Address list to write |
win | Window |
row | Window row to start drawing |
max_lines | How many lines may be used |
num | Lines used |
Definition at line 500 of file window.c.
|
static |
Write user-defined headers to the compose window.
win | Window to draw on |
wdata | Envelope Window data |
row | Window row to start drawing from |
num | Rows used |
Definition at line 626 of file window.c.
|
static |
Write the email headers to the compose window.
win | Window to draw on |
wdata | Envelope Window data |
Definition at line 668 of file window.c.
struct MuttWindow * env_window_new | ( | struct Email * | e, |
struct Buffer * | fcc, | ||
struct ConfigSubset * | sub | ||
) |
Create the Envelope Window.
e | |
fcc | Buffer to save FCC |
sub | ConfigSubset |
ptr | New Window |
Definition at line 944 of file window.c.
|
static |
|
static |
const char* const Prompts[] |