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

tdeui

  • tdeui
kdialogbase.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 * Holger Freyther <freyther@kde.org>
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details.
16 *
17 * You should have received a copy of the GNU Library General Public License
18 * along with this library; see the file COPYING.LIB. If not, write to
19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 * Boston, MA 02110-1301, USA.
21 *
22 */
23#ifndef _KDIALOG_BASE_H_
24#define _KDIALOG_BASE_H_
25
26#include <kdialog.h>
27#include <kjanuswidget.h>
28#include <kguiitem.h>
29#include <kstdguiitem.h>
30#include <tqptrlist.h>
31
32class TQPushButton;
33class KSeparator;
34class KURLLabel;
35class TQBoxLayout;
36class TQPixmap;
37class KGuiItem;
42class KDialogBaseButton;
43
48class KDialogBaseTile;
49
191class TDEUI_EXPORT KDialogBase : public KDialog
192{
193 TQ_OBJECT
194
195 public:
196
197 enum ButtonCode
198 {
199 Help = 0x00000001,
200 Default = 0x00000002,
201 Ok = 0x00000004,
202 Apply = 0x00000008,
203 Try = 0x00000010,
204 Cancel = 0x00000020,
205 Close = 0x00000040,
206 User1 = 0x00000080,
207 User2 = 0x00000100,
208 User3 = 0x00000200,
209 No = 0x00000080,
210 Yes = 0x00000100,
211 Details = 0x00000400,
212 Filler = 0x40000000,
213 Stretch = 0x80000000,
214 NoDefault
215 };
216
217 enum ActionButtonStyle
218 {
219 ActionStyle0=0, // KDE std
220 ActionStyle1,
221 ActionStyle2,
222 ActionStyle3,
223 ActionStyle4,
224 ActionStyleMAX
225 };
226
237 enum DialogType
238 {
239 TreeList = KJanusWidget::TreeList,
240 Tabbed = KJanusWidget::Tabbed,
241 Plain = KJanusWidget::Plain,
242 Swallow = KJanusWidget::Swallow,
243 IconList = KJanusWidget::IconList
244 };
245
246 public:
247
270 KDialogBase( TQWidget *parent=0, const char *name=0, bool modal=true,
271 const TQString &caption=TQString::null,
272 int buttonMask=Ok|Apply|Cancel, ButtonCode defaultButton=Ok,
273 bool separator=false,
274 const KGuiItem &user1=KGuiItem(),
275 const KGuiItem &user2=KGuiItem(),
276 const KGuiItem &user3=KGuiItem() );
277
305 KDialogBase( int dialogFace, const TQString &caption,
306 int buttonMask, ButtonCode defaultButton,
307 TQWidget *parent=0, const char *name=0, bool modal=true,
308 bool separator=false,
309 const KGuiItem &user1=KGuiItem(),
310 const KGuiItem &user2=KGuiItem(),
311 const KGuiItem &user3=KGuiItem() );
312
313
341 KDialogBase( KDialogBase::DialogType dialogFace, WFlags f,
342 TQWidget *parent=0, const char *name=0, bool modal=true,
343 const TQString &caption=TQString::null,
344 int buttonMask=Ok|Apply|Cancel, ButtonCode defaultButton=Ok,
345 bool separator=false,
346 const KGuiItem &user1=KGuiItem(),
347 const KGuiItem &user2=KGuiItem(),
348 const KGuiItem &user3=KGuiItem() );
349
381 KDialogBase( const TQString &caption, int buttonMask=Yes|No|Cancel,
382 ButtonCode defaultButton=Yes, ButtonCode escapeButton=Cancel,
383 TQWidget *parent=0, const char *name=0,
384 bool modal=true, bool separator=false,
385 const KGuiItem &yes = KStdGuiItem::yes(), // i18n("&Yes")
386 const KGuiItem &no = KStdGuiItem::no(), // i18n("&No"),
387 const KGuiItem &cancel = KStdGuiItem::cancel() // i18n("&Cancel")
388 );
389
393 ~KDialogBase();
394
405 void setButtonBoxOrientation( int orientation );
406
418 void setEscapeButton( ButtonCode id );
419
420
428 virtual void adjustSize();
429 virtual TQSize sizeHint() const;
430 virtual TQSize minimumSizeHint() const;
431
442 TQFrame *plainPage();
443
471 TQFrame *addPage( const TQString &itemName,
472 const TQString &header=TQString::null,
473 const TQPixmap &pixmap=TQPixmap() );
474
486 TQFrame *addPage( const TQStringList &items,
487 const TQString &header=TQString::null,
488 const TQPixmap &pixmap=TQPixmap() );
489
514 TQVBox *addVBoxPage( const TQString &itemName,
515 const TQString &header=TQString::null,
516 const TQPixmap &pixmap=TQPixmap() );
517
529 TQVBox *addVBoxPage( const TQStringList &items,
530 const TQString &header=TQString::null,
531 const TQPixmap &pixmap=TQPixmap() );
532
551 TQHBox *addHBoxPage( const TQString &itemName,
552 const TQString &header=TQString::null,
553 const TQPixmap &pixmap=TQPixmap() );
554
566 TQHBox *addHBoxPage( const TQStringList &items,
567 const TQString &header=TQString::null,
568 const TQPixmap &pixmap=TQPixmap() );
569
590 TQGrid *addGridPage( int n, Orientation dir,
591 const TQString &itemName,
592 const TQString &header=TQString::null,
593 const TQPixmap &pixmap=TQPixmap() );
594
595
607 TQGrid *addGridPage( int n, Orientation dir,
608 const TQStringList &items,
609 const TQString &header=TQString::null,
610 const TQPixmap &pixmap=TQPixmap() );
611
612
619 void setFolderIcon(const TQStringList &path,const TQPixmap &pixmap);
620
634 TQFrame *makeMainWidget();
635
649 TQVBox *makeVBoxMainWidget();
650
664 TQHBox *makeHBoxMainWidget();
665
683 TQGrid *makeGridMainWidget( int n, Orientation dir );
684
685
690 void enableButtonSeparator( bool state );
691
702 void showButton( ButtonCode id, bool state );
703
712 void showButtonOK( bool state );
713
722 void showButtonApply( bool state );
723
730 void showButtonCancel( bool state );
731
742 bool showPage( int index );
743
752 int activePageIndex() const;
753
754
771 int pageIndex( TQWidget *widget ) const;
772
773
786 void setMainWidget( TQWidget *widget );
787
793 TQWidget *mainWidget();
794
802 void disableResize();
803
815 void setInitialSize( const TQSize &s, bool noResize=false );
816
827 void incInitialSize( const TQSize &s, bool noResize=false );
828
836 TQSize configDialogSize( const TQString& groupName ) const;
837
847 TQSize configDialogSize( TDEConfig& config, const TQString& groupName ) const;
848
858 void saveDialogSize( const TQString& groupName, bool global=false );
859
870 void saveDialogSize( TDEConfig& config, const TQString& groupName,
871 bool global=false ) const;
872
882 void setButtonOK( const KGuiItem &item = KStdGuiItem::ok() );
883
899 void setButtonOKText( const TQString &text=TQString::null,
900 const TQString &tooltip=TQString::null,
901 const TQString &quickhelp=TQString::null ) TDE_DEPRECATED;
902
912 void setButtonApply( const KGuiItem &item = KStdGuiItem::apply() );
913
929 void setButtonApplyText( const TQString &text=TQString::null,
930 const TQString &tooltip=TQString::null,
931 const TQString &quickhelp=TQString::null ) TDE_DEPRECATED;
932
942 void setButtonCancel( const KGuiItem &item = KStdGuiItem::cancel() );
943
957 void setButtonCancelText( const TQString &text=TQString::null,
958 const TQString &tooltip=TQString::null,
959 const TQString &quickhelp=TQString::null ) TDE_DEPRECATED;
960
967 void setButtonText( ButtonCode id, const TQString &text );
968
975 void setButtonTip( ButtonCode id, const TQString &text );
976
983 void setButtonWhatsThis( ButtonCode id, const TQString &text );
984
996 void setButtonGuiItem( ButtonCode id, const KGuiItem &item );
997
1008 void setTreeListAutoResize( bool state );
1009
1022 void setShowIconsInTreeList(bool state);
1023
1032 void setRootIsDecorated( bool state );
1033
1047 void unfoldTreeList( bool persist = false );
1048
1057 void addWidgetBelowList( TQWidget * widget );
1058
1069 void addButtonBelowList( const TQString & text, TQObject * recv, const char * slot );
1070
1082 void addButtonBelowList( const KGuiItem & guiitem, TQObject * recv, const char * slot );
1083
1096 void setIconListAllVisible( bool state );
1097
1103 static bool haveBackgroundTile();
1104
1111 static const TQPixmap *backgroundTile();
1116 static const TQPixmap *getBackgroundTile() TDE_DEPRECATED;
1117
1125 static void setBackgroundTile( const TQPixmap *pix );
1126
1132 void showTile( bool state );
1133
1145 void getBorderWidths( int& ulx, int& uly, int& lrx, int& lry ) const TDE_DEPRECATED;
1146
1158 TQRect getContentsRect() const TDE_DEPRECATED;
1159
1177 TQSize calculateSize( int w, int h ) const;
1178
1187 TQString helpLinkText() const;
1188
1202 TQPushButton *actionButton( ButtonCode id );
1203
1204 public slots:
1211 void enableButton( ButtonCode id, bool state );
1212
1218 void enableButtonOK( bool state );
1219
1225 void enableButtonApply( bool state );
1226
1232 void enableButtonCancel( bool state );
1233
1239 void enableLinkedHelp( bool state );
1240
1250 void delayedDestruct();
1251
1260 void setHelpLinkText( const TQString &text );
1261
1274 void setHelp( const TQString &anchor,
1275 const TQString &appname = TQString::null );
1276
1280 void helpClickedSlot( const TQString & );
1281
1285 void setDetails(bool showDetails);
1286
1293 void setDetailsWidget(TQWidget *detailsWidget);
1294
1299 void updateBackground();
1300
1309 void cancel();
1310
1311 signals:
1316 void helpClicked();
1317
1322 void defaultClicked();
1323
1324
1329 void user3Clicked();
1330
1335 void user2Clicked();
1336
1341 void user1Clicked();
1342
1347 void applyClicked();
1348
1353 void tryClicked();
1354
1359 void okClicked();
1360
1365 void yesClicked();
1366
1371 void noClicked();
1372
1377 void cancelClicked();
1378
1383 void closeClicked();
1384
1389 void apply();
1390
1394 void backgroundChanged();
1395
1403 void hidden();
1404
1419 void finished();
1420
1425 void aboutToShowDetails();
1426
1431 void aboutToShowPage(TQWidget *page);
1432
1433 protected:
1439 virtual void keyPressEvent( TQKeyEvent *e );
1440
1445 virtual void hideEvent( TQHideEvent * );
1446
1453 virtual void closeEvent( TQCloseEvent *e );
1454
1455 protected slots:
1460 virtual void slotHelp();
1461
1465 virtual void slotDefault();
1466
1471 virtual void slotDetails();
1472
1476 virtual void slotUser3();
1477
1481 virtual void slotUser2();
1482
1486 virtual void slotUser1();
1487
1492 virtual void slotOk();
1493
1497 virtual void slotApply();
1498
1502 virtual void slotTry();
1503
1508 virtual void slotYes();
1509
1514 virtual void slotNo();
1515
1521 virtual void slotCancel();
1522
1527 virtual void slotClose();
1528
1534 virtual void applyPressed();
1535
1539 void updateGeometry();
1540
1548 void slotDelayedDestruct();
1549
1550 private:
1554 void setupLayout();
1555
1561 void makeRelay();
1562
1575 void makeButtonBox( int mask, ButtonCode defaultButton,
1576 const KGuiItem &user1 = KGuiItem(),
1577 const KGuiItem &user2 = KGuiItem(),
1578 const KGuiItem &user3 = KGuiItem() );
1579
1587 void setButtonFocus( TQPushButton *p, bool isDefault, bool isFocus );
1588
1594 void printMakeMainWidgetError();
1595
1596 private slots:
1602 void setButtonStyle( int style );
1603
1604
1605 private:
1606 TQBoxLayout *mTopLayout;
1607 TQWidget *mMainWidget;
1608 KURLLabel *mUrlHelp;
1609 KJanusWidget *mJanus;
1610 KSeparator *mActionSep;
1611
1612 bool mIsActivated;
1613
1614 TQString mAnchor;
1615 TQString mHelpApp;
1616 TQString mHelpLinkText;
1617
1618 static KDialogBaseTile *mTile;
1619 bool mShowTile;
1620
1621 bool mMessageBoxMode;
1622 int mButtonOrientation;
1623 ButtonCode mEscapeButton;
1624
1625 protected:
1626 virtual void virtual_hook( int id, void* data );
1627 private:
1628 class KDialogBasePrivate;
1629 KDialogBasePrivate* const d;
1630};
1631
1632#endif
KDialogBaseButton
Used internally by KDialogBase.
Definition: kdialogbase_priv.h:32
KDialogBaseTile
Used internally by KDialogBase.
Definition: kdialogbase_priv.h:49
KDialogBase
A dialog base class with standard buttons and predefined layouts.
Definition: kdialogbase.h:192
KDialogBase::ButtonCode
ButtonCode
Definition: kdialogbase.h:198
KDialogBase::DialogType
DialogType
Definition: kdialogbase.h:238
KDialog
Dialog with extended non-modal support and methods for KDE standard compliance.
Definition: kdialog.h:53
KGuiItem
An abstract class for GUI data such as ToolTip and Icon.
Definition: kguiitem.h:39
KJanusWidget
Easy to use widget with many layouts.
Definition: kjanuswidget.h:68
KJanusWidget::Swallow
@ Swallow
The Swallow face is provided in order to simplify the usage of existing widgets and to allow changing...
Definition: kjanuswidget.h:125
KJanusWidget::Plain
@ Plain
The Plain face provides an empty widget (TQFrame) where you can place your widgets.
Definition: kjanuswidget.h:117
KJanusWidget::IconList
@ IconList
The IconList face provides an icon list in the left area and pages in the right.
Definition: kjanuswidget.h:133
KJanusWidget::Tabbed
@ Tabbed
The Tabbed face is a common tabbed widget.
Definition: kjanuswidget.h:111
KJanusWidget::TreeList
@ TreeList
The TreeList face provides a list in the left area and pages in the right.
Definition: kjanuswidget.h:104
KSeparator
Standard horizontal or vertical separator.
Definition: kseparator.h:34
KURLLabel
A drop-in replacement for TQLabel that displays hyperlinks.
Definition: kurllabel.h:72
TDEConfig

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.4
This website is maintained by Timothy Pearson.