BuildmLearn Toolkit  2.0.4
BuildmLearn Toolkit is an easy-to-use program that helps users make mobile apps without any knowledge of application development.
 All Classes Functions Enumerations Groups Pages
TemplateEditor Class Referenceabstract

Represents the editor of the template. More...

#include <templateeditor.h>

Collaboration diagram for TemplateEditor:
Collaboration graph

Public Slots

void dirtify ()
 Dirtifies (sets m_isDirty to true) the editor.
 

Signals

void changed ()
 Emitted everytime any child widget of editor changes its contents. More...
 
void canGenerateChanged (bool can_generate, const QString &message=QString())
 Emitted if status, which specifies if mobile application can be generated from the template, changes. More...
 

Public Member Functions

 TemplateEditor (TemplateCore *core, QWidget *parent=0)
 
virtual bool canGenerateApplications ()
 Specifies if template can generate applications or not. More...
 
virtual QString generationStatusDescription ()
 Access to description of current state. More...
 
virtual QString generateBundleData ()=0
 Generates RAW data which represent data of this template. More...
 
virtual bool loadBundleData (const QString &bundle_data)=0
 Loads editor state from XML bundle. More...
 
virtual void launch ()
 Executed when given template with this editor is launched. More...
 
TemplateCorecore () const
 Access to associated template core. More...
 
bool isDirty () const
 Check if editor contains unsaved contents. More...
 
void setIsDirty (bool is_dirty)
 Sets new dirtiness status. More...
 
virtual QString projectName ()=0
 Access to project name of current editor. More...
 
virtual QString authorName ()=0
 Access to author name of current editor. More...
 

Protected Member Functions

void issueNewGenereationStatus (bool can_generate, const QString &message=QString())
 Emits new signal notifying other components about state of creating of APK application. More...
 

Protected Attributes

bool m_canGenerate
 
QString m_generateMessage
 
bool m_isDirty
 
TemplateCorem_core
 

Detailed Description

Represents the editor of the template.

Editor is the place where user can edit contents of the template, for example questions for Quiz template.

Definition at line 46 of file templateeditor.h.

Member Function Documentation

virtual QString TemplateEditor::authorName ( )
pure virtual

Access to author name of current editor.

Returns
Returns string of author name. This is usually text in some text box in the editor.

Implemented in QuizEditor, LearnSpellingsEditor, BasicmLearningEditor, and FlashCardEditor.

virtual bool TemplateEditor::canGenerateApplications ( )
inlinevirtual

Specifies if template can generate applications or not.

Returns
Returns true if editor contains enough data for generating of applications.
Warning
This is used in cooperation with canGenerateStatusChanged(bool can_generate).

Reimplemented in QuizEditor, LearnSpellingsEditor, BasicmLearningEditor, and FlashCardEditor.

Definition at line 59 of file templateeditor.h.

59  {
60  return m_canGenerate;
61  }

Here is the caller graph for this function:

void TemplateEditor::canGenerateChanged ( bool  can_generate,
const QString &  message = QString() 
)
signal

Emitted if status, which specifies if mobile application can be generated from the template, changes.

Warning
This signal also specifies if new simulation can be started.
Parameters
can_generateTrue if editor contains enough data so that mobile application can be generated, false otherwise.
Remarks
This is for example emitted if user ads first question item to Quiz template editor.

Here is the caller graph for this function:

void TemplateEditor::changed ( )
signal

Emitted everytime any child widget of editor changes its contents.

Remarks
This signal is used to check if contents of editor are saved or not. If editor notifies that its contents are changed, then it is marked by toolkit as "unsaved".
TemplateCore * TemplateEditor::core ( ) const

Access to associated template core.

Returns
Returns associated template core.
See also
TemplateCore

Definition at line 56 of file templateeditor.cpp.

56  {
57  return m_core;
58 }

Here is the caller graph for this function:

virtual QString TemplateEditor::generateBundleData ( )
pure virtual

Generates RAW data which represent data of this template.

Remarks
Generated data are stored in XML bundle file.
Warning
Generated data of this method must be compatible with custom implementation of TemplateEntryPoint::loadCoreFromBundleData(const QString &raw_data) method!!!
Returns
Returns string with generated data.

Implemented in QuizEditor, BasicmLearningEditor, LearnSpellingsEditor, and FlashCardEditor.

Here is the caller graph for this function:

virtual QString TemplateEditor::generationStatusDescription ( )
inlinevirtual

Access to description of current state.

Returns
Returns active description of generating state.

Definition at line 65 of file templateeditor.h.

65  {
66  return m_generateMessage;
67  }
bool TemplateEditor::isDirty ( ) const

Check if editor contains unsaved contents.

Returns
Returns true, if editor contains unsaved contents, otherwise returns false.

Definition at line 60 of file templateeditor.cpp.

60  {
61  return m_isDirty;
62 }
void TemplateEditor::issueNewGenereationStatus ( bool  can_generate,
const QString &  message = QString() 
)
protected

Emits new signal notifying other components about state of creating of APK application.

Parameters
can_generateTrue if editor contains enough data to generate APK application or not.
messageNew message to be delivered to application about current status of creating of APK application.

Definition at line 68 of file templateeditor.cpp.

68  {
69  m_canGenerate = can_generate;
70  m_generateMessage = message;
71 
72  emit canGenerateChanged(can_generate, message);
73 }
void canGenerateChanged(bool can_generate, const QString &message=QString())
Emitted if status, which specifies if mobile application can be generated from the template...

Here is the caller graph for this function:

void TemplateEditor::launch ( )
virtual

Executed when given template with this editor is launched.

Note
Editor is "launched" when its core is newly created or loaded from XML bundle file. Durin "launch" usually only check if data contained in editor is done.

Definition at line 45 of file templateeditor.cpp.

45  {
48  }
49  else {
51  tr("Simulation or mobile application generation cannot be started \n"
52  "because editor does not contain enough data."));
53  }
54 }
virtual bool canGenerateApplications()
Specifies if template can generate applications or not.
void issueNewGenereationStatus(bool can_generate, const QString &message=QString())
Emits new signal notifying other components about state of creating of APK application.

Here is the call graph for this function:

Here is the caller graph for this function:

virtual bool TemplateEditor::loadBundleData ( const QString &  bundle_data)
pure virtual

Loads editor state from XML bundle.

Parameters
bundle_dataRaw XML bundle data.
Returns
Returns true if editor loaded bundle data, otherwise returns false.

Implemented in QuizEditor, BasicmLearningEditor, LearnSpellingsEditor, and FlashCardEditor.

Here is the caller graph for this function:

virtual QString TemplateEditor::projectName ( )
pure virtual

Access to project name of current editor.

Returns
Returns string of project name of current editor. This is usually text in some text box in the editor.

Implemented in QuizEditor, LearnSpellingsEditor, BasicmLearningEditor, and FlashCardEditor.

Here is the caller graph for this function:

void TemplateEditor::setIsDirty ( bool  is_dirty)

Sets new dirtiness status.

Parameters
is_dirtyNew dirtiness status.

Definition at line 64 of file templateeditor.cpp.

64  {
65  m_isDirty = is_dirty;
66 }

Here is the caller graph for this function:


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