KDEUI
kcodecaction.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
00021
00022
00023
00024
00025
00026
00027 #ifndef KCODECACTION_H
00028 #define KCODECACTION_H
00029
00030 #include <kencodingdetector.h>
00031 #include <kselectaction.h>
00032
00038 class KDEUI_EXPORT KCodecAction
00039 : public KSelectAction
00040 {
00041 Q_OBJECT
00042
00043 Q_PROPERTY(QString codecName READ currentCodecName WRITE setCurrentCodec)
00044 Q_PROPERTY(int codecMib READ currentCodecMib)
00045
00046 public:
00047 explicit KCodecAction(QObject *parent,bool showAutoOptions=false);
00048
00049 KCodecAction(const QString &text, QObject *parent,bool showAutoOptions=false);
00050
00051 KCodecAction(const KIcon &icon, const QString &text, QObject *parent,bool showAutoOptions=false);
00052
00053 virtual ~KCodecAction();
00054
00055 public:
00056 int mibForName(const QString &codecName, bool *ok = 0) const;
00057 QTextCodec *codecForMib(int mib) const;
00058
00059 QTextCodec *currentCodec() const;
00060 bool setCurrentCodec(QTextCodec *codec);
00061
00062 QString currentCodecName() const;
00063 bool setCurrentCodec(const QString &codecName);
00064
00065 int currentCodecMib() const;
00066 bool setCurrentCodec(int mib);
00067
00073 KEncodingDetector::AutoDetectScript currentAutoDetectScript() const;
00079 bool setCurrentAutoDetectScript(KEncodingDetector::AutoDetectScript);
00080
00081
00082 Q_SIGNALS:
00086 void triggered(QTextCodec *codec);
00087
00093 void triggered(const QString&);
00094
00101 void triggered(KEncodingDetector::AutoDetectScript);
00102
00106 void defaultItemTriggered();
00107
00108
00109 protected Q_SLOTS:
00110 virtual void actionTriggered(QAction*);
00111
00112 private:
00113 class Private;
00114 Private* const d;
00115
00116 Q_PRIVATE_SLOT( d, void _k_subActionTriggered(QAction*) )
00117 };
00118
00119 #endif