1 /*  -*- c++ -*-
2     headerstrategy.h
3 
4     This file is part of KMail, the KDE mail client.
5     SPDX-FileCopyrightText: 2003 Marc Mutz <mutz@kde.org>
6 
7     SPDX-License-Identifier: GPL-2.0-or-later
8 */
9 
10 #pragma once
11 
12 #include "messageviewer_export.h"
13 #include <QStringList>
14 
15 namespace MessageViewer
16 {
17 //
18 // Convenience function
19 //
20 /**
21  * @brief The HeaderStrategy class
22  */
23 class MESSAGEVIEWER_EXPORT HeaderStrategy
24 {
25 protected:
26     HeaderStrategy();
27 
28 public:
29     virtual ~HeaderStrategy();
30     //
31     // Methods for handling the strategies:
32     //
33     virtual const char *name() const = 0;
34 
35     void readConfig();
36     //
37     // HeaderStrategy interface:
38     //
39     enum DefaultPolicy { Display, Hide };
40 
41     Q_REQUIRED_RESULT virtual QStringList headersToDisplay() const;
42     Q_REQUIRED_RESULT virtual QStringList headersToHide() const;
43     Q_REQUIRED_RESULT virtual DefaultPolicy defaultPolicy() const = 0;
44     Q_REQUIRED_RESULT virtual bool showHeader(const QString &header) const;
45     static QStringList stringList(const char *const headers[], int numHeaders);
46 };
47 }
48 
49