Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++
3.0 KB
Raw Blame
/* This file is part of the KDE project
   SPDX-FileCopyrightText: 2001 Ian Reinhart Geiser <[email protected]>
   SPDX-FileCopyrightText: 2006 Thiago Macieira <[email protected]>

   SPDX-License-Identifier: LGPL-2.0-or-later
*/

#ifndef KMAINWINDOWIFACE_P_H
#define KMAINWINDOWIFACE_P_H

#include <QDBusAbstractAdaptor>
#include <QMap>

class KXmlGuiWindow;

/**
 * @short D-Bus interface to KisKMainWindow.
 *
 * This is the main interface to the KisKMainWindow.  This will provide a consistent
 * D-Bus interface to all KDE applications that use it.
 *
 * @author Ian Reinhart Geiser <[email protected]>
 */
class KisKMainWindowInterface : public QDBusAbstractAdaptor
{
    Q_OBJECT
    Q_CLASSINFO("D-Bus Interface", "org.kde.KisKMainWindow")

public:
    /**
    Construct a new interface object.
    @param mainWindow - The parent KisKMainWindow object
    that will provide us with the KAction objects.
    */
    KisKMainWindowInterface(KXmlGuiWindow *mainWindow);
    /**
    Destructor
    Cleans up the dcop action proxy object.
    **/
    ~KisKMainWindowInterface() override;

public Q_SLOTS:
    /**
    Return a list of actions available to the application's window.
    @return A QStringList containing valid names actions.
    */
    QStringList actions();

    /**
    Activates the requested action.
    @param action The name of the action to activate.  The names of valid
    actions can be found by calling actions().
    @return The success of the operation.
    */
    bool activateAction(const QString &action);

    /**
    Disables the requested action.
    @param action The name of the action to disable.  The names of valid
    actions can be found by calling actions().
    @return The success of the operation.
    */
    bool disableAction(const QString &action);

    /**
    Enables the requested action.
    @param action The name of the action to enable.  The names of valid
    actions can be found by calling actions().
    @return The success of the operation.
    */
    bool enableAction(const QString &action);

    /**
    Returns the status of the requested action.
    @param action The name of the action.  The names of valid
    actions can be found by calling actions().
    @returns The state of the action, true - enabled, false - disabled.
    */
    bool actionIsEnabled(const QString &action);

    /**
    Returns the tool tip text of the requested action.
    @param action The name of the action to activate.  The names of valid
    actions can be found by calling actions().
    @return A QString containing the text of the action's tool tip.
    */
    QString actionToolTip(const QString &action);

    /**
    Returns the ID of the current main window.
    This is useful for automated screen captures or other evil
    widget fun.
    @return A integer value of the main window's ID.
    **/
    qlonglong winId();
    /**
    Copies a pixmap representation of the current main window to
    the clipboard.
    **/
    void grabWindowToClipBoard();
private:
    KXmlGuiWindow *m_MainWindow;
};

#endif // KMAINWINDOWIFACE_P_H