00001 /* 00002 * (c) Disney Enterprises, Inc. All rights reserved. 00003 * 00004 * This file is licensed under the terms of the Microsoft Public License (MS-PL) 00005 * as defined at: http://opensource.org/licenses/MS-PL. 00006 * 00007 * A complete copy of this license is included in this distribution as the file 00008 * LICENSE. 00009 * 00010 * @file EditableExpression.h 00011 * @author Andrew Selle 00012 */ 00013 #ifndef __EditableExpression__ 00014 #define __EditableExpression__ 00015 00016 #include <vector> 00017 #include <string> 00018 00019 class SeExprEdEditable; 00020 00022 class SeExprEdEditableExpression{ 00023 std::string _expr; // original full expression 00024 typedef std::vector<SeExprEdEditable*> Editables; 00025 std::vector<SeExprEdEditable*> _editables; // control that can edit the expression 00026 std::vector<std::string> _variables; 00027 public: 00028 SeExprEdEditableExpression(); 00029 ~SeExprEdEditableExpression(); 00030 00032 void setExpr(const std::string& expr); 00033 00035 std::string getEditedExpr() const; 00036 00038 bool controlsMatch(const SeExprEdEditableExpression& other) const; 00039 00041 void updateString(const SeExprEdEditableExpression& other); 00042 00044 SeExprEdEditable* operator[](const int i){return _editables[i];} 00045 00047 size_t size() const{return _editables.size();} 00048 00050 const std::vector<std::string>& getVariables() const{return _variables;} 00051 private: 00053 void cleanup(); 00054 }; 00055 00056 #endif