File indexing completed on 2024-04-21 04:43:22

0001 /*
0002     This file is part of the Polkit-qt project
0003     SPDX-FileCopyrightText: 2009 Radek Novacek <rnovacek@redhat.com>
0004 
0005     SPDX-License-Identifier: LGPL-2.0-or-later
0006 */
0007 
0008 #ifndef POLKITQT1_DETAILS_H
0009 #define POLKITQT1_DETAILS_H
0010 
0011 #include "polkitqt1-core-export.h"
0012 
0013 #include <QObject>
0014 #include <QSharedData>
0015 
0016 typedef struct _PolkitDetails PolkitDetails;
0017 
0018 /**
0019  * \namespace PolkitQt1 PolkitQt
0020  *
0021  * \brief Namespace wrapping Polkit-Qt classes
0022  *
0023  * This namespace wraps all Polkit-Qt classes.
0024  */
0025 namespace PolkitQt1
0026 {
0027 
0028 /**
0029  * \class Details polkitqt1-details.h Details
0030  * \author Radek Novacek <rnovacek@redhat.com>
0031  *
0032  * \brief Class used for passing details around.
0033  */
0034 class POLKITQT1_CORE_EXPORT Details
0035 {
0036 public:
0037     /**
0038      * Creates a new Details object
0039      */
0040     Details();
0041 
0042     /**
0043      * Creates Details object from PolkitDetails
0044      *
0045      * \warning Use this only if you are completely aware of what are you doing!
0046      *
0047      * \param pkDetails PolkitDetails object
0048      */
0049     explicit Details(PolkitDetails *pkDetails);
0050 
0051     /**
0052      * Copy constructor.
0053      */
0054     Details(const Details &other);
0055 
0056     ~Details();
0057 
0058     Details &operator=(const Details &other);
0059 
0060     /**
0061      * Get the value for \p key
0062      *
0063      * \param key A key
0064      * \return Value of the key \p key, otherwise empty QString.
0065      */
0066     QString lookup(const QString &key) const;
0067 
0068     /**
0069      * Inserts key \p key with value \p value.
0070      *
0071      * \param key A key.
0072      * \param value A value.
0073      */
0074     void insert(const QString &key, const QString &value);
0075 
0076     /**
0077      * Gets a list of all keys.
0078      *
0079      * \return List of all keys.
0080      */
0081     QStringList keys() const;
0082 private:
0083     class Data;
0084     QExplicitlySharedDataPointer< Data > d;
0085 };
0086 
0087 }
0088 
0089 #endif // DETAILS_H