• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeui
 

tdeui

  • tdeui
tdeaboutdialog.h
1 /*
2  * This file is part of the KDE Libraries
3  * Copyright (C) 1999-2001 Mirko Boehm (mirko@kde.org) and
4  * Espen Sand (espen@kde.org)
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public License
17  * along with this library; see the file COPYING.LIB. If not, write to
18  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  * Boston, MA 02110-1301, USA.
20  *
21  */
22 
23 /*
24  * This file declares a class for creating "About ..." dialogs
25  * in a general way. It provides geometry management and some
26  * options to connect for, like emailing the author or maintainer.
27  */
28 
29 
30 #ifndef _TDEABOUTDIALOG_H_
31 #define _TDEABOUTDIALOG_H_
32 
33 #include <kdialogbase.h>
34 #include <tqstring.h>
35 
36 class TQFrame;
37 class TQLabel;
38 class TQVBoxLayout;
39 class TQTabWidget;
40 class KURLLabel;
41 class TDEAboutContainer;
42 class TDEAboutContainerBase;
43 
44 class TDEAboutWidgetPrivate;
45 
46 class TDEAboutContainerPrivate;
50 class TDEUI_EXPORT TDEAboutContainer : public TQFrame
51 {
52  TQ_OBJECT
53 
54  public:
55  TDEAboutContainer( TQWidget *parent=0, const char *name=0,
56  int margin=0, int spacing=0,
57  int childAlignment = AlignCenter,
58  int innerAlignment = AlignCenter );
59 
60  void addWidget( TQWidget *widget );
61  void addPerson( const TQString &name, const TQString &email,
62  const TQString &url, const TQString &task,
63  bool showHeader = false, bool showframe = false,
64  bool showBold = false );
65  void addTitle( const TQString &title, int alignment=AlignLeft,
66  bool showframe = false, bool showBold = false );
67  void addImage( const TQString &fileName, int alignment=AlignLeft );
68 
69  virtual TQSize sizeHint( void ) const;
70  virtual TQSize minimumSizeHint( void ) const;
71 
72  protected:
73  virtual void childEvent( TQChildEvent *e );
74 
75  signals:
76  void urlClick( const TQString &url );
77  void mailClick( const TQString &name, const TQString &address );
78 
79 
80  private:
81  TQVBoxLayout *mVbox;
82  int mAlignment;
83  TDEAboutContainerPrivate* const d;
84 };
85 
86 class TDEAboutContributorPrivate;
87 
92 class TDEUI_EXPORT TDEAboutContributor : public TQFrame
93 {
94  TQ_OBJECT
95 
96  public:
97  TDEAboutContributor( TQWidget *parent=0, const char *name=0,
98  const TQString &username=TQString::null,
99  const TQString &email=TQString::null,
100  const TQString &url=TQString::null,
101  const TQString &work=TQString::null,
102  bool showHeader=false, bool showFrame=true,
103  bool showBold=false );
104 
105  void setName( const TQString &text, const TQString &header=TQString::null,
106  bool update = true );
107  void setEmail( const TQString &text, const TQString &header=TQString::null,
108  bool update = true );
109  void setURL( const TQString &text, const TQString &header=TQString::null,
110  bool update = true );
111  void setWork( const TQString &text, const TQString &header=TQString::null,
112  bool update = true );
113  TQString getName( void ) const;
114  TQString getEmail( void ) const;
115  TQString getURL( void ) const;
116  TQString getWork( void ) const;
117 
118  virtual TQSize sizeHint( void ) const;
119 
120  protected:
121  virtual void fontChange( const TQFont &oldFont );
122 
123  protected slots:
124  void urlClickedSlot( const TQString& );
125  void emailClickedSlot( const TQString& emailaddress );
126 
127  private:
128  void updateLayout( void );
129 
130  signals:
131  void sendEmail(const TQString& name, const TQString& email);
132  void openURL(const TQString& url);
133 
134  private:
135  TQLabel *mLabel[4];
136  TQLabel *mText[4];
137  bool mShowHeader;
138  bool mShowBold;
139 
140  TDEAboutContributorPrivate* const d;
141 
142  virtual void setName(const char *_name) { TQFrame::setName(_name); }
143 };
144 
150 class TDEUI_EXPORT TDEAboutWidget : public TQWidget
151 {
152  TQ_OBJECT
153 
154 public:
155 
159  TDEAboutWidget(TQWidget* parent=0, const char* name=0 );
160 
165  void adjust();
166 
170  void setLogo(const TQPixmap&);
174  void setAuthor(const TQString& name, const TQString& email,
175  const TQString& url, const TQString& work);
179  void setMaintainer(const TQString& name, const TQString& email,
180  const TQString& url, const TQString& work);
184  void addContributor(const TQString& name, const TQString& email,
185  const TQString& url, const TQString& work);
189  void setVersion(const TQString& name);
190  // -------------------------------------------------------------------------
191 protected slots:
195  void sendEmailSlot(const TQString& name, const TQString& email);
199  void openURLSlot(const TQString& url);
200  // -------------------------------------------------------------------------
201 signals:
205  void sendEmail(const TQString& name, const TQString& email);
209  void openURL(const TQString& url);
210  // -------------------------------------------------------------------------
211 protected:
212  // events:
216  void resizeEvent(TQResizeEvent*);
220  TQLabel *version;
224  TQLabel *cont;
228  TQLabel *logo;
232  TDEAboutContributor *author;
236  TDEAboutContributor *maintainer;
240  bool showMaintainer;
244  TQPtrList<TDEAboutContributor> contributors;
245  // #########################################################################
246  //
247 private:
248  TDEAboutWidgetPrivate* const d;
249 };
250 
251 class TDEAboutDialogPrivate;
283 class TDEUI_EXPORT TDEAboutDialog : public KDialogBase
284 {
285  TQ_OBJECT
286 
287  public:
291  enum LayoutType
292  {
293  AbtPlain = 0x0001,
294  AbtTabbed = 0x0002,
295  AbtTitle = 0x0004,
296  AbtImageLeft = 0x0008,
297  AbtImageRight = 0x0010,
298  AbtImageOnly = 0x0020,
299  AbtProduct = 0x0040,
300  AbtKDEStandard = AbtTabbed|AbtTitle|AbtImageLeft,
301  AbtAppStandard = AbtTabbed|AbtTitle|AbtProduct,
302  AbtImageAndTitle = AbtPlain|AbtTitle|AbtImageOnly
303  };
304 
305  public:
314  TDEAboutDialog( TQWidget *parent=0, const char *name=0, bool modal=true );
315 
341  TDEAboutDialog( int dialogLayout, const TQString &caption, int buttonMask,
342  ButtonCode defaultButton, TQWidget *parent=0,
343  const char *name=0, bool modal=false, bool separator = false,
344  const TQString &user1 = TQString::null,
345  const TQString &user2 = TQString::null,
346  const TQString &user3 = TQString::null );
347 
355  void adjust();
356 
364  virtual void show( void );
365 
374  virtual void show( TQWidget *centerParent );
375 
382  void setTitle( const TQString &title );
383 
391  void setImage( const TQString &fileName );
392 
405  void setIcon( const TQString &fileName ) TDE_DEPRECATED; // KDE4: remove
406 
412  void setProgramLogo( const TQString &fileName );
413 
425  void setProgramLogo( const TQPixmap &pixmap );
426 
435  void setImageBackgroundColor( const TQColor &color );
436 
444  void setImageFrame( bool state );
445 
457  void setProduct( const TQString &appName, const TQString &version,
458  const TQString &author, const TQString &year );
459 
472  TQFrame *addTextPage( const TQString &title, const TQString &text,
473  bool richText=false, int numLines=10 );
474 
485  TQFrame *addLicensePage( const TQString &title, const TQString &text,
486  int numLines=10 );
487 
500  TDEAboutContainer *addContainerPage( const TQString &title,
501  int childAlignment = AlignCenter, int innerAlignment = AlignCenter );
502 
515  TDEAboutContainer *addScrolledContainerPage( const TQString &title,
516  int childAlignment = AlignCenter, int innerAlignment = AlignCenter );
517 
528  TDEAboutContainer *addContainer( int childAlignment, int innerAlignment );
529 
537  TQFrame *addPage( const TQString &title );
538 
539 
544  void setLogo(const TQPixmap&);
545 
550  void setAuthor(const TQString& name, const TQString& email,
551  const TQString& url, const TQString& work);
552 
557  void setMaintainer(const TQString& name, const TQString& email,
558  const TQString& url, const TQString& work);
559 
564  void addContributor(const TQString& name, const TQString& email,
565  const TQString& url, const TQString& work);
566 
571  void setVersion(const TQString& name);
572 
577  static void imageURL( TQWidget *parent, const TQString &caption,
578  const TQString &path, const TQColor &imageColor,
579  const TQString &url );
580 
581 signals:
588  void sendEmail(const TQString& name, const TQString& email);
589 
593  void openURL(const TQString& url);
594  // ----------------------------------------------------------------------------
595 protected:
599  TDEAboutWidget * about;
600 
604  TDEAboutContainerBase *mContainerBase;
605 
606  // -------------------------------------------------------------------------
607 protected slots:
608 
612  void sendEmailSlot(const TQString& name, const TQString& email);
613 
617  void openURLSlot(const TQString& url);
618 
624  virtual void mouseTrackSlot( int mode, const TQMouseEvent *e );
625 
626  // #########################################################################
627 protected:
628  virtual void virtual_hook( int id, void* data );
629 private:
630  TDEAboutDialogPrivate* const d;
631 };
632 
633 #endif // defined TDEABOUTDIALOG_H
KDialogBase
A dialog base class with standard buttons and predefined layouts.
Definition: kdialogbase.h:192
KURLLabel
A drop-in replacement for TQLabel that displays hyperlinks.
Definition: kurllabel.h:72
TDEAboutContainerBase
Used internally by TDEAboutDialog.
Definition: kaboutdialog_private.h:70
TDEAboutContainer
TDEAboutContainer can be used to make a application specific AboutDialog.
Definition: tdeaboutdialog.h:51
TDEAboutContributor
Used internally by TDEAboutWidget.
Definition: tdeaboutdialog.h:93
TDEAboutDialog
A KDialogBase with predefined main widget.
Definition: tdeaboutdialog.h:284
TDEAboutDialog::sendEmail
void sendEmail(const TQString &name, const TQString &email)
Send an email to this person.
TDEAboutDialog::openURL
void openURL(const TQString &url)
Open the selected URL.
TDEAboutDialog::mContainerBase
TDEAboutContainerBase * mContainerBase
The main widget (Constructor II)
Definition: tdeaboutdialog.h:604
TDEAboutDialog::LayoutType
LayoutType
Layout formats.
Definition: tdeaboutdialog.h:292
TDEAboutDialog::about
TDEAboutWidget * about
The main widget (Constructor I)
Definition: tdeaboutdialog.h:599
TDEAboutWidget
TDEAboutWidget is the main widget for TDEAboutDialog.
Definition: tdeaboutdialog.h:151
TDEAboutWidget::logo
TQLabel * logo
The frame showing the logo.
Definition: tdeaboutdialog.h:228
TDEAboutWidget::openURL
void openURL(const TQString &url)
An URL has been clicked.
TDEAboutWidget::cont
TQLabel * cont
The label showing the text "Other contributors:".
Definition: tdeaboutdialog.h:224
TDEAboutWidget::showMaintainer
bool showMaintainer
Show the maintainer?
Definition: tdeaboutdialog.h:240
TDEAboutWidget::author
TDEAboutContributor * author
The application developer.
Definition: tdeaboutdialog.h:232
TDEAboutWidget::maintainer
TDEAboutContributor * maintainer
The application maintainer.
Definition: tdeaboutdialog.h:236
TDEAboutWidget::version
TQLabel * version
The label showing the program version.
Definition: tdeaboutdialog.h:220
TDEAboutWidget::contributors
TQPtrList< TDEAboutContributor > contributors
A set of people who contributed to the application.
Definition: tdeaboutdialog.h:244
TDEAboutWidget::sendEmail
void sendEmail(const TQString &name, const TQString &email)
An email address has been selected by the user.

tdeui

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

tdeui

Skip menu "tdeui"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeui by doxygen 1.9.1
This website is maintained by Timothy Pearson.