File indexing completed on 2024-11-03 12:34:39

0001 /*
0002     SPDX-FileCopyrightText: 2022 Volker Krause <vkrause@kde.org>
0003     SPDX-License-Identifier: LGPL-2.0-or-later
0004 */
0005 
0006 #ifndef KCONTACTS_ADDRESSFORMAT_P_H
0007 #define KCONTACTS_ADDRESSFORMAT_P_H
0008 
0009 #include "addressformat.h"
0010 
0011 #include <QSharedData>
0012 
0013 namespace KContacts
0014 {
0015 
0016 class AddressFormatElementPrivate : public QSharedData
0017 {
0018 public:
0019     static inline AddressFormatElementPrivate *get(const AddressFormatElement &elem)
0020     {
0021         return elem.d.data();
0022     }
0023 
0024     AddressFormatField field = AddressFormatField::NoField;
0025     QString literal;
0026 };
0027 
0028 class AddressFormatPrivate : public QSharedData
0029 {
0030 public:
0031     static inline AddressFormatPrivate *get(const AddressFormat &format)
0032     {
0033         return format.d.data();
0034     }
0035 
0036     AddressFormatFields upper = AddressFormatField::NoField;
0037     AddressFormatFields required = AddressFormatField::NoField;
0038     std::vector<AddressFormatElement> elements;
0039     QString postalCodeFormat;
0040     QString country;
0041 };
0042 
0043 }
0044 
0045 #endif // KCONTACTS_ADDRESSFORMAT_P_H