kwave  18.07.70
ViewItem.h
Go to the documentation of this file.
1 /***************************************************************************
2  ViewItem.h - base class for a visible 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 VIEW_ITEM_H
19 #define VIEW_ITEM_H
20 
21 #include "config.h"
22 
23 #include <QtGlobal>
24 #include <QCursor>
25 #include <QFlag>
26 #include <QObject>
27 #include <QPoint>
28 #include <QString>
29 
30 #include "libkwave/Sample.h"
31 
32 class QCursor;
33 class QMenu;
34 
35 namespace Kwave
36 {
37  // forward declarations
38  class SignalManager;
39  class SignalView;
40 
41  class Q_DECL_EXPORT ViewItem: public QObject
42  {
43  Q_OBJECT
44 
45  public:
46  enum Flag
47  {
48  None = 0,
49  CanGrabAndMove = 1,
50  CanDragAndDrop = 2
51  };
52  Q_DECLARE_FLAGS(Flags, Flag)
53 
54 
59  ViewItem(Kwave::SignalView &view, Kwave::SignalManager &signal_manager);
60 
62  virtual ~ViewItem();
63 
68  virtual Kwave::ViewItem::Flags flags() const;
69 
78  virtual QString toolTip(sample_index_t &ofs);
79 
85  virtual void appendContextMenu(QMenu *parent);
86 
90  virtual QCursor mouseCursor() const;
91 
97  virtual void moveTo(const QPoint &mouse_pos);
98 
100  virtual void startDragging();
101 
106  virtual void done();
107 
108  signals:
109 
111  void sigCommand(const QString &command);
112 
113  protected:
114 
117 
120 
121  };
122 }
123 
124 #endif /* VIEW_ITEM_H */
125 
126 //***************************************************************************
127 //***************************************************************************
Definition: App.h:33
quint64 sample_index_t
Definition: Sample.h:28
Kwave::SignalManager & m_signal_manager
Definition: ViewItem.h:119
Kwave::SignalView & m_view
Definition: ViewItem.h:116