~ubuntu-branches/ubuntu/edgy/psi/edgy

« back to all changes in this revision

Viewing changes to libpsi/psiwidgets/iconaction.h

  • Committer: Bazaar Package Importer
  • Author(s): Stephan Hermann
  • Date: 2005-09-14 16:33:49 UTC
  • mfrom: (2.1.1 sarge)
  • Revision ID: james.westby@ubuntu.com-20050914163349-3zacov4afysz5cw5
Tags: 0.9.3-2ubuntu1
* Sync with debian
* Applied patch to psi.desktop to start psi without gpg-agent use (known
  issue)
* Updated README.Debian

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * iconaction.h - the QAction subclass that uses Icons and supports animation
3
 
 * Copyright (C) 2003  Michail Pishchagin
 
3
 * Copyright (C) 2003-2004  Michail Pishchagin
4
4
 *
5
5
 * This library is free software; you can redistribute it and/or
6
6
 * modify it under the terms of the GNU Lesser General Public
26
26
 
27
27
class QToolButton;
28
28
class QPixmap;
 
29
class QIconSet;
29
30
class Icon;
30
31
class IconToolButton;
31
32
 
33
34
{
34
35
        Q_OBJECT
35
36
public:
 
37
        IconAction(QObject *parent, const char *name = 0);
36
38
        IconAction(const QString &text, const QString &icon, const QString &menuText, QKeySequence accel, QObject *parent, const char *name = 0, bool toggle = FALSE);
37
39
        IconAction(const QString &text, const QString &menuText, QKeySequence accel, QObject *parent, const char *name = 0, bool toggle = FALSE);
38
40
        ~IconAction();
39
41
 
40
42
        virtual bool addTo(QWidget *);
41
43
 
 
44
        const Icon *icon() const;
42
45
        void setIcon(const Icon *);
43
46
        void setIcon(const QString &);
44
47
        const QString &iconName() const;
45
48
 
 
49
        QPopupMenu *popup() const;
 
50
        void setPopup( QPopupMenu * );
 
51
 
 
52
        void setIconSet( const QIconSet & );
 
53
        void setVisible( bool );
 
54
 
 
55
        virtual IconAction *copy() const;
 
56
        virtual IconAction &operator=( const IconAction & );
 
57
 
46
58
public slots:
47
59
        void setEnabled(bool);
48
60
        void setOn(bool);
50
62
 
51
63
protected:
52
64
        virtual void addingToolButton(IconToolButton *) { }
 
65
        virtual void addingMenuItem(QPopupMenu *, int id) { Q_UNUSED(id); }
53
66
        QPtrList<IconToolButton> buttonList();
54
67
 
 
68
        QString toolTipFromMenuText() const;
 
69
 
55
70
private slots:
56
71
        void objectDestroyed();
57
72
        void iconUpdated(const QPixmap &);
64
79
        friend class Private;
65
80
};
66
81
 
 
82
class IconActionGroup : public IconAction
 
83
{
 
84
        Q_OBJECT
 
85
public:
 
86
        IconActionGroup(QObject *parent, const char *name = 0, bool exclusive = false);
 
87
        ~IconActionGroup();
 
88
 
 
89
        void setExclusive( bool );
 
90
        bool isExclusive() const;
 
91
 
 
92
        void add( QAction * );
 
93
        void addSeparator();
 
94
 
 
95
        bool addTo( QWidget * );
 
96
 
 
97
        void setUsesDropDown( bool );
 
98
        bool usesDropDown() const;
 
99
 
 
100
        void insertChild( QObject * );
 
101
        void removeChild( QObject * );
 
102
 
 
103
        void addingToolButton(IconToolButton *);
 
104
 
 
105
        IconAction *copy() const;
 
106
 
 
107
public:
 
108
        class Private;
 
109
private:
 
110
        Private *d;
 
111
        friend class Private;
 
112
};
 
113
 
67
114
#endif