* @file
* View of a Mailbox
*
* @authors
* Copyright (C) 2019-2023 Richard Russon <rich@flatcap.org>
* Copyright (C) 2020 Pietro Cerutti <gahr@gahr.ch>
*
* @copyright
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation, either version 2 of the License, or (at your option) any later
* version.
*
* 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/>.
*/
#ifndef MUTT_GUI_MVIEW_H
#define MUTT_GUI_MVIEW_H
#include <stdbool.h>
#include <sys/types.h>
struct Email;
struct EmailArray;
struct Mailbox;
struct Notify;
struct NotifyCallback;
* struct MailboxView - View of a Mailbox
*/
struct MailboxView
{
off_t vsize;
char *pattern;
struct PatternList *limit_pattern;
struct ThreadsContext *threads;
int msg_in_pager;
struct Menu *menu;
bool collapsed : 1;
struct Mailbox *mailbox;
struct Notify *notify;
};
* enum NotifyMview - Types of MailboxView Event
*
* Observers of #NT_MVIEW will be passed an #EventMview.
*/
enum NotifyMview
{
NT_MVIEW_ADD = 1,
NT_MVIEW_DELETE,
NT_MVIEW_CHANGE,
};
* struct EventMview - An Event that happened to an MailboxView
*/
struct EventMview
{
struct MailboxView *mv;
};
void mview_free (struct MailboxView **ptr);
int mview_mailbox_observer(struct NotifyCallback *nc);
struct MailboxView *mview_new (struct Mailbox *m, struct Notify *parent);
void mview_update (struct MailboxView *mv);
bool mview_has_limit (const struct MailboxView *mv);
struct Mailbox * mview_mailbox (struct MailboxView *mv);
bool message_is_tagged(struct Email *e);
struct Email *mutt_get_virt_email(struct Mailbox *m, int vnum);
int ea_add_tagged(struct EmailArray *ea, struct MailboxView *mv, struct Email *e, bool use_tagged);
bool mutt_limit_current_thread(struct MailboxView *mv, struct Email *e);
#endif