~ubuntu-branches/ubuntu/gutsy/kdebase-workspace/gutsy-backports

« back to all changes in this revision

Viewing changes to kicker/applets/media/mediumbutton.h

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2007-10-31 19:16:54 UTC
  • Revision ID: james.westby@ubuntu.com-20071031191654-xuof6e1jg6uxqaze
Tags: 3.95.0-0ubuntu1~gutsy1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* This file is part of the KDE project
2
 
   Copyright (c) 2004 Kevin Ottens <ervin ipsquad net>
3
 
 
4
 
   This library is free software; you can redistribute it and/or
5
 
   modify it under the terms of the GNU Library General Public
6
 
   License as published by the Free Software Foundation; either
7
 
   version 2 of the License, or (at your option) any later version.
8
 
 
9
 
   This library is distributed in the hope that it will be useful,
10
 
   but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12
 
   Library General Public License for more details.
13
 
 
14
 
   You should have received a copy of the GNU Library General Public License
15
 
   along with this library; see the file COPYING.LIB.  If not, write to
16
 
   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17
 
   Boston, MA 02110-1301, USA.
18
 
*/
19
 
 
20
 
#ifndef MEDIUMBUTTON_H
21
 
#define MEDIUMBUTTON_H
22
 
 
23
 
#include <panelbutton.h>
24
 
#include <QPoint>
25
 
 
26
 
#include <QPixmap>
27
 
#include <QCursor>
28
 
#include <QTimer>
29
 
#include <kfileitem.h>
30
 
#include <kpanelapplet.h>
31
 
#include <kactioncollection.h>
32
 
 
33
 
class MediumButton : public PanelPopupButton
34
 
{
35
 
Q_OBJECT
36
 
 
37
 
public:
38
 
        MediumButton(QWidget *parent, const KFileItem &fileItem);
39
 
        ~MediumButton();
40
 
        const KFileItem &fileItem() const;
41
 
        void setFileItem(const KFileItem &fileItem);
42
 
        void setPanelPosition(Plasma::Position position);
43
 
 
44
 
protected:
45
 
        QString tileName();
46
 
        void refreshType();
47
 
        void initPopup();
48
 
        void dragEnterEvent( QDragEnterEvent* );
49
 
        void dragLeaveEvent( QDragLeaveEvent* );
50
 
        void dropEvent(QDropEvent *e);
51
 
 
52
 
protected Q_SLOTS:
53
 
        // Activate this code only if we find a way to have both an
54
 
        // action and a popup menu for the same kicker button
55
 
        //void slotClicked();
56
 
        void slotPaste();
57
 
        void slotCopy();
58
 
        void slotDragOpen();
59
 
 
60
 
private:
61
 
        KActionCollection mActions;
62
 
        KFileItem mFileItem;
63
 
        QTimer mOpenTimer;
64
 
};
65
 
 
66
 
#endif