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
templateentrypoint.h
1 /*
2  Copyright (c) 2012, BuildmLearn Contributors listed at http://buildmlearn.org/people/
3  All rights reserved.
4 
5  Redistribution and use in source and binary forms, with or without
6  modification, are permitted provided that the following conditions are met:
7 
8  * Redistributions of source code must retain the above copyright notice, this
9  list of conditions and the following disclaimer.
10 
11  * Redistributions in binary form must reproduce the above copyright notice,
12  this list of conditions and the following disclaimer in the documentation
13  and/or other materials provided with the distribution.
14 
15  * Neither the name of the BuildmLearn nor the names of its
16  contributors may be used to endorse or promote products derived from
17  this software without specific prior written permission.
18 
19  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22  DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23  FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25  SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */
30 
31 #ifndef TEMPLATEENTRYPOINT_H
32 #define TEMPLATEENTRYPOINT_H
33 
34 #include <QObject>
35 
36 
37 class TemplateCore;
38 class TemplateFactory;
39 
40 /// \brief The entry point for a template.
41 ///
42 /// Entry points acts as a thin and light wrapper for template core.
43 /// It is primarily used to represent the template in "new project" dialog
44 /// and in some other places throughout the toolkit.
45 /// \see FormNewProject, TemplateCore
46 /// \ingroup template-interfaces
47 class TemplateEntryPoint : public QObject {
48  Q_OBJECT
49 
50  public:
51  // Constructors and destructors.
52  explicit TemplateEntryPoint(TemplateFactory *parent);
53  virtual ~TemplateEntryPoint();
54 
55  /// \brief Creates new instance of template core.
56  /// \return Returns pointer to new instance or NULL if no
57  /// such instance could be created.
58  virtual TemplateCore *createNewCore() = 0;
59 
60  /// \brief Creates new instance and fills it template-specific
61  /// data ("load project" functionality).
62  /// \param raw_data Template-specific data.
63  /// \return Returns pointer to new instance or NULL if no
64  /// such instance could be created.
65  virtual TemplateCore *loadCoreFromBundleData(const QString &raw_data) = 0;
66 
67  /// \brief Name of template.
68  virtual QString name() const;
69 
70  /// \brief Human-readable name of template.
71  virtual QString humanName() const;
72 
73  /// \brief Base folder of template.
74  virtual QString baseFolder() const;
75 
76  /// \brief Description of template.
77  virtual QString description() const;
78 
79  /// \brief Relative path to thumbnail image.
80  /// \remarks This path is relative to APP_TEMPLATES_PATH macro combined
81  /// with base folder of template.
82  virtual QString thumbnailImage() const;
83 
84  /// \brief Identifier of the template.
85  ///
86  /// Identifier is used to determine which template belongs XML bundle file to.
87  /// \return Returns identifier of the template.
88  QString typeIndentifier() const;
89 
90  /// \brief Access to name of template APK file.
91  /// \return Returns name of APK template.
92  QString mobileApplicationApkFile() const;
93 
94  protected:
95  QString m_name;
96  QString m_humanName;
97  QString m_baseFolder;
98  QString m_description;
99  QString m_thumbnailImage;
100  QString m_typeIndentifier;
101  QString m_mobileApplicationApkFile;
102 };
103 
104 #endif // TEMPLATEENTRYPOINT_H
QString typeIndentifier() const
Identifier of the template.
virtual QString description() const
Description of template.
virtual QString name() const
Name of template.
virtual TemplateCore * createNewCore()=0
Creates new instance of template core.
virtual TemplateCore * loadCoreFromBundleData(const QString &raw_data)=0
Creates new instance and fills it template-specific data ("load project" functionality).
virtual QString humanName() const
Human-readable name of template.
The top-level manager of templates.
QString mobileApplicationApkFile() const
Access to name of template APK file.
The entry point for a template.
virtual QString baseFolder() const
Base folder of template.
virtual QString thumbnailImage() const
Relative path to thumbnail image.
The core class container for single template.
Definition: templatecore.h:43