00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 #ifndef _CMESSAGESUMMARYGENERATOR_H
00018 #define _CMESSAGESUMMARYGENERATOR_H
00019 
00020 #include <e32base.h>
00021 #include <e32cons.h>
00022 
00023 #include <msvstd.h>
00024 #include <msvapi.h>
00025 #include <msvids.h>
00026 
00027 #include <smut.h> 
00028 
00029 
00033 
00034 
00035 const TInt KMaxSummaryMessages = 3;
00036 
00037 
00038 const TInt KMaxSummaryStringSize = 20;
00039 
00040 
00041 const TInt KSubjectIndent = 15;
00042 
00043 
00044 struct TMessageSummary
00045         {
00046         TBuf<KMaxSummaryStringSize> iFrom;
00047         TBuf<KMaxSummaryStringSize> iSummaryText;
00048         };
00049 
00050 class CMessageSummaryGenerator : public CBase
00051         {
00052 public:
00053         CMessageSummaryGenerator(TMsvId aInboxEntry,
00054                                                                 TUid aMessageType,
00055                                                                 CMsvEntry& aMessagingEntry);
00056                                                                                                                                 
00057         
00058         
00059         void StartL(TRequestStatus& aStatus);
00060 
00061         
00062         const RArray<TMessageSummary>& MessageSummaries() const;
00063         
00064         
00065         
00066         
00067         
00068         inline TBool MessageOfCorrectType(const TMsvEntry& aEntry) const;
00069 
00070         ~CMessageSummaryGenerator();
00071 
00072 private:
00073         
00074         TBool SummariseNextMessage();
00075         
00076 private:
00077         CMsvEntry& iMessagingEntry;
00078         TMsvId iInboxEntry;
00079         TUid iMessageType;
00080         
00081 private:
00082         RArray<TMessageSummary> iMessageSummaries;
00083         };
00084 
00085 
00086 
00087 
00088 
00089 
00090 
00091 TBool CMessageSummaryGenerator::MessageOfCorrectType(const TMsvEntry& aEntry) const
00092         {
00093         if ((aEntry.Parent() == iInboxEntry) 
00094                 && (aEntry.iMtm == iMessageType)) 
00095                 return ETrue;
00096         else
00097                 return EFalse;          
00098         }
00099 
00100 #endif
00101