Canorus  0.0
Classes | Public Slots | Signals | Public Member Functions | Private Types | Private Slots | Private Member Functions | Private Attributes | Friends | List of all members
CASourceView Class Reference

Widget that shows the current score source in various syntax. More...

#include <sourceview.h>

Inheritance diagram for CASourceView:
Inheritance graph
[legend]

Classes

class  CATextEdit
 

Public Slots

void rebuild ()
 

Signals

void CACommit (QString documentString)
 
- Signals inherited from CAView
void clicked ()
 
void closed (CAView *)
 

Public Member Functions

 CASourceView (CADocument *doc, QWidget *parent=0)
 
 CASourceView (CAVoice *voice, QWidget *parent=0)
 
 CASourceView (CALyricsContext *lc, QWidget *parent=0)
 
virtual ~CASourceView ()
 
CASourceViewclone ()
 
CASourceViewclone (QWidget *parent)
 
CASourceViewType sourceViewType ()
 
void setSourceViewType (CASourceViewType t)
 
CADocumentdocument ()
 
CAVoicevoice ()
 
CALyricsContextlyricsContext ()
 
void setDocument (CADocument *doc)
 
void setVoice (CAVoice *voice)
 
void setLyricsContext (CALyricsContext *c)
 
void selectAll ()
 
- Public Member Functions inherited from CAView
 CAView (QWidget *parent=0)
 
virtual ~CAView ()
 
CAViewType viewType ()
 
virtual void rebuild ()=0
 

Private Types

enum  CASourceViewType { LilyPond, CanorusML }
 

Private Slots

void on_commit_clicked ()
 

Private Member Functions

void setupUI ()
 

Private Attributes

QTextEdit_textEdit
 
QPushButton * _commit
 
QPushButton * _revert
 
QGridLayout * _layout
 
CASourceViewType _sourceViewType
 
CADocument_document
 
CAVoice_voice
 
CALyricsContext_lyricsContext
 

Friends

class CASourceView::CATextEdit
 

Additional Inherited Members

- Public Types inherited from CAView
enum  CAViewType { ScoreView, SourceView }
 
- Static Public Attributes inherited from CAView
static const int DEFAULT_VIEW_WIDTH = 600
 
static const int DEFAULT_VIEW_HEIGHT = 400
 
- Protected Slots inherited from CAView
void mousePressEvent (QMouseEvent *e)
 
void closeEvent (QCloseEvent *)
 
- Protected Member Functions inherited from CAView
void setViewType (CAViewType t)
 
- Protected Attributes inherited from CAView
CAViewType _viewType
 

Detailed Description

Widget that shows the current score source in various syntax.

This widget is a view which shows in the main text area the syntax of the current score (or voice, staff). It includes 2 buttons for committing the changes to the score and reverting any changes back from the score.

See also
CAScoreView

Member Enumeration Documentation

◆ CASourceViewType

Enumerator
LilyPond 
CanorusML 

Constructor & Destructor Documentation

◆ CASourceView() [1/3]

CASourceView::CASourceView ( CADocument doc,
QWidget *  parent = 0 
)

Constructor for CanorusML syntax - requires the whole document.

Todo:
This should be merged in the future with other formats.

References _document, _lyricsContext, _voice, CanorusML, setSourceViewType(), setupUI(), CAView::setViewType(), and CAView::SourceView.

Referenced by clone().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CASourceView() [2/3]

CASourceView::CASourceView ( CAVoice voice,
QWidget *  parent = 0 
)

Constructor for LilyPond syntax - requires the current voice.

Todo:
This should be merged in the future with other formats.

References _document, _lyricsContext, _voice, LilyPond, setSourceViewType(), setupUI(), CAView::setViewType(), CAView::SourceView, and voice().

Here is the call graph for this function:

◆ CASourceView() [3/3]

CASourceView::CASourceView ( CALyricsContext lc,
QWidget *  parent = 0 
)

Constructor for LilyPond syntax - requires the current lyrics context to show the lyrics.

Todo:
This should be merged in the future with other formats.

References _document, _lyricsContext, _voice, LilyPond, setSourceViewType(), setupUI(), CAView::setViewType(), and CAView::SourceView.

Here is the call graph for this function:

◆ ~CASourceView()

CASourceView::~CASourceView ( )
virtual

References _commit, _layout, _revert, and _textEdit.

Member Function Documentation

