23 #ifndef _KDIALOG_BASE_H_
24 #define _KDIALOG_BASE_H_
27 #include <kjanuswidget.h>
29 #include <kstdguiitem.h>
30 #include <tqptrlist.h>
200 Default = 0x00000002,
211 Details = 0x00000400,
213 Stretch = 0x80000000,
217 enum ActionButtonStyle
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,
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,
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,
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(),
386 const KGuiItem &no = KStdGuiItem::no(),
387 const KGuiItem &cancel = KStdGuiItem::cancel()
405 void setButtonBoxOrientation(
int orientation );
418 void setEscapeButton( ButtonCode
id );
428 virtual void adjustSize();
429 virtual TQSize sizeHint()
const;
430 virtual TQSize minimumSizeHint()
const;
442 TQFrame *plainPage();
471 TQFrame *addPage(
const TQString &itemName,
472 const TQString &header=TQString::null,
473 const TQPixmap &pixmap=TQPixmap() );
486 TQFrame *addPage(
const TQStringList &items,
487 const TQString &header=TQString::null,
488 const TQPixmap &pixmap=TQPixmap() );
514 TQVBox *addVBoxPage(
const TQString &itemName,
515 const TQString &header=TQString::null,
516 const TQPixmap &pixmap=TQPixmap() );
529 TQVBox *addVBoxPage(
const TQStringList &items,
530 const TQString &header=TQString::null,
531 const TQPixmap &pixmap=TQPixmap() );
551 TQHBox *addHBoxPage(
const TQString &itemName,
552 const TQString &header=TQString::null,
553 const TQPixmap &pixmap=TQPixmap() );
566 TQHBox *addHBoxPage(
const TQStringList &items,
567 const TQString &header=TQString::null,
568 const TQPixmap &pixmap=TQPixmap() );
590 TQGrid *addGridPage(
int n, Orientation dir,
591 const TQString &itemName,
592 const TQString &header=TQString::null,
593 const TQPixmap &pixmap=TQPixmap() );
607 TQGrid *addGridPage(
int n, Orientation dir,
608 const TQStringList &items,
609 const TQString &header=TQString::null,
610 const TQPixmap &pixmap=TQPixmap() );
619 void setFolderIcon(
const TQStringList &path,
const TQPixmap &pixmap);
634 TQFrame *makeMainWidget();
649 TQVBox *makeVBoxMainWidget();
664 TQHBox *makeHBoxMainWidget();
683 TQGrid *makeGridMainWidget(
int n, Orientation dir );
690 void enableButtonSeparator(
bool state );
702 void showButton( ButtonCode
id,
bool state );
712 void showButtonOK(
bool state );
722 void showButtonApply(
bool state );
730 void showButtonCancel(
bool state );
742 bool showPage(
int index );
752 int activePageIndex()
const;
771 int pageIndex( TQWidget *widget )
const;
786 void setMainWidget( TQWidget *widget );
793 TQWidget *mainWidget();
802 void disableResize();
815 void setInitialSize(
const TQSize &s,
bool noResize=
false );
827 void incInitialSize(
const TQSize &s,
bool noResize=
false );
836 TQSize configDialogSize(
const TQString& groupName )
const;
847 TQSize configDialogSize(
TDEConfig& config,
const TQString& groupName )
const;
858 void saveDialogSize(
const TQString& groupName,
bool global=
false );
870 void saveDialogSize(
TDEConfig& config,
const TQString& groupName,
871 bool global=
false )
const;
882 void setButtonOK(
const KGuiItem &item = KStdGuiItem::ok() );
899 void setButtonOKText(
const TQString &text=TQString::null,
900 const TQString &tooltip=TQString::null,
901 const TQString &quickhelp=TQString::null ) TDE_DEPRECATED;
912 void setButtonApply(
const KGuiItem &item = KStdGuiItem::apply() );
929 void setButtonApplyText(
const TQString &text=TQString::null,
930 const TQString &tooltip=TQString::null,
931 const TQString &quickhelp=TQString::null ) TDE_DEPRECATED;
942 void setButtonCancel(
const KGuiItem &item = KStdGuiItem::cancel() );
957 void setButtonCancelText(
const TQString &text=TQString::null,
958 const TQString &tooltip=TQString::null,
959 const TQString &quickhelp=TQString::null ) TDE_DEPRECATED;
967 void setButtonText( ButtonCode
id,
const TQString &text );
975 void setButtonTip( ButtonCode
id,
const TQString &text );
983 void setButtonWhatsThis( ButtonCode
id,
const TQString &text );
996 void setButtonGuiItem( ButtonCode
id,
const KGuiItem &item );
1008 void setTreeListAutoResize(
bool state );
1022 void setShowIconsInTreeList(
bool state);
1032 void setRootIsDecorated(
bool state );
1047 void unfoldTreeList(
bool persist =
false );
1057 void addWidgetBelowList( TQWidget * widget );
1069 void addButtonBelowList(
const TQString & text, TQObject * recv,
const char * slot );
1082 void addButtonBelowList(
const KGuiItem & guiitem, TQObject * recv,
const char * slot );
1096 void setIconListAllVisible(
bool state );
1103 static bool haveBackgroundTile();
1111 static const TQPixmap *backgroundTile();
1116 static const TQPixmap *getBackgroundTile() TDE_DEPRECATED;
1125 static
void setBackgroundTile( const TQPixmap *pix );
1132 void showTile(
bool state );
1145 void getBorderWidths(
int& ulx,
int& uly,
int& lrx,
int& lry ) const TDE_DEPRECATED;
1158 TQRect getContentsRect() const TDE_DEPRECATED;
1177 TQSize calculateSize(
int w,
int h ) const;
1187 TQString helpLinkText() const;
1202 TQPushButton *actionButton( ButtonCode
id );
1211 void enableButton( ButtonCode
id,
bool state );
1218 void enableButtonOK(
bool state );
1225 void enableButtonApply(
bool state );
1232 void enableButtonCancel(
bool state );
1239 void enableLinkedHelp(
bool state );
1250 void delayedDestruct();
1260 void setHelpLinkText( const TQString &text );
1274 void setHelp( const TQString &anchor,
1275 const TQString &appname = TQString::null );
1280 void helpClickedSlot( const TQString & );
1285 void setDetails(
bool showDetails);
1293 void setDetailsWidget(TQWidget *detailsWidget);
1299 void updateBackground();
1322 void defaultClicked();
1329 void user3Clicked();
1335 void user2Clicked();
1341 void user1Clicked();
1347 void applyClicked();
1377 void cancelClicked();
1383 void closeClicked();
1394 void backgroundChanged();
1425 void aboutToShowDetails();
1431 void aboutToShowPage(TQWidget *page);
1439 virtual
void keyPressEvent( TQKeyEvent *e );
1445 virtual
void hideEvent( TQHideEvent * );
1453 virtual
void closeEvent( TQCloseEvent *e );
1460 virtual
void slotHelp();
1465 virtual
void slotDefault();
1471 virtual
void slotDetails();
1476 virtual
void slotUser3();
1481 virtual
void slotUser2();
1486 virtual
void slotUser1();
1492 virtual
void slotOk();
1497 virtual
void slotApply();
1502 virtual
void slotTry();
1508 virtual
void slotYes();
1514 virtual
void slotNo();
1521 virtual
void slotCancel();
1527 virtual
void slotClose();
1534 virtual
void applyPressed();
1539 void updateGeometry();
1548 void slotDelayedDestruct();
1575 void makeButtonBox(
int mask,
ButtonCode defaultButton,
1587 void setButtonFocus( TQPushButton *p,
bool isDefault,
bool isFocus );
1594 void printMakeMainWidgetError();
1602 void setButtonStyle(
int style );
1606 TQBoxLayout *mTopLayout;
1607 TQWidget *mMainWidget;
1616 TQString mHelpLinkText;
1621 bool mMessageBoxMode;
1622 int mButtonOrientation;
1626 virtual
void virtual_hook(
int id,
void* data );
1628 class KDialogBasePrivate;
1629 KDialogBasePrivate* const d;
Used internally by KDialogBase.
A dialog base class with standard buttons and predefined layouts.
Dialog with extended non-modal support and methods for KDE standard compliance.
An abstract class for GUI data such as ToolTip and Icon.
Standard horizontal or vertical separator.
A drop-in replacement for TQLabel that displays hyperlinks.