Canorus  0.7
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
sourceviewport.h
Go to the documentation of this file.
1 
8 #ifndef SOURCEVIEWPORT_H_
9 #define SOURCEVIEWPORT_H_
10 
11 #include <QTextEdit>
12 
13 #include "widgets/viewport.h"
14 
15 class QPushButton;
16 class QGridLayout;
17 
18 class CADocument;
19 class CAVoice;
20 class CALyricsContext;
21 
22 class CASourceViewPort : public CAViewPort {
23  Q_OBJECT
24 
28  };
29 
30 public:
31  CASourceViewPort(CADocument *doc, QWidget *parent=0);
34  virtual ~CASourceViewPort();
35 
37  CASourceViewPort *clone(QWidget *parent);
38 
41 
42  inline CADocument *document() { return _document; };
43  inline CAVoice *voice() { return _voice; }
45  inline void setDocument( CADocument *doc ) { _document = doc; }
46  inline void setVoice( CAVoice *voice ) { _voice = voice; }
47  inline void setLyricsContext( CALyricsContext *c ) { _lyricsContext = c; }
48 
49  inline void selectAll() { _textEdit->selectAll(); }
50 signals:
51  void CACommit( QString documentString );
52 
53 public slots:
54  void rebuild();
55 
56 private slots:
57  void on_commit_clicked();
58 
59 private:
60  void setupUI();
61 
62  class CATextEdit;
63  friend class CASourceViewPort::CATextEdit;
64 
66  // Widgets //
69  QPushButton *_commit;
70  QPushButton *_revert;
71  QGridLayout *_layout;
72 
74  // Properties //
80 };
81 
82 #endif /* SOURCEVIEWPORT_H_ */