examples/ForumNokia/SMSExample/GUI/inc/SMSExampleMarkableListContainer.h

00001 /*
00002  * Copyright © 2008 Nokia Corporation.
00003  */
00004 
00005 #ifndef __SMSEXAMPLE_MARKABLELISTCONTAINER_H
00006 #define __SMSEXAMPLE_MARKABLELISTCONTAINER_H
00007 
00008 // INCLUDES
00009 #include <badesca.h> // CDesCArray
00010 #include <coecntrl.h> // CCoeControl
00011 #include <eiklbo.h> // MEikListBoxObserver
00012 #include <badesca.h> // CDesCArrayFlat
00013 #include <eikfrlb.h> //CEikFormattedCellListBox
00014 #include <msvstd.h> //TMsvId
00015 
00016 // CLASS DECLARATION
00017 
00021 class CMarkableListContainer : public CCoeControl, MEikListBoxObserver
00022     {
00023     public: // Constructors and destructor
00024 
00031         static CMarkableListContainer* NewL(const TRect& aRect);
00032 
00036         static CMarkableListContainer* NewLC(const TRect& aRect);
00037         ~CMarkableListContainer();
00038 
00039     public: // members
00040 
00046         void SetArraysL(CDesCArrayFlat* aAddress, CDesCArrayFlat* aMessage);
00047 
00052         void SetIdArray(RArray<TMsvId>* aArray);
00053 
00059         void MarkAllL(TBool aSelectionMode);
00060 
00065         RArray<TMsvId>* GetSelectedItems();
00066 
00067     private: // members
00068 
00072         void SetupListIconsL();
00073 
00079         void AddItemL(const TDesC& aFirstLabel, const TDesC& aSecondLabel);
00080 
00084         void MarkOrUnMarkL();
00085 
00092         void SelectItem(TInt aIndex, TBool aSelectAll);
00093 
00100         void DeSelectItem(TInt aIndex, TBool aDeselectAll);
00101 
00105         void CreateListL();
00106 
00110         void SetupScrollBarsL();
00111 
00112     private: // constructor
00113 
00117         void ConstructL(const TRect& aRect);
00118 
00119     private: // from MEikListBoxObserver
00120         void HandleListBoxEventL(CEikListBox* aListBox,
00121                                  TListBoxEvent aListBoxEvent);
00122 
00123     private: // from CoeControl
00124 
00128         void SizeChanged();
00129 
00133         TInt CountComponentControls() const;
00134 
00138         CCoeControl* ComponentControl(TInt aIndex) const;
00139 
00143         void Draw(const TRect& aRect) const;
00144 
00148         TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,
00149                                     TEventCode aType);
00150 
00151 
00152     private:
00153 
00158         void Cleanup();
00159 
00160     private: //data
00161 
00162         // CAknDoubleGraphicStyleListBox
00163         CEikFormattedCellListBox* iSmsListBox;
00164 
00165         // One folder SMS recipients
00166         CDesCArrayFlat* iAddress;
00167 
00168         // One folder SMS bodys
00169         CDesCArrayFlat* iMessage;
00170 
00171         // All SMS ids of one folder.
00172         RArray<TMsvId>* iIdArray;
00173 
00174         // Array of Ids of those SMS that have been marked.
00175         RArray<TMsvId>* iSelectedIds;
00176 
00177     };
00178 
00179 #endif  // #ifndef __SMSEXAMPLE_MARKABLELISTCONTAINER_H
00180 
00181 

Generated by  doxygen 1.6.2