+class WXDLLEXPORT wxItemContainerImmutable
+{
+public:
+ wxItemContainerImmutable() { }
+ virtual ~wxItemContainerImmutable();
+
+ // accessing strings
+ // -----------------
+
+ virtual size_t GetCount() const = 0;
+ bool IsEmpty() const { return GetCount() == 0; }
+
+ virtual wxString GetString(int n) const = 0;
+ wxArrayString GetStrings() const;
+ virtual void SetString(int n, const wxString& s) = 0;
+
+ // finding string natively is either case sensitive or insensitive
+ // but never both so fall back to this base version for not
+ // supported search type
+ virtual int FindString(const wxString& s, bool bCase = false) const
+ {
+ size_t count = GetCount();
+
+ for ( size_t i = 0; i < count ; ++i )
+ {
+ if (GetString(i).IsSameAs( s , bCase ))
+ return i;
+ }
+
+ return wxNOT_FOUND;
+ }
+
+
+ // selection
+ // ---------
+
+ virtual void SetSelection(int n) = 0;
+ virtual int GetSelection() const = 0;
+
+ // set selection to the specified string, return false if not found
+ bool SetStringSelection(const wxString& s);
+
+ // return the selected string or empty string if none
+ wxString GetStringSelection() const;
+
+ // this is the same as SetSelection( for single-selection controls but
+ // reads better for multi-selection ones
+ void Select(int n) { SetSelection(n); }
+
+
+protected:
+
+ // check that the index is valid
+ // FIXME: once api will move to size_t, drop >= 0 check
+ inline bool IsValid(int n) const { return n >= 0 && (size_t)n < GetCount(); }
+ inline bool IsValidInsert(int n) const { return n >= 0 && (size_t)n <= GetCount(); }
+};
+
+class WXDLLEXPORT wxItemContainer : public wxItemContainerImmutable