File indexing completed on 2024-04-28 11:44:27

0001 /*
0002     This file is part of the KDE libraries
0003     SPDX-FileCopyrightText: 1999 Torben Weis <weis@kde.org>
0004     SPDX-FileCopyrightText: 2006 David Faure <faure@kde.org>
0005 
0006     SPDX-License-Identifier: LGPL-2.0-or-later
0007 */
0008 
0009 #ifndef KSERVICETYPEPROFILE_P_H
0010 #define KSERVICETYPEPROFILE_P_H
0011 
0012 #include <QMap>
0013 
0014 /**
0015  * @internal
0016  */
0017 class KServiceTypeProfileEntry
0018 {
0019 public:
0020     explicit KServiceTypeProfileEntry()
0021     {
0022     }
0023 
0024     /**
0025      * Add a service to this profile.
0026      * @param _service the name of the service
0027      * @param _preference the user's preference value, must be positive,
0028      *              bigger is better
0029      * @param _allow_as_default true if the service should be used as
0030      *                 default
0031      */
0032     void addService(const QString &service, int preference = 1)
0033     {
0034         m_mapServices.insert(service, preference);
0035     }
0036 
0037     /**
0038      * Map of all services for which we have assessments.
0039      * Key: service ID
0040      * Value: preference
0041      */
0042     QMap<QString, int> m_mapServices;
0043 };
0044 
0045 #endif /* KSERVICETYPEPROFILE_P_H */