kwave  18.07.70
LabelItem.h
Go to the documentation of this file.
1 /***************************************************************************
2  LabelItem.h - label item within a SignalView
3  -------------------
4  begin : Sat Mar 26 2011
5  copyright : (C) 2011 by Thomas Eschenbacher
6  email : Thomas.Eschenbacher@gmx.de
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef LABEL_ITEM_H
19 #define LABEL_ITEM_H
20 
21 #include "config.h"
22 
23 #include <QtGlobal>
24 #include <QCursor>
25 #include <QObject>
26 #include <QString>
27 
28 #include "libgui/ViewItem.h"
29 
30 class QMenu;
31 
32 namespace Kwave
33 {
34 
35  class Label;
36  class SignalView;
37  class UndoTransactionGuard;
38 
39  class Q_DECL_EXPORT LabelItem: public Kwave::ViewItem
40  {
41  Q_OBJECT
42  public:
51  Kwave::SignalManager &signal_manager,
52  unsigned int index,
53  const Kwave::Label &label);
54 
56  virtual ~LabelItem() Q_DECL_OVERRIDE;
57 
62  virtual Kwave::ViewItem::Flags flags() const Q_DECL_OVERRIDE;
63 
70  virtual QString toolTip(sample_index_t &ofs) Q_DECL_OVERRIDE;
71 
76  virtual void appendContextMenu(QMenu *parent) Q_DECL_OVERRIDE;
77 
81  virtual QCursor mouseCursor() const Q_DECL_OVERRIDE;
82 
88  virtual void moveTo(const QPoint &mouse_pos) Q_DECL_OVERRIDE;
89 
94  virtual void done() Q_DECL_OVERRIDE;
95 
96  private slots:
97 
99  void contextMenuLabelDelete();
100 
102  void contextMenuLabelProperties();
103 
104  private:
105 
107  unsigned int m_index;
108 
111 
114 
116  QString m_description;
117 
120 
121  };
122 
123 }
124 
125 #endif /* LABEL_ITEM_H */
126 
127 //***************************************************************************
128 //***************************************************************************
sample_index_t m_current_pos
Definition: LabelItem.h:113
Definition: App.h:33
sample_index_t m_initial_pos
Definition: LabelItem.h:110
unsigned int m_index
Definition: LabelItem.h:107
quint64 sample_index_t
Definition: Sample.h:28
QString m_description
Definition: LabelItem.h:116
Kwave::UndoTransactionGuard * m_undo_transaction
Definition: LabelItem.h:119