This file is indexed.

/usr/include/KF5/KMime/kmime/kmime_types.h is in libkf5mime-dev 15.12.3-0ubuntu1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
/*  -*- c++ -*-
    kmime_header_types.h

    KMime, the KDE Internet mail/usenet news message library.
    Copyright (c) 2001-2002 Marc Mutz <mutz@kde.org>

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
    License as published by the Free Software Foundation; either
    version 2 of the License, or (at your option) any later version.

    This library 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
    Library General Public License for more details.

    You should have received a copy of the GNU Library General Public License
    along with this library; see the file COPYING.LIB.  If not, write to
    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
    Boston, MA 02110-1301, USA.
*/

#ifndef __KMIME_TYPES_H__
#define __KMIME_TYPES_H__

#include <QtCore/QString>
#include <QtCore/QVector>

#include "kmime_export.h"

namespace KMime
{

namespace Types
{

struct KMIME_EXPORT AddrSpec {
    QString asString() const;
    /*! This is the same as asString(), except it decodes IDNs for display */
    QString asPrettyString() const;
    bool isEmpty() const;
    QString localPart;
    QString domain;
};
typedef QVector<AddrSpec> AddrSpecList;

/**
  Represents an (email address, display name) pair according RFC 2822,
  section 3.4.
*/
class KMIME_EXPORT Mailbox
{
public:
    typedef QVector<Mailbox> List;

    /**
      Returns a string representation of the email address, without
      the angle brackets.
    */
    QByteArray address() const;

    AddrSpec addrSpec() const;

    /**
      Returns the display name.
    */
    QString name() const;

    /**
      Sets the email address.
    */
    void setAddress(const AddrSpec &addr);

    /**
      Sets the email address.
    */
    void setAddress(const QByteArray &addr);

    /**
      Sets the name.
    */
    void setName(const QString &name);

    /**
      Sets the name based on a 7bit encoded string.
    */
    void setNameFrom7Bit(const QByteArray &name,
                         const QByteArray &defaultCharset = QByteArray());

    /**
      Returns true if this mailbox has an address.
    */
    bool hasAddress() const;

    /**
      Returns true if this mailbox has a display name.
    */
    bool hasName() const;

    /**
      Returns a assembled display name / address string of the following form:
      "Display Name &lt;address&gt;". These are unicode strings without any
      transport encoding, ie. they are only suitable for displaying.
    */
    QString prettyAddress() const;

    /**
     * Describes how display names should be quoted
     * @since 4.5
     */
    //AK_REVIEW: remove this enum
    enum Quoting {
        QuoteNever,         ///< Don't quote display names at all. Such an unquoted display name can not
        ///  be machine-processed anymore in some cases, for example when it contains
        ///  commas, like in "Lastname, Firstname".
        QuoteWhenNecessary, ///< Only quote display names when they contain characters that need to be
        ///  quoted, like commas or quote signs.
        QuoteAlways         ///< Always quote the display name
    };

    /**
     * Overloaded method that gives more control over the quoting of the display name
     * @param quoting describes how the display name should be quoted
     * @since 4.5
     */
    // TODO: KDE5: BIC: remove other prettyAddress() overload, and make it None the default
    //                  parameter here
    //AK_REVIEW: replace by 'QString quotedAddress() const'
    QString prettyAddress(Quoting quoting) const;

    /**
      Parses the given unicode string.
    */
    void fromUnicodeString(const QString &s);

    /**
      Parses the given 7bit encoded string.
    */
    void from7BitString(const QByteArray &s);

    /**
      Returns a 7bit transport encoded representation of this mailbox.

      @param encCharset The charset used for encoding.
    */
    QByteArray as7BitString(const QByteArray &encCharset) const;

    /**
     * Returns a list of mailboxes from an unicode string.
     *
     * @since 5.14
     */
    static QVector<Mailbox> listFromUnicodeString(const QString &s);

    /**
     * Returns a list of mailboxes from an encoded 7bit string.
     *
     * @since 5.14
     */
    static QVector<Mailbox> listFrom7BitString(const QByteArray &s);

    /**
     * Returns a unicode string representing the given list of mailboxes.
     *
     * @since 5.15
     */
    static QString listToUnicodeString(const QVector<Mailbox> &mailboxes);

private:
    QString mDisplayName;
    AddrSpec mAddrSpec;
};

typedef QVector<Mailbox> MailboxList;

struct KMIME_EXPORT Address {
    QString displayName;
    MailboxList mailboxList;
};
typedef QVector<Address> AddressList;

} // namespace KMime::Types

} // namespace KMime

Q_DECLARE_TYPEINFO(KMime::Types::Mailbox, Q_MOVABLE_TYPE);
Q_DECLARE_TYPEINFO(KMime::Types::Address, Q_MOVABLE_TYPE);
Q_DECLARE_TYPEINFO(KMime::Types::AddrSpec, Q_MOVABLE_TYPE);

#endif // __KMIME_HEADER_PARSING_H__