summaryrefslogtreecommitdiffstatshomepage
path: root/CompositionButton.h
blob: 6bbdf60b24e58403d7058fd41ae12d35a3077baf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#ifndef COMPOSITIONBUTTON_H
#define COMPOSITIONBUTTON_H

#include <QWidget>
#include <QDateTime>
class QLabel;
class QLineEdit;
class QGridLayout;

class CompositionButton : public QWidget
{
	Q_OBJECT
public:
	CompositionButton(const QString &title, const QDateTime &date, QWidget *parent = 0);
	~CompositionButton();
	QString title() const;
	QString editedTitle() const;
	bool event(QEvent *event);
	void setEditMode(bool on, bool commit = true);
	bool editMode() const;
	void setDeleted(bool deleted);
	bool deleted() const;

protected:
	void mousePressEvent(QMouseEvent *event);

private:
	QLabel *m_title;
	QLabel *m_arrow;
	QLabel *m_date;
	QLineEdit *m_edit;
	QGridLayout *m_layout;

signals:
	void selected();
};

#endif // COMPOSITIONBUTTON_H