diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | 84da08d7b7fcda12c85caeb5a10b4903770a6f69 (patch) | |
tree | 2a6aea76f2dfffb4cc04bb907c4725af94f70e72 /kicker-applets/mediacontrol/mediacontrol.h | |
download | tdeaddons-84da08d7b7fcda12c85caeb5a10b4903770a6f69.tar.gz tdeaddons-84da08d7b7fcda12c85caeb5a10b4903770a6f69.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeaddons@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kicker-applets/mediacontrol/mediacontrol.h')
-rw-r--r-- | kicker-applets/mediacontrol/mediacontrol.h | 122 |
1 files changed, 122 insertions, 0 deletions
diff --git a/kicker-applets/mediacontrol/mediacontrol.h b/kicker-applets/mediacontrol/mediacontrol.h new file mode 100644 index 0000000..f5a6e5e --- /dev/null +++ b/kicker-applets/mediacontrol/mediacontrol.h @@ -0,0 +1,122 @@ +/*************************************************************************** + main file of mediacontrol applet + ------------------- + begin : Tue Apr 25 11:53:11 CEST 2000 + copyright : (C) 2000-2005 by Stefan Gehn + email : metz {AT} gehn {DOT} net + ***************************************************************************/ + +/*************************************************************************** + * * + * 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 MEDIACONTROL_H +#define MEDIACONTROL_H + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include <klocale.h> +#include <kpanelapplet.h> +#include <kdebug.h> +#include <kstandarddirs.h> +#include <kaboutdata.h> +#include <kaboutapplication.h> + +#include <qpalette.h> + +// used everywhere :) +#include <qstring.h> + +#include "playerInterface.h" +#include "configfrontend.h" +#include "mediacontroliface.h" +#include "simplebutton.h" + +#define MEDIACONTROL_VERSION "0.4" + +class MCSlider; +class KPopupMenu; +class KInstance; +class MediaControlConfig; +class KAboutData; +class MediaControlToolTip; + +// ============================================================================= + +class TrayButton : public SimpleButton +{ + Q_OBJECT + + public: + TrayButton(QWidget* parent, const char* name); + virtual ~TrayButton() {} + void setIconSet(const QIconSet &iconSet); +}; + +// ============================================================================= + +class MediaControl : public KPanelApplet, virtual public MediaControlIface +{ + Q_OBJECT + + public: + MediaControl(const QString&, Type, int ,QWidget * = 0, const char * = 0); + virtual ~MediaControl(); + + int widthForHeight(int height) const; + int heightForWidth(int width) const; + void dragEnterEvent(QDragEnterEvent* event); + void dropEvent(QDropEvent* event); + virtual void reparseConfig(); + + public slots: + void about(); + void preferences(); + void reportBug(); + + private: + KInstance *mInstance; + KAboutData *mAboutData; + DCOPClient *_dcopClient; + PlayerInterface *_player; + ConfigFrontend *_configFrontend; + MediaControlConfig *_prefsDialog; + TrayButton *prev_button; // GoTo Previous Playlist-Item + TrayButton *playpause_button; // Start/Pause playing + TrayButton *stop_button; // Stop the music + TrayButton *next_button; // GoTo Next Playlist-Item + MCSlider *time_slider; + int mLastLen, mLastTime, mLastStatus; + KPopupMenu *rmbMenu; + + virtual void mousePressEvent(QMouseEvent* e); + virtual void moveEvent(QMoveEvent*); + virtual void paletteChange(const QPalette&); + virtual void resizeEvent(QResizeEvent*); + virtual bool eventFilter(QObject *watched, QEvent *e); + + friend class MediaControlToolTip; + MediaControlToolTip *slider_tooltip; + + private slots: + void setSliderPosition(int len, int time); + void slotIconChanged(); + void disableAll(); + void enableAll(); + void slotClosePrefsDialog(); + void slotPrefsDialogClosing(); + void slotConfigChanged(); + void adjustTime(int); + void slotPlayingStatusChanged(int status); + + signals: + void newJumpToTime(int); +}; +#endif |