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 
25 #include <QtGui/QWidget>
26 #include <QtCore/QAbstractItemModel>
27 
28 #include <iostream>
29 #include <fstream>
30 #include <sstream>
31 
32 class QLineEdit;
33 class QTreeWidget;
34 class QTreeView;
35 class QTreeWidgetItem;
36 class QTextBrowser;
37 class ExprEditor;
38 class QSortFilterProxyModel;
39 class QDir;
40 
41 class ExprTreeModel;
43 
44 class ExprBrowser : public QWidget
45 {
46  Q_OBJECT
47 
49  QList<QString> labels;
50  QList<QString> paths;
53  QTreeView* treeNew;
54  QLineEdit* exprFilter;
55  std::string _userExprDir;
56  std::string _localExprDir;
57  std::string _context;
58  std::string _searchPath;
60 
61 public:
62  ExprBrowser(QWidget* parent, ExprEditor* editor);
63  ~ExprBrowser();
64  void addPath(const std::string& name,const std::string& path);
65  std::string getSelectedPath();
66  void selectPath(const char * path);
67  void addUserExpressionPath(const std::string &context);
68  bool getExpressionDirs();
69  bool getExpressionDirs(const std::string& context);
70  void setSearchPath(const QString& context, const QString& path);
71  void expandAll();
72  void expandToDepth(int depth);
73  void setApplyOnSelect(bool on) {_applyOnSelect = on; }
74 public slots:
75  void handleSelection(const QModelIndex& current,const QModelIndex& previous);
76  void update();
77  void clear();
78  void clearSelection();
79  void saveExpression();
80  void saveLocalExpressionAs();
81  void saveExpressionAs();
82 private slots:
83  void clearFilter();
84  void filterChanged(const QString& str);
85 
86 };
87 
88 #endif
void setSearchPath(const QString &context, const QString &path)
void selectPath(const char *path)
void addPath(const std::string &name, const std::string &path)
QTreeView * treeNew
Definition: ExprBrowser.h:53
void setApplyOnSelect(bool on)
Definition: ExprBrowser.h:73
void clearFilter()
std::string _searchPath
Definition: ExprBrowser.h:58
QLineEdit * exprFilter
Definition: ExprBrowser.h:54
void filterChanged(const QString &str)
void expandAll()
QList< QString > labels
Definition: ExprBrowser.h:49
ExprTreeModel * treeModel
Definition: ExprBrowser.h:51
void clearSelection()
ExprTreeFilterModel * proxyModel
Definition: ExprBrowser.h:52
std::string getSelectedPath()
void saveLocalExpressionAs()
ExprEditor * editor
Definition: ExprBrowser.h:48
void addUserExpressionPath(const std::string &context)
void saveExpressionAs()
QList< QString > paths
Definition: ExprBrowser.h:50
If a scalar is used in a vector context
Definition: userdoc.txt:456
std::string _localExprDir
Definition: ExprBrowser.h:56
bool getExpressionDirs()
void expandToDepth(int depth)
void saveExpression()
ExprBrowser(QWidget *parent, ExprEditor *editor)
void handleSelection(const QModelIndex &current, const QModelIndex &previous)
bool _applyOnSelect
Definition: ExprBrowser.h:59
std::string _userExprDir
Definition: ExprBrowser.h:55
std::string _context
Definition: ExprBrowser.h:57