diff options
author | Slávek Banko <[email protected]> | 2016-03-26 13:50:43 +0100 |
---|---|---|
committer | Slávek Banko <[email protected]> | 2016-03-26 13:50:43 +0100 |
commit | d62c8c002c51fb7c36487839eeeb4ac89f044dee (patch) | |
tree | bb4d1f5c631ab1f22a3018ba39e6a806035f80fd /part/actions.h | |
download | kxmleditor-d62c8c002c51fb7c36487839eeeb4ac89f044dee.tar.gz kxmleditor-d62c8c002c51fb7c36487839eeeb4ac89f044dee.zip |
Initial import of kxmleditor 1.1.4
Diffstat (limited to 'part/actions.h')
-rw-r--r-- | part/actions.h | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/part/actions.h b/part/actions.h new file mode 100644 index 0000000..43d0967 --- /dev/null +++ b/part/actions.h @@ -0,0 +1,88 @@ +/*************************************************************************** + actions.h - description + ------------------- + begin : Tue Jul 10 2001 + copyright : (C) 2001, 2002, 2003 by The KXMLEditor Team + email : [email protected] + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef ACTIONS_H +#define ACTIONS_H + +#include <kaction.h> +#include <qlabel.h> +class QComboBox; + +/** + *@author Lumir Vanek + */ + +class KXmlEditorComboAction : public KAction +{ + Q_OBJECT +public: + KXmlEditorComboAction(const QString& text, int accel, const QObject *receiver, const char *member, QObject* parent, const char* name); + ~KXmlEditorComboAction(); + + virtual int plug(QWidget *w, int index = -1); + + virtual void unplug(QWidget *w); + + /** Returns the text from the combobox' editline (@ref QComboBox::currentText). */ + QString currentText() const; + + /** Returns the current pixmap or 0, if there isn't any (see @ref QComboBox::pixmap). */ + const QPixmap * currentPixmap() const; + + /** + * Inserts the given item as the first. + * Deletes the old entry, if the item was already in the list. + */ + void insertItem( const QPixmap & pixmap, const QString & text ); + + /** Tries to remove the item with the given text. */ + void removeItem( const QString & text ); + + /** returns combo box */ + QComboBox *comboBox(); + +public slots: + /** Clears the whole combobox using @ref QComboBox::clear. */ + void slotClear(); + /** Clears the combobox' editline. */ + void slotClearEdit(); + /** Gives focus to the combobox' editline. */ + void slotFocusEdit(); + +protected: + /** + * Tries to find an item with the given text. If it finds it, + * the items id is returned, otherwise -1. + */ + virtual int findItem( const QString & text ); + +private: + const QObject *m_receiver; + const char *m_member; + QComboBox * m_pCombo; +}; + + +class ToolbarLabel : public QLabel +{ + Q_OBJECT +public: + ToolbarLabel( const QString & text ); +}; + + +#endif |