~ubuntu-branches/ubuntu/oneiric/kdeplasma-addons/oneiric

« back to all changes in this revision

Viewing changes to applets/fifteenPuzzle/src/fifteenPuzzle.h

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2010-11-26 13:35:18 UTC
  • mfrom: (1.1.37 upstream)
  • Revision ID: james.westby@ubuntu.com-20101126133518-oxz33xjsoi02ty9f
Tags: 4:4.5.80-0ubuntu1
* New upstream beta release
* Disable kubuntu_02_microblog_default_configuration.diff does not apply
* New package plasma-containments-addons

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
#ifndef FIFTEENPUZZLE_H
21
21
#define FIFTEENPUZZLE_H
22
22
 
23
 
#include <plasma/applet.h>
 
23
#include <plasma/popupapplet.h>
 
24
#include <Plasma/Label>
 
25
#include <Plasma/PushButton>
 
26
 
 
27
#include <QGraphicsWidget>
 
28
#include <QTimer>
24
29
 
25
30
#include "fifteen.h"
26
 
#include "fifteenPuzzleConfig.h"
 
31
#include "ui_fifteenPuzzleConfig.h"
27
32
 
28
 
class FifteenPuzzle : public Plasma::Applet
 
33
class FifteenPuzzle : public Plasma::PopupApplet
29
34
{
30
35
  Q_OBJECT
31
36
  public:
32
37
    FifteenPuzzle(QObject *parent, const QVariantList &args);
33
38
 
34
39
    void init();
35
 
    void constraintsEvent(Plasma::Constraints constraints);
36
40
    virtual QList<QAction*> contextualActions();
 
41
    virtual QGraphicsWidget* graphicsWidget();
37
42
  protected slots:
38
43
    void configAccepted();
 
44
    
 
45
  public slots:
 
46
    void configChanged();
39
47
 
40
48
  private:
41
 
    void updateBoard();
 
49
    void updateTimerLabel();
42
50
    void createMenu();
43
 
 
 
51
    QGraphicsWidget *m_graphicsWidget;
 
52
    QPixmap *m_pixmap;
44
53
    Fifteen *m_board;
45
 
    FifteenPuzzleConfig *m_configDialog;
46
54
    QList<QAction *> m_actions;
 
55
    QTimer m_timer;
 
56
    int m_seconds;
 
57
    Plasma::Label *m_timeLabel;
 
58
    Plasma::PushButton *m_shuffleButton;
47
59
    bool m_usePlainPieces;
48
60
    QString m_imagePath;
49
61
    bool m_showNumerals;
 
62
    Ui::fifteenPuzzleConfig ui;
50
63
 
51
64
  private slots:
52
65
    void createConfigurationInterface(KConfigDialog *parent);
 
66
    void startTimer();
 
67
    void updateTimer();
 
68
    void cancelTimer();
53
69
};
54
70
 
55
71
K_EXPORT_PLASMA_APPLET(fifteenPuzzle, FifteenPuzzle)