◆ CACommit

void CASourceView::CACommit ( QString  documentString)
signal

Referenced by on_commit_clicked().

Here is the caller graph for this function:

◆ clone() [1/2]

CASourceView * CASourceView::clone ( )
virtual

Returns a pointer to the new cloned view with the same parent. This function is usually called when a user creates a new docked view.

Implements CAView.

References CASourceView(), document(), lyricsContext(), and voice().

Here is the call graph for this function:

◆ clone() [2/2]

CASourceView * CASourceView::clone ( QWidget *  parent)
virtual

Returns a pointer to the new cloned view with the parent parent. This function is usually called when a user creates a new undocked view.

Implements CAView.

References CASourceView(), document(), lyricsContext(), and voice().

Here is the call graph for this function:

◆ document()

CADocument* CASourceView::document ( )
inline

References _document.

Referenced by clone(), rebuild(), CAMainWin::sourceViewCommit(), and CAUndoCommand::undoDocument().

Here is the caller graph for this function:

◆ lyricsContext()

CALyricsContext* CASourceView::lyricsContext ( )
inline

References _lyricsContext.

Referenced by clone(), rebuild(), CAMainWin::removeSheet(), CAMainWin::sourceViewCommit(), and CAUndoCommand::undoDocument().

Here is the caller graph for this function:

◆ on_commit_clicked

void CASourceView::on_commit_clicked ( )
privateslot

References _textEdit, and CACommit().

Referenced by setupUI().

Here is the caller graph for this function:

◆ rebuild

void CASourceView::rebuild ( )
slot

Generates the score source from the current score and fill the text area with it.

References _textEdit, document(), CAExport::exportDocument(), CAExport::exportLyricsContext(), CAExport::exportVoice(), lyricsContext(), voice(), and CAExport::wait().

Referenced by setupUI().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ selectAll()

void CASourceView::selectAll ( )
inline

References _textEdit.

◆ setDocument()

void CASourceView::setDocument ( CADocument doc)
inline

References _document.

Referenced by CAUndoCommand::undoDocument().

Here is the caller graph for this function:

◆ setLyricsContext()

void CASourceView::setLyricsContext ( CALyricsContext c)
inline

References _lyricsContext.

Referenced by CAMainWin::sourceViewCommit(), and CAUndoCommand::undoDocument().

Here is the caller graph for this function:

◆ setSourceViewType()

void CASourceView::setSourceViewType ( CASourceViewType  t)
inline

References _sourceViewType.

Referenced by CASourceView().

Here is the caller graph for this function:

◆ setupUI()

void CASourceView::setupUI ( )
private

References _commit, _layout, _revert, _textEdit, CAView::clicked(), on_commit_clicked(), and rebuild().

Referenced by CASourceView().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setVoice()

void CASourceView::setVoice ( CAVoice voice)
inline

References _voice, and voice().

Referenced by CAMainWin::sourceViewCommit(), and CAUndoCommand::undoDocument().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sourceViewType()

CASourceViewType CASourceView::sourceViewType ( )
inline

References _sourceViewType.

◆ voice()

CAVoice* CASourceView::voice ( )
inline

References _voice.

Referenced by CASourceView(), clone(), rebuild(), CAMainWin::removeSheet(), setVoice(), CAMainWin::sourceViewCommit(), and CAUndoCommand::undoDocument().

Here is the caller graph for this function:

Friends And Related Function Documentation

◆ CASourceView::CATextEdit

friend class CASourceView::CATextEdit
friend

Member Data Documentation

◆ _commit

QPushButton* CASourceView::_commit
private

Referenced by setupUI(), and ~CASourceView().

◆ _document

CADocument* CASourceView::_document
private

Referenced by CASourceView(), document(), and setDocument().

◆ _layout

QGridLayout* CASourceView::_layout
private

Referenced by setupUI(), and ~CASourceView().

◆ _lyricsContext

CALyricsContext* CASourceView::_lyricsContext
private

◆ _revert

QPushButton* CASourceView::_revert
private

Referenced by setupUI(), and ~CASourceView().

◆ _sourceViewType

CASourceViewType CASourceView::_sourceViewType
private

◆ _textEdit

QTextEdit* CASourceView::_textEdit
private

◆ _voice

CAVoice* CASourceView::_voice
private

Referenced by CASourceView(), setVoice(), and voice().


The documentation for this class was generated from the following files: