00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef KXMLCOMMANDDLG_H
00021 #define KXMLCOMMANDDLG_H
00022
00023 #include <tqwidget.h>
00024 #include <tqmap.h>
00025 #include <tqstringlist.h>
00026 #include <kdialogbase.h>
00027
00028 class TDEListView;
00029 class TQListViewItem;
00030 class TQLineEdit;
00031 class TQComboBox;
00032 class TQWidgetStack;
00033 class TQToolButton;
00034 class TDEListBox;
00035 class TQListBoxItem;
00036 class TQTextEdit;
00037 class TQCheckBox;
00038
00039 class DrGroup;
00040 class DrBase;
00041 class KXmlCommand;
00042
00043 class KXmlCommandAdvancedDlg : public TQWidget
00044 {
00045 Q_OBJECT
00046 public:
00047 KXmlCommandAdvancedDlg(TQWidget *parent = 0, const char *name = 0);
00048 ~KXmlCommandAdvancedDlg();
00049
00050 void setCommand(KXmlCommand*);
00051 static bool editCommand(KXmlCommand *xmlcmd, TQWidget *parent = 0);
00052
00053 protected:
00054 void parseGroupItem(DrGroup*, TQListViewItem*);
00055 void parseXmlCommand(KXmlCommand*);
00056 void viewItem(TQListViewItem*);
00057 void removeItem(TQListViewItem*);
00058 void recreateGroup(TQListViewItem*, DrGroup*);
00059
00060 protected slots:
00061 void slotSelectionChanged(TQListViewItem*);
00062 void slotTypeChanged(int);
00063 void slotAddValue();
00064 void slotRemoveValue();
00065 void slotApplyChanges();
00066 void slotAddGroup();
00067 void slotAddOption();
00068 void slotRemoveItem();
00069 void slotMoveUp();
00070 void slotMoveDown();
00071 void slotCommandChanged(const TQString&);
00072 void slotValueSelected(TQListViewItem*);
00073 void slotOptionRenamed(TQListViewItem*, int);
00074 void slotChanged();
00075
00076 private:
00077 TDEListView *m_view;
00078 TQLineEdit *m_name, *m_desc, *m_format, *m_default, *m_command;
00079 TQComboBox *m_type;
00080 TQWidget *m_dummy;
00081 TDEListView *m_values;
00082 TQLineEdit *m_edit1, *m_edit2;
00083 TQWidgetStack *m_stack;
00084 TQToolButton *m_apply, *m_addgrp, *m_addopt, *m_delopt, *m_up, *m_down;
00085 TQLineEdit *m_inputfile, *m_inputpipe, *m_outputfile, *m_outputpipe;
00086 TQToolButton *m_addval, *m_delval;
00087 TQTextEdit *m_comment;
00088 TQCheckBox *m_persistent;
00089
00090 KXmlCommand *m_xmlcmd;
00091 TQMap<TQString, DrBase*> m_opts;
00092 };
00093
00094 class KXmlCommandDlg : public KDialogBase
00095 {
00096 Q_OBJECT
00097 public:
00098 KXmlCommandDlg(TQWidget *parent = 0, const char *name = 0);
00099
00100 void setCommand(KXmlCommand*);
00101 static bool editCommand(KXmlCommand*, TQWidget *parent = 0);
00102
00103 protected slots:
00104 void slotAddMime();
00105 void slotRemoveMime();
00106 void slotEditCommand();
00107 void slotAddReq();
00108 void slotRemoveReq();
00109 void slotReqSelected(TQListViewItem*);
00110 void slotAvailableSelected(TQListBoxItem*);
00111 void slotSelectedSelected(TQListBoxItem*);
00112 void slotOk();
00113
00114 private:
00115 TQLineEdit *m_description;
00116 TQLabel *m_idname;
00117 TQComboBox *m_mimetype;
00118 TDEListBox *m_availablemime, *m_selectedmime;
00119 TQToolButton *m_addmime, *m_removemime;
00120 TDEListView *m_requirements;
00121 TQToolButton *m_removereq, *m_addreq;
00122
00123 TQStringList m_mimelist;
00124 KXmlCommand *m_cmd;
00125 };
00126
00127 #endif