Songbook-Client  0.7
This application is a manager of customguitar songbooks
 All Classes Files Functions Variables Enumerations Enumerator Pages
Public Types | Public Slots | Signals | Public Member Functions | Protected Member Functions
CSongCodeEditor Class Reference

CSongCodeEditor is the widget to edit a song's content. More...

#include <song-code-editor.hh>

List of all members.

Public Types

enum  SongEnvironment {
  Verse, Bridge, Chorus, Scripture,
  None
}

Public Slots

void setSpellCheckActive (const bool value)
void toggleQuickSearch ()

Signals

void wordAdded (const QString &word)

Public Member Functions

 CSongCodeEditor (QWidget *parent=0)
 Constructor.
 ~CSongCodeEditor ()
 Destructor.
void readSettings ()
void writeSettings ()
void installHighlighter ()
CSongHighlighterhighlighter () const
QCompleter * completer () const
bool environmentsHighlighted () const
void setEnvironmentsHighlighted (bool value)
void indent ()
void indentSelection ()
bool isSpellCheckAvailable () const
void setSpellCheckAvailable (const bool value)
bool isSpellCheckActive () const

Protected Member Functions

virtual void keyPressEvent (QKeyEvent *event)
virtual void resizeEvent (QResizeEvent *event)
void contextMenuEvent (QContextMenuEvent *event)

Detailed Description

CSongCodeEditor is the widget to edit a song's content.

song-code-editor.png

Member Enumeration Documentation

This enum type describes available LaTeX environments in a song. Environments are usually enclosed within \begin{environment} and \end{environment} macros.

Enumerator:
Verse 

verse environment.

Bridge 

bridge environment.

Chorus 

chorus environment.

Scripture 

scripture environment.

None 

no environment.


Member Function Documentation

QCompleter * CSongCodeEditor::completer ( ) const

Returns the macro completer. The completer is a pop-up menu that suggests common macros for convenience.

void CSongCodeEditor::contextMenuEvent ( QContextMenuEvent *  event)
protected

Provides custom context menu with specific actions that are relevant for song edition. For example, comment/uncomment selection, spell-checking options etc.

bool CSongCodeEditor::environmentsHighlighted ( ) const

Returns true if a backgroundColor is set for environments; false otherwise.

See also:
setEnvironmentsHighlighted
CSongHighlighter * CSongCodeEditor::highlighter ( ) const

Returns the syntax highlighter.

See also:
installHighlighter
void CSongCodeEditor::indent ( )

Performs indentation for the whole text in the editor. Indentation is 2 whitespaces. A new environment adds a level of indentation.

See also:
indentSelection
void CSongCodeEditor::indentSelection ( )

Performs indentation for the current selection.

See also:
indent
void CSongCodeEditor::installHighlighter ( )

Creates and associates the syntax highlighter with the song.

See also:
highlighter
bool CSongCodeEditor::isSpellCheckActive ( ) const

Returns true if spell-checking is active; false otherwise.

See also:
isSpellCheckAvailable
bool CSongCodeEditor::isSpellCheckAvailable ( ) const

Returns true if spell-checking is available (ie, a hunspell dictionary matching the language of the song does exist).

See also:
setSpellCheckAvailable
void CSongCodeEditor::keyPressEvent ( QKeyEvent *  event)
protectedvirtual

Performs indentation when hitting the tab key. Pops-up completer when hitting the ctrl+space key.

See also:
indent, completer
void CSongCodeEditor::readSettings ( )

Reads editor settings (ie, font, line numbers etc.).

See also:
writeSettings
void CSongCodeEditor::resizeEvent ( QResizeEvent *  event)
protectedvirtual

Reimplements CodeEditor::resizeEvent to move the quick search widget in the top-right corner of the editor.

void CSongCodeEditor::setEnvironmentsHighlighted ( bool  value)

Sets a background color for environments if value is true.

See also:
environmentsHighlighted
void CSongCodeEditor::setSpellCheckActive ( const bool  value)
slot

Highlights mispelled words according to value.

See also:
isSpellCheckActive
void CSongCodeEditor::setSpellCheckAvailable ( const bool  value)

Sets the availabilty of spell-checking to value. (ie, a hunspell dictionary matching the language of the song does exist).

See also:
isSpellCheckAvailable
void CSongCodeEditor::toggleQuickSearch ( )
slot

Toggle the visibility of the quick search widget.

void CSongCodeEditor::wordAdded ( const QString &  word)
signal

This signal is emitted when a word word is added to the spellchecker dictionary.

void CSongCodeEditor::writeSettings ( )

Writes editor settings (ie, font, line numbers etc.).

See also:
readSettings

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