27 #include <tdelibs_export.h>
33 class TDEPRINT_EXPORT KXmlCommand :
public TQObject
35 friend class KXmlCommandManager;
40 TQString name()
const;
41 void setName(
const TQString&);
43 void setCommand(
const TQString&);
46 void setDriver(DrMain*);
47 TQString io(
bool io_input =
true,
bool io_pipe =
false);
48 void setIo(
const TQString&,
bool io_input =
true,
bool io_pipe =
false);
49 TQString description();
50 void setDescription(
const TQString&);
52 void setMimeType(
const TQString&);
53 bool acceptMimeType(
const TQString&);
54 TQStringList inputMimeTypes();
55 void setInputMimeTypes(
const TQStringList&);
56 TQStringList requirements();
57 void setRequirements(
const TQStringList&);
59 void setComment(
const TQString& );
62 TQString buildCommand(
const TQMap<TQString,TQString>& opts,
bool pipein =
true,
bool pipeout =
true);
63 void setOptions(
const TQMap<TQString,TQString>& opts);
64 void getOptions(TQMap<TQString,TQString>& opts,
bool incldef =
false);
72 void check(
bool use_xml =
false);
73 DrGroup* parseGroup(
const TQDomElement& e, DrGroup *grp = 0);
74 DrBase* parseArgument(
const TQDomElement& e);
75 void parseIO(
const TQDomElement& e,
int n);
76 TQDomElement createIO(TQDomDocument&,
int,
const TQString&);
77 TQDomElement createGroup(TQDomDocument&, DrGroup*);
78 TQDomElement createElement(TQDomDocument&, DrBase*);
82 KXmlCommand(
const TQString& xmlId = TQString::null);
85 class KXmlCommandPrivate;
86 KXmlCommandPrivate *d;
89 class TDEPRINT_EXPORT KXmlCommandManager :
public TQObject
92 enum IO_CheckType { None = 0, Basic, Advanced };
95 ~KXmlCommandManager();
97 KXmlCommand* loadCommand(
const TQString& xmlId,
bool check =
false);
98 void saveCommand(KXmlCommand *xmlCmd);
99 TQStringList commandList();
100 TQStringList commandListWithDescription();
101 TQString selectCommand(TQWidget *parent = 0);
103 TQStringList autoConvert(
const TQString& mimesrc,
const TQString& mimedest);
104 int insertCommand(TQStringList& list,
const TQString& filtername,
bool defaultToStart =
true);
105 bool checkCommand(
const TQString&,
int inputCheck = Advanced,
int outputCheck = Advanced, TQString *msg = 0);
106 bool configure(KXmlCommand*, TQWidget *parent = 0);
109 static KXmlCommandManager*
self();
113 KXmlCommand* command(
const TQString&)
const;
116 class KXmlCommandManagerPrivate;
117 KXmlCommandManagerPrivate *d;
118 static KXmlCommandManager *m_self;