summaryrefslogtreecommitdiffstats
path: root/src/combobutton.h
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-03-01 19:09:31 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-03-01 19:09:31 +0000
commitf2cfda2a54780868dfe0af7bd652fcd4906547da (patch)
treec6ac23545528f5701818424f2af5f79ce3665e6c /src/combobutton.h
downloadsoundkonverter-f2cfda2a54780868dfe0af7bd652fcd4906547da.tar.gz
soundkonverter-f2cfda2a54780868dfe0af7bd652fcd4906547da.zip
Added KDE3 version of SoundKonverter
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/soundkonverter@1097614 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/combobutton.h')
-rwxr-xr-xsrc/combobutton.h110
1 files changed, 110 insertions, 0 deletions
diff --git a/src/combobutton.h b/src/combobutton.h
new file mode 100755
index 0000000..3f07199
--- /dev/null
+++ b/src/combobutton.h
@@ -0,0 +1,110 @@
+
+
+#ifndef COMBOBUTTON_H
+#define COMBOBUTTON_H
+
+#include <qwidget.h>
+
+class QString;
+class QPixmap;
+class KPushButton;
+class KComboBox;
+
+/**
+ * @short ComboButton
+ * @author Daniel Faust <hessijames@gmail.com>
+ * @version 0.3
+ */
+class ComboButton : public QWidget
+{
+ Q_OBJECT
+public:
+ enum SizeMode {
+ Min, Max
+ };
+
+ /**
+ * Constructor
+ * @param parent The parent widget
+ * @param name The name of the file list
+ */
+ ComboButton( QWidget *parent, const char *name = 0 );
+
+ /**
+ * Destructor
+ */
+ virtual ~ComboButton();
+
+ /**
+ * Insert a new item with @p text at position @p index
+ */
+ void insertItem( const QString &text, int index = -1 );
+ /**
+ * Insert a new item with an icon @p pixmap and @p text at position @p index
+ */
+ void insertItem( const QPixmap &pixmap, const QString &text, int index = -1 );
+
+ /**
+ * Increase the combobutton's height by @p height
+ */
+ void increaseHeight( int height );
+
+ /**
+ * Sets m_sizeMode to @p mode
+ */
+ void setSizeMode( int mode );
+
+ /**
+ * Returns the m_sizeMode
+ */
+ int sizeMode();
+
+ /**
+ * Sets the font of the combobutton
+ */
+ void setFont( const QFont& font );
+
+ /**
+ * Returns the font of the button
+ */
+ QFont font();
+
+private:
+ /** A pointer to the button */
+ KPushButton *m_button;
+ /** A pointer to the combobox */
+ KComboBox *m_box;
+
+ int m_increaseHeight;
+
+ /** The actual size mode */
+ int m_sizeMode;
+
+ /** Recalculate the size of the combobutton */
+ void balanceSize();
+ /** The button gets a new label, etc. */
+ void repaintButton();
+
+//public slots:
+ //void setCurrentItem(const QString &item, bool insert=false, int index=-1);
+ //void setCurrentItem(int index);
+
+private slots:
+ /**
+ * Is called when the user selects an item from the popdown menu of the combobox
+ */
+ void boxActivated( int index );
+ /**
+ * Is called when the user clicks the button
+ */
+ void buttonClicked();
+
+signals:
+ /**
+ * The signal clicked is emitted, when the user selects an item
+ */
+ void clicked( int index );
+
+};
+
+#endif // COMBOBUTTON_H