File indexing completed on 2024-04-21 14:56:00

0001 /* This file is part of the KDE libraries
0002     Copyright (c) 2006 Thiago Macieira <thiago@kde.org>
0003 
0004     This library is free software; you can redistribute it and/or
0005     modify it under the terms of the GNU Library General Public
0006     License as published by the Free Software Foundation; either
0007     version 2 of the License, or (at your option) any later version.
0008 
0009     This library is distributed in the hope that it will be useful,
0010     but WITHOUT ANY WARRANTY; without even the implied warranty of
0011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0012     Library General Public License for more details.
0013 
0014     You should have received a copy of the GNU Library General Public License
0015     along with this library; see the file COPYING.LIB.  If not, write to
0016     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0017     Boston, MA 02110-1301, USA.
0018 */
0019 
0020 #ifndef KUNIQUEAPPLICATION_P_H
0021 #define KUNIQUEAPPLICATION_P_H
0022 
0023 #include <QDBusAbstractAdaptor>
0024 #include <QDBusConnection>
0025 
0026 class Q_DECL_HIDDEN KUniqueApplication::Private
0027 {
0028 public:
0029     Private(KUniqueApplication *q)
0030         : q(q)
0031     {
0032     }
0033 
0034     void _k_newInstanceNoFork();
0035 
0036     static KComponentData initHack(bool configUnique);
0037 
0038     KUniqueApplication *q;
0039     bool processingRequest;
0040     bool firstInstance;
0041 
0042     static bool s_startOwnInstance;
0043     static bool s_multipleInstances;
0044     static bool s_handleAutoStarted;
0045 };
0046 
0047 class KUniqueApplicationAdaptor: public QDBusAbstractAdaptor
0048 {
0049     Q_OBJECT
0050     Q_CLASSINFO("D-Bus Interface", "org.kde.KUniqueApplication")
0051 public:
0052     KUniqueApplicationAdaptor(KUniqueApplication *parent)
0053         : QDBusAbstractAdaptor(parent)
0054     { }
0055 
0056     inline KUniqueApplication *parent() const
0057     {
0058         return static_cast<KUniqueApplication *>(QDBusAbstractAdaptor::parent());
0059     }
0060 
0061 public Q_SLOTS:
0062     int newInstance(const QByteArray &asn_id = QByteArray(), const QByteArray &args = QByteArray());
0063 };
0064 
0065 #endif
0066 
0067 /*
0068  * Local variables:
0069  *  indent-tabs-mode: nil
0070  * End:
0071  */