Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

customaction.h 1.79 KB
Newer Older
1 2 3 4 5
/***************************************************************************
                           customaction.h  -  description
                             -------------------
    begin                : Wed Feb 6 2002
    copyright            : (C) 2002 by Scott Wheeler
6
    email                : wheeler@kde.org
7
***************************************************************************/
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef CUSTOMACTION_H
#define CUSTOMACTION_H

#include <kaction.h>
#include <ktoolbar.h>

#include <qstring.h>
#include <qobject.h>

27 28 29 30
// Many months after writing this, despite having felt rather clever at the time
// I am now rather convinced that this is The Wrong Way (tm) to have handled 
// things and will hopefully un-hack this later.

31
class CustomAction : public KAction
32
{
33 34 35
    Q_OBJECT
public:
    CustomAction(const QString &text, QObject *parent, const char *name);
36
    virtual ~CustomAction();
37

38 39
    virtual int plug(QWidget *parent, int index = -1);
    virtual void unplug(QWidget *widget);
40 41

protected:
42
    KToolBar *getToolBar();
43

44 45
    QWidget *customWidget;
    KToolBar *toolbar;
46

47 48
private:
    virtual QWidget *createWidget(QWidget *parent) = 0;
49 50

signals:
51
    void pluggedIn(QWidget *parent);
52 53 54 55

};

#endif