SilentEye 0.4.1

mediawidget.h

Go to the documentation of this file.
00001 //  This file is part of SilentEye.
00002 //
00003 //  SilentEye is free software: you can redistribute it and/or modify
00004 //  it under the terms of the GNU General Public License as published by
00005 //  the Free Software Foundation, either version 3 of the License, or
00006 //  (at your option) any later version.
00007 //
00008 //  SilentEye is distributed in the hope that it will be useful,
00009 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00011 //  GNU General Public License for more details.
00012 //
00013 //  You should have received a copy of the GNU General Public License
00014 //  along with SilentEye.  If not, see <http://www.gnu.org/licenses/>.
00015 
00016 #ifndef MEDIAWIDGET_H_
00017 #define MEDIAWIDGET_H_
00018 
00019 #include <QWidget>
00020 #include <QPixmap>
00021 #include <QMenu>
00022 #include <QContextMenuEvent>
00023 #include "ui_mediawidget.h"
00024 
00026 namespace SilentEye {
00027 
00029     class MediaWidget : public QWidget, public Ui::MediaWidget
00030     {
00031         Q_OBJECT;
00032 
00033     private:
00034         QMenu* m_menu;
00035         QSize m_size;
00036         bool m_hasImg;
00037         QString m_filepath;
00038 
00039     public:
00040         MediaWidget(QWidget* parent=0, QString filepath="");
00041         ~MediaWidget();
00042 
00043         void setPixmap(const QPixmap, bool=true);
00044         void setText(const QString);
00045         void setFilepath(const QString);
00046         void setContextMenu(QMenu*);
00047 
00048         void showPlayer(bool);
00049         void contextMenuEvent(QContextMenuEvent*);
00050         QString filepath() const;
00051 
00052         void updateImageSize();
00053         void resizeEvent(QResizeEvent*);
00054 
00055     signals:
00056         void play();
00057         void stop();
00058 
00059     private slots:
00060         void playPressed();
00061         void stopPressed();
00062 
00063     };
00064 
00065 }
00066 
00067 #endif
00068