]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/textcompleter.h
Applied #15226 with modifications: wxRichTextCtrl: Implement setting properties with...
[wxWidgets.git] / include / wx / textcompleter.h
index 2e084c9e0393542284383c28021b9e6339bf1203..bc4135f8bf2aed22a6708f2f6f8d94956655bc25 100644 (file)
@@ -3,7 +3,6 @@
 // Purpose:     Declaration of wxTextCompleter class.
 // Author:      Vadim Zeitlin
 // Created:     2011-04-13
-// RCS-ID:      $Id: wxhead.h,v 1.12 2010-04-22 12:44:51 zeitlin Exp $
 // Copyright:   (c) 2011 Vadim Zeitlin <vadim@wxwidgets.org>
 // Licence:     wxWindows licence
 ///////////////////////////////////////////////////////////////////////////////
@@ -55,5 +54,33 @@ private:
     wxDECLARE_NO_COPY_CLASS(wxTextCompleterSimple);
 };
 
+// ----------------------------------------------------------------------------
+// wxTextCompleterFixed: Trivial wxTextCompleter implementation which always
+// returns the same fixed array of completions.
+// ----------------------------------------------------------------------------
+
+// NB: This class is private and intentionally not documented as it is
+//     currently used only for implementation of completion with the fixed list
+//     of strings only by wxWidgets itself, do not use it outside of wxWidgets.
+
+class wxTextCompleterFixed : public wxTextCompleterSimple
+{
+public:
+    void SetCompletions(const wxArrayString& strings)
+    {
+        m_strings = strings;
+    }
+
+    virtual void GetCompletions(const wxString& WXUNUSED(prefix),
+                                wxArrayString& res)
+    {
+        res = m_strings;
+    }
+
+private:
+    wxArrayString m_strings;
+};
+
+
 #endif // _WX_TEXTCOMPLETER_H_