phonebookengines/contactsmodel/tsrc/cfindtext.h
changeset 0 e686773b3f54
child 24 0ba2181d7c28
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonebookengines/contactsmodel/tsrc/cfindtext.h	Tue Feb 02 10:12:17 2010 +0200
@@ -0,0 +1,66 @@
+// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// CFindText Test module
+// 
+//
+
+
+#ifndef CFindText_H
+#define CFindText_H
+
+#include <e32base.h>
+#include <bamdesca.h>
+
+/**
+ * Small helper class for using CContactFindView. Takes in
+ * a string in constructor and breaks the string into words.
+ * Implements MDesCArray interface which provides access to the words
+ * found in the string.
+ */
+class CFindText : public CBase, public MDesCArray
+    {
+    public:  // Constructors and destructor
+        static CFindText* NewLC(const TDesC& aText);
+        ~CFindText();
+        
+    public:  // New functions
+        const TDesC& Text() const;
+
+    public:  // from MDesCArray
+        TInt MdcaCount() const;
+        TPtrC16 MdcaPoint(TInt aIndex) const;
+
+    private:  // Implementation
+        CFindText();
+        void ConstructL(const TDesC& aText);
+
+    private:
+        HBufC* iText;
+        RArray<TPtrC> iWords;
+    };
+
+inline CFindText::CFindText()
+    {
+    }
+
+inline const TDesC& CFindText::Text() const
+    {
+    if (iText)
+        return(*iText);
+    else
+        return KNullDesC;
+    }
+
+#endif
+