Salome HOME
Dimensions move using ModelAPI_ObjectMovedMessage mechanism. Move by deltas is obsole...
[modules/shaper.git] / src / Config / Config_FeatureReader.h
index cb16d9ea2313debe02a577ceb4b678b8edab5d74..de2c96ca9237c5a08f332480fd9fff9ec5d971b4 100644 (file)
@@ -1,37 +1,72 @@
-/*
- * Config_FeatureReader.h
- *
- *  Created on: Mar 20, 2014
- *      Author: sbh
- */
+// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or
+// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+//
 
 #ifndef CONFIG_FEATUREREADER_H_
 #define CONFIG_FEATUREREADER_H_
 
+#include <Config_def.h>
 #include <Config_XMLReader.h>
+#include <memory>
+
+#include <string>
+#include <list>
+
+class Config_FeatureMessage;
 
-class CONFIG_EXPORT Config_FeatureReader: public Config_XMLReader
+/*!
+ * \class Config_FeatureReader
+ * \ingroup Config
+ * \brief Class to process feature's xml definition.
+ */
+class Config_FeatureReader : public Config_XMLReader
 {
-public:
-  Config_FeatureReader(const std::string& theXmlFile);
+ public:
+  /// Constructor
   Config_FeatureReader(const std::string& theXmlFile,
-                       const std::string& theLibraryName);
+                       const std::string& theLibraryName,
+                       const char* theEventGenerated = 0);
   virtual ~Config_FeatureReader();
+  /// Returns list of all features defined in reader's file
+  std::list<std::string> features() const;
+
+ protected:
+  /// Overloaded method. Defines how to process each node
+  virtual void processNode(xmlNodePtr aNode);
 
-  std::string featureWidgetCfg(std::string theFeatureName);
+  /// Overloaded method. Clears attribute cache on exit from attribute's node
+  virtual void cleanup(xmlNodePtr aNode);
 
-protected:
-  void processNode(xmlNodePtr aNode);
-  bool processChildren(xmlNodePtr aNode);
+  /// Overloaded method. Defines if the given node should be parsed recursively
+  virtual bool processChildren(xmlNodePtr aNode);
 
-  void fillFeature(xmlNodePtr theRoot, Config_FeatureMessage& outFeatureMessage);
+  /// Fills feature message
+  void fillFeature(xmlNodePtr theRoot,
+                   const std::shared_ptr<Config_FeatureMessage>& outFeatureMessage);
 
-  std::string myLastWorkbench;
-  std::string myLastGroup;
+ private:
   std::string myLibraryName;
 
-  bool myFetchWidgetCfg;
-  std::string myWidgetCfg;
+  std::list<std::string> myFeatures;
+  /// event generated on feature data sending, by default it is Config_FeatureMessage::GUI_EVENT()
+  const char* myEventGenerated;
+  bool myIsProcessWidgets;
 };
 
 #endif /* CONFIG_FEATUREREADER_H_ */