SeExpr
ExprBrowser.h
Go to the documentation of this file.
1/*
2* Copyright Disney Enterprises, Inc. All rights reserved.
3*
4* Licensed under the Apache License, Version 2.0 (the "License");
5* you may not use this file except in compliance with the License
6* and the following modification to it: Section 6 Trademarks.
7* deleted and replaced with:
8*
9* 6. Trademarks. This License does not grant permission to use the
10* trade names, trademarks, service marks, or product names of the
11* Licensor and its affiliates, except as required for reproducing
12* the content of the NOTICE file.
13*
14* You may obtain a copy of the License at
15* http://www.apache.org/licenses/LICENSE-2.0
16*
17* @file ExprBrowser.h
18* @brief Browser for a library of expressions from a tree of files
19* @author aselle
20*/
21#ifndef ExprBrowser_h
22#define ExprBrowser_h
23
24#include <QWidget>
25#include <QAbstractItemModel>
26
27#include <iostream>
28#include <fstream>
29#include <sstream>
30
31class QLineEdit;
32class QTreeWidget;
33class QTreeView;
34class QTreeWidgetItem;
35class QTextBrowser;
36class ExprEditor;
37class QSortFilterProxyModel;
38class QDir;
39
40class ExprTreeModel;
42
43class ExprBrowser : public QWidget {
44 Q_OBJECT
45
47 QList<QString> labels;
48 QList<QString> paths;
51 QTreeView* treeNew;
52 QLineEdit* exprFilter;
53 std::string _userExprDir;
54 std::string _localExprDir;
55 std::string _context;
56 std::string _searchPath;
58
59 public:
60 ExprBrowser(QWidget* parent, ExprEditor* editor);
62 void addPath(const std::string& name, const std::string& path);
63 std::string getSelectedPath();
64 void selectPath(const char* path);
65 void addUserExpressionPath(const std::string& context);
66 bool getExpressionDirs();
67 bool getExpressionDirs(const std::string& context);
68 void setSearchPath(const QString& context, const QString& path);
69 void expandAll();
70 void expandToDepth(int depth);
71 void setApplyOnSelect(bool on) { _applyOnSelect = on; }
72 public
73slots:
74 void handleSelection(const QModelIndex& current, const QModelIndex& previous);
75 void update();
76 void clear();
77 void clearSelection();
78 void saveExpression();
80 void saveExpressionAs();
81 private
82slots:
83 void clearFilter();
84 void filterChanged(const QString& str);
85};
86
87#endif
ExprEditor * editor
Definition: ExprBrowser.h:46
QTreeView * treeNew
Definition: ExprBrowser.h:51
void expandToDepth(int depth)
void setSearchPath(const QString &context, const QString &path)
void saveExpression()
void expandAll()
void handleSelection(const QModelIndex &current, const QModelIndex &previous)
void saveLocalExpressionAs()
bool _applyOnSelect
Definition: ExprBrowser.h:57
void filterChanged(const QString &str)
std::string _userExprDir
Definition: ExprBrowser.h:53
bool getExpressionDirs(const std::string &context)
bool getExpressionDirs()
QList< QString > paths
Definition: ExprBrowser.h:48
void clearSelection()
QLineEdit * exprFilter
Definition: ExprBrowser.h:52
QList< QString > labels
Definition: ExprBrowser.h:47
std::string _context
Definition: ExprBrowser.h:55
void addUserExpressionPath(const std::string &context)
void setApplyOnSelect(bool on)
Definition: ExprBrowser.h:71
void addPath(const std::string &name, const std::string &path)
std::string getSelectedPath()
std::string _searchPath
Definition: ExprBrowser.h:56
ExprTreeFilterModel * proxyModel
Definition: ExprBrowser.h:50
void selectPath(const char *path)
void clearFilter()
void saveExpressionAs()
std::string _localExprDir
Definition: ExprBrowser.h:54
ExprTreeModel * treeModel
Definition: ExprBrowser.h:49
If a scalar is used in a vector context
Definition: userdoc.txt:436