File indexing completed on 2025-03-09 04:54:40

0001 /*  -*- c++ -*-
0002     attachmentstrategy.h
0003 
0004     This file is part of KMail, the KDE mail client.
0005     SPDX-FileCopyrightText: 2003 Marc Mutz <mutz@kde.org>
0006     SPDX-FileCopyrightText: 2009 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.net
0007     SPDX-FileCopyrightText: 2009 Andras Mantia <andras@kdab.net>
0008 
0009     SPDX-License-Identifier: GPL-2.0-or-later
0010 */
0011 
0012 #pragma once
0013 
0014 #include "messageviewer_export.h"
0015 
0016 class QString;
0017 namespace KMime
0018 {
0019 class Content;
0020 }
0021 
0022 namespace MessageViewer
0023 {
0024 /**
0025  * @brief The AttachmentStrategy class
0026  */
0027 class MESSAGEVIEWER_EXPORT AttachmentStrategy
0028 {
0029 protected:
0030     AttachmentStrategy();
0031     virtual ~AttachmentStrategy();
0032 
0033 public:
0034     //
0035     // Factory methods:
0036     //
0037     enum Type { Iconic, Smart, Inlined, Hidden, HeaderOnly };
0038 
0039     static const AttachmentStrategy *create(Type type);
0040     static const AttachmentStrategy *create(const QString &type);
0041 
0042     static const AttachmentStrategy *iconic();
0043     static const AttachmentStrategy *smart();
0044     static const AttachmentStrategy *inlined();
0045     static const AttachmentStrategy *hidden();
0046     static const AttachmentStrategy *headerOnly();
0047 
0048     //
0049     // Navigation methods:
0050     //
0051 
0052     virtual const char *name() const = 0;
0053 
0054     //
0055     // Behavioral:
0056     //
0057 
0058     enum Display {
0059         None,
0060         AsIcon,
0061         Inline,
0062     };
0063 
0064     virtual bool inlineNestedMessages() const = 0;
0065     virtual Display defaultDisplay(KMime::Content *node) const = 0;
0066     virtual bool requiresAttachmentListInHeader() const;
0067 };
0068 }