WSF
WsfExeManager.hpp
Go to the documentation of this file.
1// ****************************************************************************
2// CUI
3//
4// The Advanced Framework for Simulation, Integration, and Modeling (AFSIM)
5//
6// Copyright 2003-2015 The Boeing Company. All rights reserved.
7//
8// The use, dissemination or disclosure of data in this file is subject to
9// limitation or restriction. See accompanying README and LICENSE for details.
10// ****************************************************************************
11
12#ifndef WSFEXEMANAGER_HPP
13#define WSFEXEMANAGER_HPP
14
15#include <functional>
16#include <memory>
17#include <string>
18#include <vector>
19
20#include <QObject>
21#include <QSet>
22
23#include "UtCallback.hpp"
24#include "UtCallbackHolder.hpp"
25#include "ViExport.hpp"
27#include "WsfStyler.hpp"
28#include "XML_Context.hpp"
29
30class QComboBox;
31class QSettings;
32class UtPath;
33
35#define wizExeMgr wizard::WsfExeManager::GetInstance()
36
37namespace wizard
38{
39class WsfExe;
40
41class VI_EXPORT WsfExeManager : public QObject
42{
43public:
44 static WsfExeManager& GetInstance();
45
47 ~WsfExeManager() override;
48
49 void LoadSettings(QSettings& aSettings);
50 void SaveSettings(QSettings& aSettings);
51
52 WsfExe* Find(const UtPath& aPath) const;
53 WsfExe* Add(const UtPath& aPath);
54 void SetDefault(int aIndex);
57 WsfStyler* GetStyler() { return mWsfStylerPtr.get(); }
58 void Remove(WsfExe* aExePtr);
59 void Refresh();
60 bool Refresh(WsfExe* aExePtr);
61 const std::vector<WsfExe*>& GetExes() const { return mExes; }
62 WsfExe* FindByPath(const std::string& aPath);
63 WsfExe* FindByDescriptiveName(const std::string& aName);
64 WsfExe* FindByApplicationName(const std::string& aName);
65 WsfExe* FindBest(const std::string& aApplicationName, const std::string& aVersion, const std::string& aPath);
66
67 bool MoveDown(WsfExe* aExePtr);
68 bool MoveUp(WsfExe* aExePtr);
69
70 std::shared_ptr<WsfParseDefinitions> GetDefaultParseDefinitions();
71
72 WsfExe* FindFromXML(XML_Context& aContext);
73
74 int GetIndex(WsfExe* aExePtr);
75 static UtCallbackListN<void()> WsfExeListUpdated;
76
77 static void GetDefaultGrammar(WsfParseDefinitions& parseDefinitions, std::string& fullGrammarText);
78protected slots:
79 void WsfExePicked(int);
80
81protected:
82 bool IgnoreExecutable(const std::string& aFileName);
83 void LoadDefaultGrammar();
84 void Clear();
85
86 std::vector<WsfExe*> mExes;
88 std::unique_ptr<WsfStyler> mWsfStylerPtr;
90 UtCallbackHolder mCallbacks;
92 QSet<QString> mFileNamesToIgnore;
93};
94} // namespace wizard
95#endif
#define VI_EXPORT
Definition ViExport.hpp:38
Definition WsfParseDefinitions.hpp:39
WsfExe * GetDefaultExe()
Definition WsfExeManager.cpp:433
bool mAutoLoad
Definition WsfExeManager.hpp:91
static WsfExeManager & GetInstance()
Definition WsfExeManager.cpp:33
WsfExeManager()
Definition WsfExeManager.cpp:39
bool IgnoreExecutable(const std::string &aFileName)
Definition WsfExeManager.cpp:140
static void GetDefaultGrammar(WsfParseDefinitions &parseDefinitions, std::string &fullGrammarText)
Definition WsfExeManager.cpp:456
std::unique_ptr< WsfStyler > mWsfStylerPtr
Definition WsfExeManager.hpp:88
WsfExe * GetNoExe()
Definition WsfExeManager.cpp:442
const std::vector< WsfExe * > & GetExes() const
Definition WsfExeManager.hpp:61
static UtCallbackListN< void()> WsfExeListUpdated
Definition WsfExeManager.hpp:75
WsfExe * mNoExePtr
Definition WsfExeManager.hpp:87
WsfStyler * GetStyler()
Definition WsfExeManager.hpp:57
UtCallbackHolder mCallbacks
Definition WsfExeManager.hpp:90
WsfExe * Add(const UtPath &aPath)
Definition WsfExeManager.cpp:70
QSet< QString > mFileNamesToIgnore
Definition WsfExeManager.hpp:92
WsfExe * Find(const UtPath &aPath) const
Definition WsfExeManager.cpp:58
void LoadDefaultGrammar()
Definition WsfExeManager.cpp:171
void LoadSettings(QSettings &aSettings)
int mDefaultExeIndex
Definition WsfExeManager.hpp:89
void SaveSettings(QSettings &aSettings)
void SetDefault(int aIndex)
Definition WsfExeManager.cpp:221
std::vector< WsfExe * > mExes
Definition WsfExeManager.hpp:86
void Clear()
Definition WsfExeManager.cpp:111
Definition WsfExe.hpp:46
syntax-highlights a WSF file.
Definition WsfStyler.hpp:37
Definition XML_Context.hpp:58
Definition Runner.hpp:22
Copyrights Multiple, All Rights Reserved