KDECore
kautostart.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef KDELIBS_KAUTOSTART_H
00021 #define KDELIBS_KAUTOSTART_H
00022
00023 #include <kdecore_export.h>
00024
00025 #include <QtCore/QObject>
00026
00027 class QStringList;
00028
00049 class KDECORE_EXPORT KAutostart : public QObject
00050 {
00051 Q_OBJECT
00052
00053 public:
00072 explicit KAutostart(const QString& entryName = QString(),
00073 QObject* parent = 0);
00074 ~KAutostart();
00075
00080 enum Condition
00081 {
00082 NoConditions = 0x0,
00086 CheckCommand = 0x1,
00091 CheckCondition = 0x2,
00096 CheckAll = 0xff
00097 };
00098 Q_DECLARE_FLAGS(Conditions, Condition)
00099
00100
00103 enum StartPhase
00104 {
00108 BaseDesktop = 0,
00115 DesktopServices = 1,
00121 Applications = 2
00122 };
00123
00130 void setAutostarts(bool autostart);
00131
00140 bool autostarts(const QString& environment = QString(),
00141 Conditions check = NoConditions) const;
00142
00147 QString command() const;
00152 void setCommand(const QString& command);
00153
00158 QString visibleName() const;
00163 void setVisibleName(const QString& entryName);
00164
00171 static bool isServiceRegistered(const QString& entryName);
00172
00179 QString commandToCheck() const;
00185 void setCommandToCheck(const QString& exec);
00186
00195 StartPhase startPhase() const;
00204 void setStartPhase(StartPhase phase);
00205
00218 QStringList allowedEnvironments() const;
00223 void setAllowedEnvironments(const QStringList& environments);
00229 void addToAllowedEnvironments(const QString& environment);
00235 void removeFromAllowedEnvironments(const QString& environment);
00236
00247 QStringList excludedEnvironments() const;
00252 void setExcludedEnvironments(const QStringList& environments);
00258 void addToExcludedEnvironments(const QString& environment);
00264 void removeFromExcludedEnvironments(const QString& environment);
00265
00272 QString startAfter() const;
00273
00279 bool checkAllowedEnvironment( const QString& environment ) const;
00280
00281 private:
00282 bool checkStartCondition() const;
00283 class Private;
00284 Private* const d;
00285 };
00286
00287 Q_DECLARE_OPERATORS_FOR_FLAGS(KAutostart::Conditions)
00288 #endif