• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KDEUI

  • kdeui
  • actions
kcodecaction.h
Go to the documentation of this file.
1/*
2 kcodecaction.h
3
4 Copyright (c) 2003 Jason Keirstead <jason@keirstead.org>
5 Copyright (c) 2003-2006 Michel Hermier <michel.hermier@gmail.com>
6 Copyright (c) 2007 Nick Shaforostoff <shafff@ukr.net>
7
8 ********************************************************************
9 * *
10 * This library is free software; you can redistribute it and/or *
11 * modify it under the terms of the GNU Lesser General Public *
12 * License as published by the Free Software Foundation; either *
13 * version 2 of the License, or (at your option) any later version. *
14 * *
15 * This library is distributed in the hope that it will be useful, *
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
18 * GNU Lesser General Public License for more details. *
19 * *
20 * You should have received a copy of the GNU Lesser General Public *
21 * License along with this library; if not, write to the *
22 * Free Software Foundation, Inc., 51 Franklin Street, *
23 * Fifth Floor, Boston, MA 02110-1301 USA *
24 * *
25 ********************************************************************
26*/
27#ifndef KCODECACTION_H
28#define KCODECACTION_H
29
30#include <kencodingdetector.h>
31#include <kselectaction.h>
32
38class KDEUI_EXPORT KCodecAction
39 : public KSelectAction
40{
41 Q_OBJECT
42
43 Q_PROPERTY(QString codecName READ currentCodecName WRITE setCurrentCodec)
44 Q_PROPERTY(int codecMib READ currentCodecMib)
45
46public:
47 explicit KCodecAction(QObject *parent,bool showAutoOptions=false);
48
49 KCodecAction(const QString &text, QObject *parent,bool showAutoOptions=false);
50
51 KCodecAction(const KIcon &icon, const QString &text, QObject *parent,bool showAutoOptions=false);
52
53 virtual ~KCodecAction();
54
55public:
56 int mibForName(const QString &codecName, bool *ok = 0) const;
57 QTextCodec *codecForMib(int mib) const;
58
59 QTextCodec *currentCodec() const;
60 bool setCurrentCodec(QTextCodec *codec);
61
62 QString currentCodecName() const;
63 bool setCurrentCodec(const QString &codecName);
64
65 int currentCodecMib() const;
66 bool setCurrentCodec(int mib);
67
73 KEncodingDetector::AutoDetectScript currentAutoDetectScript() const;
79 bool setCurrentAutoDetectScript(KEncodingDetector::AutoDetectScript);
80
81
82Q_SIGNALS:
88 void triggered(QTextCodec *codec);
89
96 void triggered(KEncodingDetector::AutoDetectScript);
97
101 void defaultItemTriggered();
102
103
104protected Q_SLOTS:
105 virtual void actionTriggered(QAction*);
106
107protected:
108 using KSelectAction::triggered;
109
110private:
111 class Private;
112 Private* const d;
113
114 Q_PRIVATE_SLOT( d, void _k_subActionTriggered(QAction*) )
115};
116
117#endif
KCodecAction
Action for selecting one of several QTextCodec.
Definition: kcodecaction.h:40
KCodecAction::defaultItemTriggered
void defaultItemTriggered()
If showAutoOptions==true, then better handle triggered(KEncodingDetector::AutoDetectScript) signal.
KCodecAction::triggered
void triggered(KEncodingDetector::AutoDetectScript)
Autodetection has been selected.
KCodecAction::triggered
void triggered(QTextCodec *codec)
Specific (proper) codec was selected.
KEncodingDetector::AutoDetectScript
AutoDetectScript
KIcon
A wrapper around QIcon that provides KDE icon features.
Definition: kicon.h:41
KSelectAction
Action for selecting one of several items.
Definition: kselectaction.h:52
KSelectAction::triggered
void triggered(QAction *action)
This signal is emitted when an item is selected;.
QAction
QObject
kencodingdetector.h
kselectaction.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDEUI

Skip menu "KDEUI"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal