aboutwidget.h

Go to the documentation of this file.
00001 /***************************************************************************
00002                           aboutwidget.h  -  description
00003                              -------------------
00004     begin                : Sa Sep 13 2003
00005     copyright            : (C) 2003 by Martin Witte
00006     email                : witte@kawo1.rwth-aachen.de
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 #ifndef KRADIO_ABOUT_WIDGET_H
00019 #define KRADIO_ABOUT_WIDGET_H
00020 
00021 #ifdef HAVE_CONFIG_H
00022 #include <config.h>
00023 #endif
00024 
00025 
00026 #include <qwidget.h>
00027 
00028 /* Unfortunately KDE doesn't provide the class KAboutContainerBase
00029    to public programming, so we have to copy most of that code into
00030    an own class :(
00031 */
00032 
00033 class QFrame;
00034 class KAboutContainer;
00035 class QTabWidget;
00036 class QVBoxLayout;
00037 class KAboutData;
00038 
00039 #include <qlabel.h>
00040 
00041 // copied (and renamed) from kaboutdialog_private.h
00042 // original: KImageTrackLabel
00043 
00044 class KRadioImageTrackLabel : public QLabel
00045 {
00046   Q_OBJECT
00047 
00048   public:
00049     enum MouseMode
00050     {
00051       MousePress = 1,
00052       MouseRelease,
00053       MouseDoubleClick,
00054       MouseMove
00055     };
00056 
00057   public:
00058     KRadioImageTrackLabel( QWidget * parent, const char * name=0, WFlags f=0 );
00059 
00060   signals:
00061     void mouseTrack( int mode, const QMouseEvent *e );
00062 
00063   protected:
00064     virtual void mousePressEvent( QMouseEvent *e );
00065     virtual void mouseReleaseEvent( QMouseEvent *e );
00066     virtual void mouseDoubleClickEvent( QMouseEvent *e );
00067     virtual void mouseMoveEvent ( QMouseEvent *e );
00068 };
00069 
00070 // copied (and renamed) from kaboutdialog_private.h
00071 // original: KAboutContainerBase
00072 
00073 class KRadioAboutWidget : public QWidget
00074 {
00075   Q_OBJECT
00076 
00077   public:
00078     enum LayoutType
00079     {
00080       AbtPlain         = 0x0001,
00081       AbtTabbed        = 0x0002,
00082       AbtTitle         = 0x0004,
00083       AbtImageLeft     = 0x0008,
00084       AbtImageRight    = 0x0010,
00085       AbtImageOnly     = 0x0020,
00086       AbtProduct       = 0x0040,
00087       AbtKDEStandard   = AbtTabbed|AbtTitle|AbtImageLeft,
00088       AbtAppStandard   = AbtTabbed|AbtTitle|AbtProduct,
00089       AbtImageAndTitle = AbtPlain|AbtTitle|AbtImageOnly
00090     };
00091 
00092   public:
00093     KRadioAboutWidget(const KAboutData &abtData, int layoutType, QWidget *parent = 0, char *name = 0);
00094     virtual void show( void );
00095     virtual QSize sizeHint( void ) const;
00096 
00097     void setAboutData(const KAboutData &abtData);
00098 
00099     void setTitle( const QString &title );
00100     void setImage( const QString &fileName );
00101     void setImageBackgroundColor( const QColor &color );
00102     void setImageFrame( bool state );
00103     void setProduct( const QString &appName, const QString &version,
00104              const QString &author, const QString &year );
00105 
00106     QFrame *addTextPage( const QString &title, const QString &text,
00107              bool richText=false, int numLines=10 );
00108     QFrame *addLicensePage( const QString &title, const QString &text,
00109              int numLines=10 );
00110     KAboutContainer *addContainerPage( const QString &title,
00111       int childAlignment = AlignCenter, int innerAlignment = AlignCenter );
00112     KAboutContainer *addScrolledContainerPage( const QString &title,
00113       int childAlignment = AlignCenter, int innerAlignment = AlignCenter );
00114 
00115     QFrame *addEmptyPage( const QString &title );
00116 
00117     KAboutContainer *addContainer( int childAlignment, int innerAlignment );
00118 
00119   public slots:
00120     virtual void slotMouseTrack( int mode, const QMouseEvent *e );
00121     virtual void slotUrlClick( const QString &url );
00122     virtual void slotMailClick( const QString &name, const QString &address );
00123 
00124   protected:
00125     virtual void fontChange( const QFont &oldFont );
00126 
00127   signals:
00128     void mouseTrack( int mode, const QMouseEvent *e );
00129     void urlClick( const QString &url );
00130     void mailClick( const QString &name, const QString &address );
00131 
00132   private:
00133     QMemArray<QWidget*>  mContainerList;
00134 
00135     QVBoxLayout *mTopLayout;
00136     KRadioImageTrackLabel *mImageLabel;
00137     QLabel  *mTitleLabel;
00138     QLabel  *mIconLabel;
00139     QLabel  *mVersionLabel;
00140     QLabel  *mAuthorLabel;
00141     QFrame  *mImageFrame;
00142     QTabWidget *mPageTab;
00143     QFrame  *mPlainSpace;
00144 };
00145 
00146 
00147 #endif
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 28 Jan 2011 for kradio by  doxygen 1.6.1