emailservices/emailcommon/inc/CFSMailBox.h
changeset 65 478bc57ad291
parent 30 759dc5235cdb
child 66 084b5b1f02a7
equal deleted inserted replaced
59:16ed8d08d0b1 65:478bc57ad291
   377      */    
   377      */    
   378 	 IMPORT_C void SearchL( const RPointerArray<TDesC>& aSearchStrings,
   378 	 IMPORT_C void SearchL( const RPointerArray<TDesC>& aSearchStrings,
   379 						    const TFSMailSortCriteria& aSortCriteria,
   379 						    const TFSMailSortCriteria& aSortCriteria,
   380 					 	    MFSMailBoxSearchObserver& aSearchObserver );
   380 					 	    MFSMailBoxSearchObserver& aSearchObserver );
   381 
   381 
   382 	 IMPORT_C void SearchL( const RPointerArray<TDesC>& aSearchStrings,
       
   383 						    const TFSMailSortCriteria& aSortCriteria,
       
   384 					 	    MFSMailBoxSearchObserver& aSearchObserver,
       
   385                             RArray<TFSMailMsgId> aFolderIds );
       
   386     /**
   382     /**
   387      * Cancels current search. Does nothing if there is not any search ongoing.
   383      * Cancels current search. Does nothing if there is not any search ongoing.
   388      * The search client will not be called back after this function is called.
   384      * The search client will not be called back after this function is called.
   389 	 *
   385 	 *
   390      * note CancelSearch() method does NOT clear the search result cached in the store. 
   386      * note CancelSearch() method does NOT clear the search result cached in the store. 
   409      * @param aFolderId...
   405      * @param aFolderId...
   410      * @param aObserver observer
   406      * @param aObserver observer
   411      */    
   407      */    
   412 	 IMPORT_C void AddObserver(const TFSMailMsgId aFolderId, MFSMailEventObserver& aObserver);
   408 	 IMPORT_C void AddObserver(const TFSMailMsgId aFolderId, MFSMailEventObserver& aObserver);
   413 
   409 
   414     /** 
       
   415      *  Get a list of most recently used addresses of this mailbox.
       
   416      *  Each MRU entry consists of two descriptors placed sequentially
       
   417      *  in the array. First one is the display name and the second
       
   418      *  one is the actual email address. If for example some entry does
       
   419      *  not contain a name at all then a KNullDesC is found in place of
       
   420      *  the name.
       
   421      *        
       
   422      * @return Array of descriptors containing MRUs. Ownership
       
   423      *         is transferred. Empty if no entries are found.
       
   424      */
       
   425      IMPORT_C MDesCArray* ListMrusL() const;
       
   426 
       
   427     /**
   410     /**
   428      * Returns the current synchronizing state of this mailbox.
   411      * Returns the current synchronizing state of this mailbox.
   429      *
   412      *
   430      * @return mailbox synchronizing state data structure
   413      * @return mailbox synchronizing state data structure
   431      */
   414      */
   432      IMPORT_C TSSMailSyncState CurrentSyncState() const;
   415      IMPORT_C TSSMailSyncState CurrentSyncState() const;
   433 
   416 
   434     /**
   417     /**
   435      * mailbox capability check for user
       
   436      *
       
   437      * @param aCapa mailbox capability to be checked
       
   438      */
       
   439 	 IMPORT_C TBool HasCapability(const TFSMailBoxCapabilities aCapability) const; 
       
   440 
       
   441     /**
       
   442      * mailbox connection status accessor
   418      * mailbox connection status accessor
   443      *
   419      *
   444      * @return connection status, online / offline
   420      * @return connection status, online / offline
   445      */
   421      */
   446 	 IMPORT_C TFSMailBoxStatus GetMailBoxStatus( );
   422 	    IMPORT_C TFSMailBoxStatus GetMailBoxStatus( );
   447 
   423 
   448     /**
       
   449      * mailbox authentication data mutator
       
   450      *
       
   451      * @param aUsername account user name
       
   452      * @param aPassword account password
       
   453      */
       
   454      IMPORT_C void SetCredentialsL( const TDesC& aUsername, const TDesC& aPassword );
       
   455 
       
   456      /**
       
   457       * removes downloaded attachments from local/terminal memory 
       
   458       */
       
   459      IMPORT_C void RemoveDownLoadedAttachmentsL();
       
   460 	 
       
   461      /**
       
   462       * reads connection id from plugin
       
   463       *
       
   464       * @param  aConnectionId reference to connection id
       
   465       * @return KErrNone or error code
       
   466       */
       
   467      IMPORT_C TInt GetConnectionId( TUint32& aConnectionId );
       
   468 
       
   469      /**
       
   470       * checks from plugin if connection is allowed when roaming
       
   471       *
       
   472       * @param  aConnectionAllowed 
       
   473       * @return KErrNone or error code
       
   474       */
       
   475      IMPORT_C TInt IsConnectionAllowedWhenRoaming( TBool& aConnectionAllowed) ;
       
   476 
       
   477      /**
       
   478       * creates email from RFC822 format data stream located
       
   479       * in given attachment file
       
   480       *
       
   481       * @param  aFile access to file containing data stream contents
       
   482       *         given by user
       
   483       *
       
   484       * return new email object, ownership is transferred to user
       
   485       */
       
   486       IMPORT_C CFSMailMessage* CreateMessageFromFileL( const RFile& aFile );
       
   487 
   424 
   488 public: // from  CExtendableEmail
   425 public: // from  CExtendableEmail
   489 
   426 
   490      /**
   427      /**
   491      * @see CExtendableEmail::ReleaseExtension()
   428      * @see CExtendableEmail::ReleaseExtension()
   510     /**
   447     /**
   511      * C++ default constructor.
   448      * C++ default constructor.
   512      */
   449      */
   513   	 CFSMailBox();
   450   	 CFSMailBox();
   514 
   451 
   515     /**
       
   516      * Function used internally to inform that Mru list related to this
       
   517      * mailbox should now be updated using the given recipient info. In
       
   518      * other words this function makes sure that the given recipients are
       
   519      * found from the mru list in which the mrus of this mailbox are stored.
       
   520      * Mrus are stored in the plugin.
       
   521      *
       
   522      * @param aRecipients email recipients in TO-field
       
   523      * @param aCCRecipients email recipients in CC-field
       
   524      * @param aBCCRecipients email recipients in BCC-field
       
   525      */
       
   526     void UpdateMrusL(
       
   527         const RPointerArray<CFSMailAddress>& aRecipients,
       
   528         const RPointerArray<CFSMailAddress>& aCCRecipients,
       
   529         const RPointerArray<CFSMailAddress>& aBCCRecipients ) const;
       
   530     
       
   531     /**
       
   532      * Function used to copy array contents to another array.
       
   533      *
       
   534      * @param aArrayToBeCopied Array that should be copied. 
       
   535      * @return Copy of the given array.
       
   536      */
       
   537     CDesCArraySeg* CopyArrayL( MDesCArray& aArrayToBeCopied ) const;
       
   538 
       
   539 
       
   540     /**
       
   541      * Function used to update given mru list with
       
   542      * recently used address info. If this info is already found
       
   543      * from the mru list then it is moved to the end of the mru list.
       
   544      * This way the most recent ones are found from the end
       
   545      * of the list.
       
   546      *
       
   547      * @param aMruList Mru list that should be updated.
       
   548      * @param aNewRecentlyUsedOnes Addresses that should be used
       
   549      *                             to update the given mru list.
       
   550      */
       
   551     void UpdateMruListL(
       
   552         CDesCArraySeg& aMruList,
       
   553         const RPointerArray<CFSMailAddress>& aNewRecentlyUsedOnes ) const;
       
   554 
       
   555 
       
   556     /**
       
   557      * Function used to search an address from given mru list.
       
   558      * Fucntion goes through the addresses in the mru list
       
   559      * and returns the first one matching the given address.
       
   560      *
       
   561      * @param aMruList Mru list that is searched through.
       
   562      * @param searchedAddress Address that is searched from the
       
   563      *                        given mru list.
       
   564      * @param aPos Reference parameter used to return the position
       
   565      *             of a matching address if such was found.
       
   566      * @return Integer value to indicate whether the searched address
       
   567      *         was found or not. Zero is returned if the address was found.
       
   568      *         Otherwise 1 is returned.
       
   569      */
       
   570     TInt FindAddressFromMruList( CDesCArraySeg& aMruList,
       
   571                              TDesC& searchedAddress,
       
   572                              TInt& aPos ) const;
       
   573 
       
   574     /**
       
   575      * Removes the oldest entry from the mru list and adds
       
   576      * given address info to the mru list. 
       
   577      *
       
   578      * @param aMruList Mru list.
       
   579      * @param aToBeAdded Address info to be added into the mru list.
       
   580      */
       
   581     void AddAndRemoveExcessMruL( CDesCArraySeg& aMruList,
       
   582                                  CFSMailAddress& aToBeAdded ) const;
       
   583 
       
   584     /**
       
   585      * Function to append mru entry to the mru list. This implementation
       
   586      * adds display name and then the address in this order into the
       
   587      * mru list.
       
   588      *
       
   589      * @param aMruList Mru list.
       
   590      * @param aToBeAdded Address info to be added into the mru list.
       
   591      */
       
   592     void AppendMruItemL( CDesCArraySeg& aMruList,
       
   593                          CFSMailAddress& aToBeAppended ) const;
       
   594 
       
   595     /**
       
   596      * Function to set the already existing entry in the mru list
       
   597      * as the most recent one.
       
   598      *
       
   599      * @param aMruList Mru list that should be edited.
       
   600      * @param aPosition Position where from the address element of
       
   601      *                  the most recent address is found. The display
       
   602      *                  name of the address is found with index one less
       
   603      *                  from the mru list.
       
   604      * @param aMostRecent After removal of the mru entry with given index,
       
   605      *                    this entry is added into the mru list as the
       
   606      *                    most recently used one.
       
   607      */
       
   608     void SetAsMostRecentMruL( CDesCArraySeg& aMruList,
       
   609                               TInt aPosition,
       
   610                               CFSMailAddress& aMostRecent ) const;
       
   611 
   452 
   612  private: // data
   453  private: // data
   613  
   454  
   614     /**
   455     /**
   615      * request handler for plugin requests
   456      * request handler for plugin requests