00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef MMSCLIENT_H
00024 #define MMSCLIENT_H
00025
00026
00027 #include <mtclbase.h>
00028 #include <e32std.h>
00029 #include "mmsconst.h"
00030
00031
00032
00033
00034
00035
00036 typedef struct
00037 {
00038 const TUint SymbianCharsetUID;
00039 const TUint IANAMIBEnum;
00040 }TMmsCharacterSetLookup;
00041
00042
00043
00044
00045 class CMmsSettings;
00046 class CMmsHeaders;
00047 class CMsvMimeHeaders;
00048 class CMsvFindText;
00049 class CMmsAttachmentWaiter;
00050
00051
00052
00093 class CMmsClientMtm :public CBaseMtm
00094 {
00095 public:
00096
00108 IMPORT_C static CMmsClientMtm* NewL(
00109 CRegisteredMtmDll& aRegisteredMtmDll,
00110 CMsvSession& aSession );
00111
00115 virtual ~CMmsClientMtm();
00116
00117 public:
00118
00119
00120
00121
00185 virtual CMsvOperation* CreateNewEntryL(
00186 TMsvId aDestination,
00187 TRequestStatus& aCompletionStatus);
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00211 virtual void CreateServiceL();
00212
00213
00214
00215
00216
00217
00249 virtual const CMmsSettings& MmsSettings();
00250
00265 virtual void SetSettingsL( const CMmsSettings& aSettings );
00266
00273 virtual void StoreSettingsL();
00274
00281 virtual void RestoreSettingsL();
00282
00283
00292 virtual void RestoreFactorySettingsL(
00293 TMmsFactorySettingsLevel aLevel = EMmsFactorySettingsLevelNormal );
00294
00295
00312 virtual TInt ValidateService( TMsvId aServiceId );
00313
00314
00315
00316
00317
00318
00319
00320
00321
00322
00323
00324
00338 virtual void SetSenderL( const TDesC& aAlias );
00339
00346 virtual const TPtrC Sender() const;
00347
00361 virtual void SetMessageClass( TMmsMessageClass aMessageClass );
00362
00374 virtual TInt MessageClass() const;
00375
00386 virtual void SetExpiryInterval( TTimeIntervalSeconds aInterval );
00387
00396 virtual TTimeIntervalSeconds ExpiryInterval() const;
00397
00407 virtual void SetExpiryDate( TTime aDate );
00408
00416 virtual TTime ExpiryDate() const;
00417
00426 virtual void SetDeliveryTimeInterval( TTimeIntervalSeconds aInterval );
00427
00435 virtual TTimeIntervalSeconds DeliveryTimeInterval() const;
00436
00446 virtual void SetDeliveryDate( TTime aDate );
00447
00455 virtual TTime DeliveryDate() const;
00456
00468 virtual void SetMessagePriority( TMmsMessagePriority aPriority );
00469
00479 virtual TInt MessagePriority() const;
00480
00496 virtual void SetSenderVisibility(
00497 TMmsMessageSenderVisibility aVisibility );
00498
00513 virtual TInt SenderVisibility() const;
00514
00525 virtual void SetDeliveryReport(
00526 TMmsYesNo aRequest );
00527
00538 virtual TInt DeliveryReport() const;
00539
00551 virtual void SetReadReply( TMmsYesNo aRequest );
00552
00567 virtual TInt ReadReply() const;
00568
00576 virtual TTime SendingDate() const;
00577
00589 virtual TPtrC ResponseText() const;
00590
00610 virtual TInt ResponseStatus() const;
00611
00623 virtual TInt NumberOfPreviousSenders() const;
00624
00639 virtual TPtrC PreviousSender( TInt aSequenceNumber ) const;
00640
00655 virtual TTime PreviousSendingDate( TInt aSequenceNumber ) const;
00656
00664 virtual TTime MessageReceiveTime() const;
00665
00673 virtual TInt MessageTransferSize() const;
00674
00683 virtual TPtrC8 MessageContentLocation() const;
00684
00691 virtual void SetMessageRootL( const TMsvAttachmentId aId );
00692
00699 virtual TMsvAttachmentId MessageRootAttachment() const;
00700
00707 virtual void SetMaximumImage( TInt aWidth, TInt aHeight );
00708
00716 virtual void GetMaximumImage( TInt& aWidth, TInt& aHeight ) const;
00717
00718
00719
00720
00731 virtual TInt32 MessageSize();
00732
00749 virtual void SetMessageDescriptionL( const TDesC& aText );
00750
00751
00752
00753
00768 virtual void AddAttributeL( const TDesC& aName, const TDesC& aValue );
00769
00777 virtual TPtrC GetAttributeL( const TDesC& aName );
00778
00785 virtual TBool FindAttribute( const TDesC& aName );
00786
00792 virtual void DeleteAttribute( const TDesC& aName );
00793
00799 virtual void ResetAttributes();
00800
00801
00802
00803
00913 virtual void CreateAttachment2L(
00914 CMsvStore& aStore,
00915 RFile& aFile,
00916 TDesC8& aMimeType,
00917 CMsvMimeHeaders& aMimeHeaders,
00918 CMsvAttachment* aAttachmentInfo,
00919 TMsvAttachmentId& aAttaId);
00920
00971 virtual void CreateTextAttachmentL(
00972 CMsvStore& aStore,
00973 TMsvAttachmentId& aAttachmentId,
00974 const TDesC& aText,
00975 const TDesC& aFile,
00976 TBool aConvertParagraphSeparator = ETrue );
00977
00978
00979
00980
00981
00982
01006 virtual CMsvOperation* SendL( TRequestStatus& aCompletionStatus,
01007 const TTime aSendingTime = TTime( 0 ) );
01008
01034 virtual CMsvOperation* SendL(
01035 CMsvEntrySelection& aSelection,
01036 TRequestStatus& aCompletionStatus,
01037 TTime aSendingTime = TTime( 0 ) );
01038
01066 virtual CMsvOperation* FetchAllL( TRequestStatus& aCompletionStatus,
01067 TBool aForced = ETrue );
01068
01101 virtual CMsvOperation* SendReadReportL( TMsvId aReadMessageId,
01102 TRequestStatus& aCompletionStatus,
01103 TMmsReadStatus aReadStatus = EMmsReadStatusRead );
01104
01105 public:
01106
01111 inline TUid Type() const;
01112
01113
01114
01115
01120 inline void SetCurrentEntryL( CMsvEntry* aEntry );
01121
01126 inline void SwitchCurrentEntryL( TMsvId aId );
01127
01132 inline CMsvEntry& Entry() const;
01133
01140 inline TBool HasContext() const;
01141
01142
01143
01147 void SaveMessageL();
01148
01152 void LoadMessageL();
01153
01169 TMsvPartList ValidateMessage( TMsvPartList aPartList );
01170
01186 TMsvPartList Find( const TDesC& aTextToFind, TMsvPartList aPartList );
01187
01210 CMsvOperation* ReplyL(
01211 TMsvId aDestination,
01212 TMsvPartList aPartlist,
01213 TRequestStatus& aCompletionStatus );
01214
01237 CMsvOperation* ForwardL(
01238 TMsvId aDestination,
01239 TMsvPartList aPartList,
01240 TRequestStatus& aCompletionStatus );
01241
01256 void AddAddresseeL( const TDesC& aRealAddress );
01257
01265 void AddAddresseeL( const TDesC& aRealAddress, const TDesC& aAlias );
01266
01276 virtual void AddAddresseeL(
01277 TMsvRecipientType aType,
01278 const TDesC& aRealAddress);
01279
01290 virtual void AddAddresseeL(
01291 TMsvRecipientType aType,
01292 const TDesC& aRealAddress,
01293 const TDesC& aAlias);
01294
01302 void RemoveAddressee( TInt aIndex );
01303
01304
01305
01313 inline CRichText& Body();
01314
01322 inline const CRichText& Body() const;
01323
01328 void SetSubjectL( const TDesC& aSubject );
01329
01334 const TPtrC SubjectL() const;
01335
01336
01337
01350 TInt QueryCapability( TUid aCapability, TInt& aResponse );
01351
01365 void InvokeSyncFunctionL(
01366 TInt aFunctionId,
01367 const CMsvEntrySelection& aSelection,
01368 TDes8& aParameter );
01369
01386 CMsvOperation* InvokeAsyncFunctionL(
01387 TInt aFunctionId,
01388 const CMsvEntrySelection& aSelection,
01389 TDes8& aParameter,
01390 TRequestStatus& aCompletionStatus );
01391
01396 inline CMsvSession& Session();
01397
01398
01399
01455 void AddAttachmentL( const TDesC& aFilePath,
01456 const TDesC8& aMimeType,
01457 TUint aCharset,
01458 TRequestStatus& aStatus );
01459
01519 void AddAttachmentL( RFile& aFile,
01520 const TDesC8& aMimeType,
01521 TUint aCharset,
01522 TRequestStatus& aStatus );
01523
01552 void AddLinkedAttachmentL( const TDesC& aFilePath,
01553 const TDesC8& aMimeType,
01554 TUint aCharset,
01555 TRequestStatus& aStatus );
01556
01564 void AddEntryAsAttachmentL( TMsvId aAttachmentId,
01565 TRequestStatus& aStatus );
01566
01621 void CreateAttachmentL( const TDesC& aFileName,
01622 RFile& aAttachmentFile,
01623 const TDesC8& aMimeType,
01624 TUint aCharset,
01625 TRequestStatus& aStatus);
01626
01630 void CancelAttachmentOperation();
01631
01632
01633
01657 void CreateMessageL( TMsvId aServiceId );
01658
01664 void BioTypeChangedL( TUid aBioTypeUid );
01665
01672 TMsvId DefaultServiceL() const;
01673
01679 void RemoveDefaultServiceL();
01680
01686 void ChangeDefaultServiceL(const TMsvId& aService);
01687
01688 protected:
01689
01695 CMsvEntrySelection* ListNotificationsInInboxL();
01696
01697 protected:
01698
01703 void ContextEntrySwitched();
01704
01713 void HandleEntryEventL(
01714 TMsvEntryEvent aEvent,
01715 TAny* arg1,
01716 TAny* arg2,
01717 TAny* arg3 );
01718
01724 CMmsClientMtm(
01725 CRegisteredMtmDll& aRegisteredMtmDll,
01726 CMsvSession& aSession );
01727
01728 void ConstructL();
01729
01730 private:
01731
01735 void BuildAddresseeListL();
01736
01742 void BuildAddresseeListL(
01743 const CDesCArray& aArray, TMsvRecipientType aValue);
01744
01749 TInt32 AttachmentsSizeL();
01750
01755 CMsvEntrySelection* ListMmsFolderNotificationsL();
01756
01761 CMsvEntrySelection* ListInboxNotificationsL();
01762
01777 CMsvOperation* FetchAllFromInboxL( TRequestStatus& aCompletionStatus,
01778 TBool aForced = ETrue );
01779
01785
01786
01787
01788
01789
01798 TBool FindInRecipientL(
01799 const TDesC& aTextToFind,
01800 TMsvPartList aPartlist,
01801 const CDesCArray& aRecipients,
01802 CMsvFindText& aFindText );
01803
01816 void AddFilePathAttachmentL(const TDesC& aFilePath,
01817 const TDesC8& aMimeType,
01818 CMsvAttachment::TMsvAttachmentType aType,
01819 TRequestStatus& aStatus,
01820 const TUint aCharacterSet = 0 );
01821
01826 void StoreAttributesL( CMsvStore& aStore );
01827
01832 void RestoreAttributesL( CMsvStore& aStore );
01833
01842 TUint GetUnicodeCharacterSet( TDesC8& aSample );
01843
01851 void ReadBytesFromFileL( const RFile aFile, TDes8& aSample );
01852
01859 TUint RecognizeCharSetL( RFile& aFile );
01860
01861
01862 public:
01863
01864 protected:
01865 CMmsSettings* iMmsSettings;
01866
01867 CMmsHeaders* iMmsHeaders;
01868 TMsvId iServiceId;
01869 TBool iFetchAll;
01870
01871
01872 TBool iFetchOverride;
01873 TInt iMessageDrive;
01874
01875 TInt32 iHomeMode;
01876 TInt32 iRoamingMode;
01877 TInt iAccessPointCount;
01878 CDesCArrayFlat* iAttributes;
01879
01880 CMsvSession& iOwnSession;
01881
01882
01883 private:
01884
01885
01886 CMmsAttachmentWaiter* iAttaWaiter;
01887
01888 public:
01889
01890 protected:
01891
01892 private:
01893
01894 };
01895
01896
01897 GLREF_C void gPanic( TMmsPanic aPanic );
01898
01899 #include "mmsclient.inl"
01900
01901
01902 #endif
01903
01904
01905