File indexing completed on 2024-05-12 05:11:10

0001 /*
0002     SPDX-FileCopyrightText: 2009 Kevin Ottens <ervin@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "akonadi-mime_export.h"
0010 
0011 #include <Akonadi/Attribute>
0012 
0013 #include <QByteArray>
0014 
0015 #include <memory>
0016 
0017 namespace Akonadi
0018 {
0019 class MessageFolderAttributePrivate;
0020 
0021 /**
0022   Message folder information. Used eg. by mail clients to decide how to display the content of such collections
0023   @since 4.4
0024 */
0025 class AKONADI_MIME_EXPORT MessageFolderAttribute : public Attribute
0026 {
0027 public:
0028     /**
0029       Creates an empty folder attribute.
0030     */
0031     MessageFolderAttribute();
0032 
0033     /**
0034       Copy constructor.
0035     */
0036     MessageFolderAttribute(const MessageFolderAttribute &other);
0037 
0038     /**
0039       Destructor.
0040     */
0041     ~MessageFolderAttribute() override;
0042 
0043     /**
0044       Indicates if the folder is supposed to contain mostly outbound messages.
0045       In such a case mail clients display the recipient address, otherwise they
0046       display the sender address.
0047 
0048       @return true if the folder contains outbound messages
0049     */
0050     bool isOutboundFolder() const;
0051 
0052     /**
0053       Set if the folder should be considered as containing mostly outbound messages.
0054      */
0055     void setOutboundFolder(bool outbound);
0056 
0057     // reimpl.
0058     QByteArray type() const override;
0059     MessageFolderAttribute *clone() const override;
0060     QByteArray serialized() const override;
0061     void deserialize(const QByteArray &data) override;
0062 
0063 private:
0064     std::unique_ptr<MessageFolderAttributePrivate> const d;
0065 };
0066 }