1 /* -*- c++ -*- 2 attachmentstrategy.h 3 4 This file is part of KMail, the KDE mail client. 5 SPDX-FileCopyrightText: 2003 Marc Mutz <mutz@kde.org> 6 SPDX-FileCopyrightText: 2009 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.net 7 SPDX-FileCopyrightText: 2009 Andras Mantia <andras@kdab.net> 8 9 SPDX-License-Identifier: GPL-2.0-or-later 10 */ 11 12 #pragma once 13 14 #include "messageviewer_export.h" 15 16 class QString; 17 namespace KMime 18 { 19 class Content; 20 } 21 22 namespace MessageViewer 23 { 24 /** 25 * @brief The AttachmentStrategy class 26 */ 27 class MESSAGEVIEWER_EXPORT AttachmentStrategy 28 { 29 protected: 30 AttachmentStrategy(); 31 virtual ~AttachmentStrategy(); 32 33 public: 34 // 35 // Factory methods: 36 // 37 enum Type { Iconic, Smart, Inlined, Hidden, HeaderOnly }; 38 39 static const AttachmentStrategy *create(Type type); 40 static const AttachmentStrategy *create(const QString &type); 41 42 static const AttachmentStrategy *iconic(); 43 static const AttachmentStrategy *smart(); 44 static const AttachmentStrategy *inlined(); 45 static const AttachmentStrategy *hidden(); 46 static const AttachmentStrategy *headerOnly(); 47 48 // 49 // Navigation methods: 50 // 51 52 virtual const char *name() const = 0; 53 54 // 55 // Behavioral: 56 // 57 58 enum Display { None, AsIcon, Inline }; 59 60 virtual bool inlineNestedMessages() const = 0; 61 virtual Display defaultDisplay(KMime::Content *node) const = 0; 62 virtual bool requiresAttachmentListInHeader() const; 63 }; 64 } 65 66