trikRuntime
scriptHolder.h
Go to the documentation of this file.
1 /* Copyright 2016 Mikhail Kita
2  *
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License. */
14 
15 #pragma once
16 
17 #include <QtCore/qglobal.h>
18 
19 #include <QtCore/QString>
20 #include <QtCore/QStringList>
21 namespace trikGui {
22 
25 {
26 public:
28  ScriptHolder(ScriptHolder const&) = delete;
29 
31  ScriptHolder& operator=(ScriptHolder const&) = delete;
32 
34  static ScriptHolder* instance();
35 
37  const QStringList &titles() const;
38 
40  const QStringList &commands() const;
41 
43  int size() const;
44 
48  void setData(const QString &title, const QString &command);
49 
51  void clear();
52 
53 private:
55  ScriptHolder() = default;
56 
57  QStringList mTitles;
58  QStringList mCommands;
59 };
60 
61 }
Class which contains program from programming widget.
Definition: scriptHolder.h:24
static ScriptHolder * instance()
Creates instance of ScriptHolder.
Definition: scriptHolder.cpp:22
void clear()
Clears all stored data.
Definition: scriptHolder.cpp:49
const QStringList & commands() const
Returns list which contains scripts for commands.
Definition: scriptHolder.cpp:33
Definition: abstractIndicator.h:21
int size() const
Returns number of stored commands.
Definition: scriptHolder.cpp:38
ScriptHolder & operator=(ScriptHolder const &)=delete
Deleted.
const QStringList & titles() const
Returns list which contains titles of commands.
Definition: scriptHolder.cpp:28
void setData(const QString &title, const QString &command)
Adds given strings to appropriate list.
Definition: scriptHolder.cpp:43