• Skip to content
  • Skip to link menu
KDE 3.5 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

kdeui

kaboutdialog.h

Go to the documentation of this file.
00001 /*
00002  * This file is part of the KDE Libraries
00003  * Copyright (C) 1999-2001 Mirko Boehm (mirko@kde.org) and
00004  * Espen Sand (espen@kde.org)
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Library General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2 of the License, or (at your option) any later version.
00010  *
00011  * This library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Library General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Library General Public License
00017  * along with this library; see the file COPYING.LIB.  If not, write to
00018  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019  * Boston, MA 02110-1301, USA.
00020  *
00021  */
00022 
00023 /*
00024  * This file declares a class for creating "About ..." dialogs
00025  * in a general way. It provides geometry management and some
00026  * options to connect for, like emailing the author or maintainer.
00027  */
00028 
00029 
00030 #ifndef _KABOUTDIALOG_H_
00031 #define _KABOUTDIALOG_H_
00032 
00033 #include <kdialogbase.h>
00034 #include <qstring.h>
00035 
00036 class QFrame;
00037 class QLabel;
00038 class QVBoxLayout;
00039 class QTabWidget;
00040 class KURLLabel;
00041 class KAboutContainer;
00042 class KAboutContainerBase;
00043 
00044 class KAboutWidgetPrivate;
00045 
00046 class KAboutContainerPrivate;
00050 class KDEUI_EXPORT KAboutContainer : public QFrame
00051 {
00052   Q_OBJECT
00053 
00054   public:
00055     KAboutContainer( QWidget *parent=0, const char *name=0,
00056              int margin=0, int spacing=0,
00057              int childAlignment = AlignCenter,
00058              int innerAlignment = AlignCenter );
00059 
00060     void addWidget( QWidget *widget );
00061     void addPerson( const QString &name, const QString &email,
00062             const QString &url, const QString &task,
00063             bool showHeader = false, bool showframe = false,
00064             bool showBold = false );
00065     void addTitle(  const QString &title, int alignment=AlignLeft,
00066             bool showframe = false, bool showBold = false );
00067     void addImage( const QString &fileName, int alignment=AlignLeft );
00068 
00069     virtual QSize sizeHint( void ) const;
00070     virtual QSize minimumSizeHint( void ) const;
00071 
00072   protected:
00073     virtual void childEvent( QChildEvent *e );
00074 
00075   signals:
00076     void urlClick( const QString &url );
00077     void mailClick( const QString &name, const QString &address );
00078 
00079 
00080   private:
00081     QVBoxLayout *mVbox;
00082     int mAlignment;
00083     KAboutContainerPrivate* const d;
00084 };
00085 
00086 class KAboutContributorPrivate;
00087 
00092 class KDEUI_EXPORT KAboutContributor : public QFrame
00093 {
00094   Q_OBJECT
00095 
00096   public:
00097     KAboutContributor( QWidget *parent=0, const char *name=0,
00098                const QString &username=QString::null,
00099                const QString &email=QString::null,
00100                const QString &url=QString::null,
00101                const QString &work=QString::null,
00102                bool showHeader=false, bool showFrame=true,
00103                bool showBold=false );
00104 
00105     void setName( const QString &text, const QString &header=QString::null,
00106           bool update = true );
00107     void setEmail( const QString &text, const QString &header=QString::null,
00108            bool update = true );
00109     void setURL( const QString &text, const QString &header=QString::null,
00110          bool update = true );
00111     void setWork( const QString &text, const QString &header=QString::null,
00112           bool update = true );
00113     QString getName( void ) const;
00114     QString getEmail( void ) const;
00115     QString getURL( void ) const;
00116     QString getWork( void ) const;
00117 
00118     virtual QSize sizeHint( void ) const;
00119 
00120   protected:
00121     virtual void fontChange( const QFont &oldFont );
00122 
00123   protected slots:
00124     void urlClickedSlot( const QString& );
00125     void emailClickedSlot( const QString& emailaddress );
00126 
00127   private:
00128     void updateLayout( void );
00129 
00130   signals:
00131     void sendEmail(const QString& name, const QString& email);
00132     void openURL(const QString& url);
00133 
00134   private:
00135     QLabel *mLabel[4];
00136     QLabel *mText[4];
00137     bool mShowHeader;
00138     bool mShowBold;
00139 
00140     KAboutContributorPrivate* const d;
00141 
00142     virtual void setName(const char *_name) { QFrame::setName(_name); }
00143 };
00144 
00150 class KDEUI_EXPORT KAboutWidget : public QWidget
00151 {
00152   Q_OBJECT
00153 
00154 public:
00155 
00159   KAboutWidget(QWidget* parent=0, const char* name=0 );
00160 
00165   void adjust();
00166 
00170   void setLogo(const QPixmap&);
00174   void setAuthor(const QString& name, const QString& email,
00175          const QString& url, const QString& work);
00179   void setMaintainer(const QString& name, const QString& email,
00180              const QString& url, const QString& work);
00184   void addContributor(const QString& name, const QString& email,
00185               const QString& url, const QString& work);
00189   void setVersion(const QString& name);
00190   // -------------------------------------------------------------------------
00191 protected slots:
00195   void sendEmailSlot(const QString& name, const QString& email);
00199   void openURLSlot(const QString& url);
00200   // -------------------------------------------------------------------------
00201 signals:
00205   void sendEmail(const QString& name, const QString& email);
00209   void openURL(const QString& url);
00210   // -------------------------------------------------------------------------
00211 protected:
00212   // events:
00216   void resizeEvent(QResizeEvent*);
00220   QLabel *version;
00224   QLabel *cont;
00228   QLabel *logo;
00232   KAboutContributor *author;
00236   KAboutContributor *maintainer;
00240   bool showMaintainer;
00244   QPtrList<KAboutContributor> contributors;
00245   // #########################################################################
00246   //
00247 private:
00248   KAboutWidgetPrivate* const d;
00249 };
00250 
00251 class KAboutDialogPrivate;
00283 class KDEUI_EXPORT KAboutDialog : public KDialogBase
00284 {
00285   Q_OBJECT
00286 
00287   public:
00291     enum LayoutType
00292     {
00293       AbtPlain         = 0x0001,
00294       AbtTabbed        = 0x0002,
00295       AbtTitle         = 0x0004,
00296       AbtImageLeft     = 0x0008,
00297       AbtImageRight    = 0x0010,
00298       AbtImageOnly     = 0x0020,
00299       AbtProduct       = 0x0040,
00300       AbtKDEStandard   = AbtTabbed|AbtTitle|AbtImageLeft,
00301       AbtAppStandard   = AbtTabbed|AbtTitle|AbtProduct,
00302       AbtImageAndTitle = AbtPlain|AbtTitle|AbtImageOnly
00303     };
00304 
00305   public:
00314     KAboutDialog( QWidget *parent=0, const char *name=0, bool modal=true );
00315 
00341     KAboutDialog( int dialogLayout, const QString &caption, int buttonMask,
00342           ButtonCode defaultButton, QWidget *parent=0,
00343           const char *name=0, bool modal=false, bool separator = false,
00344           const QString &user1 = QString::null,
00345           const QString &user2 = QString::null,
00346           const QString &user3 = QString::null );
00347 
00355   void adjust();
00356 
00364   virtual void show( void );
00365 
00374   virtual void show( QWidget *centerParent );
00375 
00382   void setTitle( const QString &title );
00383 
00391   void setImage( const QString &fileName );
00392 
00405   void setIcon( const QString &fileName ) KDE_DEPRECATED; // KDE4: remove
00406 
00412   void setProgramLogo( const QString &fileName );
00413 
00425   void setProgramLogo( const QPixmap &pixmap );
00426 
00435   void setImageBackgroundColor( const QColor &color );
00436 
00444   void setImageFrame( bool state );
00445 
00457   void setProduct( const QString &appName, const QString &version,
00458            const QString &author, const QString &year );
00459 
00472   QFrame *addTextPage( const QString &title, const QString &text,
00473                        bool richText=false, int numLines=10 );
00474 
00485   QFrame *addLicensePage( const QString &title, const QString &text,
00486                           int numLines=10 );
00487 
00500   KAboutContainer *addContainerPage( const QString &title,
00501     int childAlignment = AlignCenter, int innerAlignment = AlignCenter );
00502 
00515   KAboutContainer *addScrolledContainerPage( const QString &title,
00516     int childAlignment = AlignCenter, int innerAlignment = AlignCenter );
00517 
00528   KAboutContainer *addContainer( int childAlignment, int innerAlignment );
00529 
00537   QFrame *addPage( const QString &title );
00538 
00539 
00544   void setLogo(const QPixmap&);
00545 
00550   void setAuthor(const QString& name, const QString& email,
00551          const QString& url, const QString& work);
00552 
00557   void setMaintainer(const QString& name, const QString& email,
00558              const QString& url, const QString& work);
00559 
00564   void addContributor(const QString& name, const QString& email,
00565               const QString& url, const QString& work);
00566 
00571   void setVersion(const QString& name);
00572 
00577   static void imageURL( QWidget *parent, const QString &caption,
00578               const QString &path, const QColor &imageColor,
00579               const QString &url );
00580 
00581 signals:
00588   void sendEmail(const QString& name, const QString& email);
00589 
00593   void openURL(const QString& url);
00594   // ----------------------------------------------------------------------------
00595 protected:
00599   KAboutWidget * about;
00600 
00604   KAboutContainerBase *mContainerBase;
00605 
00606   // -------------------------------------------------------------------------
00607 protected slots:
00608 
00612   void sendEmailSlot(const QString& name, const QString& email);
00613 
00617   void openURLSlot(const QString& url);
00618 
00624   virtual void mouseTrackSlot( int mode, const QMouseEvent *e );
00625 
00626   // #########################################################################
00627 protected:
00628   virtual void virtual_hook( int id, void* data );
00629 private:
00630   KAboutDialogPrivate* const d;
00631 };
00632 
00633 #endif // defined KABOUTDIALOG_H

kdeui

Skip menu "kdeui"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • dcop
  • DNSSD
  • interfaces
  • Kate
  • kconf_update
  • KDECore
  • KDED
  • kdefx
  • KDEsu
  • kdeui
  • KDocTools
  • KHTML
  • KImgIO
  • KInit
  • kio
  • kioslave
  • KJS
  • KNewStuff
  • KParts
  • KUtils
Generated for API Reference by doxygen 1.5.9
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal