Index: trunk/src/lib/shell/shell_completion_plugin.h
===================================================================
--- trunk/src/lib/shell/shell_completion.h	(revision 7373)
+++ trunk/src/lib/shell/shell_completion_plugin.h	(revision 7374)
@@ -1,78 +1,58 @@
 /*!
- * @file shell_completion.h
- * @brief The Shell Completion Tasks
- *
- * @todo if the second string is a Command, the third should not be completed!
- * @todo also make some completion for registered (or special) Types
-*/
+ * @file shell_completion_plugin.h
+ * @brief The Shell Completion Plugin
+ */
 
-#ifndef _SHELL_COMPLETION_H
-#define _SHELL_COMPLETION_H
+#ifndef _SHELL_COMPLETION_PLUGIN_H
+#define _SHELL_COMPLETION_PLUGIN_H
 
+#include <list>
 #include <vector>
-#include <list>
 #include <string>
 
-// FORWARD DECLARATION
-class BaseObject;
-class ShellInput;
-#ifndef NULL
-#define NULL 0            //!< a pointer to NULL
-#endif
+namespace OrxShell
+{
+  class ShellCompletor
+  {
+  public:
+    virtual void addToCompleteList(std::vector<std::string>& completionList, const std::string& completionBegin) = 0;
+    virtual ~ShellCompletor() { };
+
+  protected:
+    ShellCompletor();
+  };
+
+  class ShellCompletorStringArray : public ShellCompletor
+  {
+  public:
+    ShellCompletorStringArray(const std::string* stringArray, unsigned int size)
+      : _stringArray(stringArray), _size(size) {};
+    virtual void addToCompleteList(std::vector<std::string>& completionList, const std::string& completionBegin);
+
+  private:
+    const std::string*   _stringArray;
+    unsigned int         _size;
+  };
 
 
-//! A class for Completing the an InputString.
-class ShellCompletion
-{
-
-  //! an enumerator for different types the Shell can complete.
-  typedef enum {
-    NullCompletion         = 0,
-    ClassCompletion        = 1,
-    ObjectCompletion       = 2,
-    FunctionCompletion     = 4,
-    AliasCompletion        = 8,
-  } CompletionType;
-
-  //! A struct for ShellElements (these are used as containers to identify an Input for what it is)
-  struct CompletionElement
+  //! A Templated Completor
+  template<typename CLASS> class ShellCompletorTList : public ShellCompletor
   {
-    std::string     name;     //!< the Name of the Element to be completed.
-    CompletionType type;     //!< the type of the Element
+  public:
+    ShellCompletorTList(const std::list<CLASS*>& completionList);
+    virtual void addToCompleteList(std::vector<std::string>& completionList, const std::string& completionBegin)
+    {};
   };
 
-public:
-  ShellCompletion();
-  virtual ~ShellCompletion();
+
+  //! A class for Completing the an InputString.
+  class ShellCompletionPlugin
+  {
+  public:
+    ShellCompletionPlugin();
 
 
-  // Functions to produce the Complete Lists.
-  bool autoComplete(std::string& input);
-  bool classComplete(const std::string& classBegin);
-  //  long classMatch(const char* input, unsigned int* length);
-  bool objectComplete(const std::string& objectBegin, long classID);
-  //  bool objectMatch(const char* objectBegin, long classID, unsigned int* length);
-  bool functionComplete(const std::string& functionBegin, const std::string& className);
-  //  bool functionMatch(const char* functionBegin, long classID, unsigned int* length);
-  bool aliasComplete(const std::string& aliasBegin);
+  };
 
-  bool generalComplete(std::string& input,
-                       const std::string& begin, const std::string& displayAs = "%s",
-                       const std::string& addBack = "", const std::string& addFront = "");
-
-
-  bool addToCompleteList(const std::list<std::string>& inputList, const std::string& completionBegin, ShellCompletion::CompletionType type);
-  bool addToCompleteList(const std::list<BaseObject*>& inputList, const std::string& completionBegin, ShellCompletion::CompletionType type);
-  void clearCompletionList();
-
-
-  // Helpers.
-  static const std::string& ShellCompletion::typeToString(ShellCompletion::CompletionType type);
-
-private:
-  std::vector<CompletionElement>  completionList;          //!< A list of completions, that are io.
-
-  static const std::string        typeNames[];             //!< A list of Completion-Type-Names.
-};
-
-#endif /* _SHELL_COMPLETION_H */
+}
+#endif /* _SHELL_COMPLETION_PLUGIN_H */
