omads/omadsextensions/adapters/mms/inc/mmsadaptermsvapi.h
changeset 40 b63e67867dcd
parent 0 dab8a81a92de
equal deleted inserted replaced
39:9905f7d46607 40:b63e67867dcd
       
     1 /*
       
     2 * Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  CMmsAdapterMsvApi header
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef MMSADAPTERMSVAPI_H
       
    20 #define MMSADAPTERMSVAPI_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <msvstd.h>         // TMsvId
       
    24  
       
    25 // CONSTANTS
       
    26 const TInt KMsvMyFoldersEntryIdValue = 0x1008;
       
    27 const TInt KMsvMyFoldersTemplatesFolderId = 0x1009;
       
    28 
       
    29 // FORWARD DECLARATIONS
       
    30 class CMsvSession;
       
    31 
       
    32 
       
    33 // CLASS DECLARATION
       
    34 
       
    35 /**
       
    36 * Class CMmsAdapterMsvApi
       
    37 * Internal class that provides access to SMS message store.
       
    38 */
       
    39 class CMmsAdapterMsvApi : public CBase 
       
    40     {
       
    41     public:  // Constructors and destructor
       
    42         
       
    43         /**
       
    44         * Two-phased constructor.
       
    45         *
       
    46         * @param aMsvSession   IN: Access to message server
       
    47         *
       
    48         */
       
    49         static CMmsAdapterMsvApi* NewL(CMsvSession& aMsvSession);
       
    50                 
       
    51         /**
       
    52         * Destructor.
       
    53         */
       
    54         virtual ~CMmsAdapterMsvApi();
       
    55         
       
    56     private: // Private constructor functions
       
    57         
       
    58         /**
       
    59         * C++ default constructor.
       
    60         * C++ default constructor can NOT contain any code, that
       
    61         * might leave.
       
    62         *
       
    63         * @param aMsvSession   IN: Access to message server
       
    64         *        
       
    65         */
       
    66         CMmsAdapterMsvApi(CMsvSession& aMsvSession);
       
    67 
       
    68         /**
       
    69         * By default Symbian 2nd phase constructor is private.
       
    70         */
       
    71         void ConstructL();        
       
    72 
       
    73     public: // New functions
       
    74 	    
       
    75          
       
    76         /**
       
    77         * Delete user folder under My Folders
       
    78         * 
       
    79         * @param aUid   IN: the index to the folder, which will be deleted
       
    80         *
       
    81         * @return   KErrNone in success. KErrInUse if folder was not deleted because it was not empty.                             
       
    82         */         
       
    83         TInt DeleteUserFolderL( TMsvId aUid );
       
    84 	
       
    85        /**
       
    86         * Valid folder checks if the folder is valid.
       
    87         * The caller of the function can set, if Outbox folder is valid or not.
       
    88         * 
       
    89         * @param aFolder   folder
       
    90         * @param aOutboxValid if the MM is outbox is valid folder or not
       
    91         * 
       
    92         * @return ETrue when the folder is valid.
       
    93         * @return EFalse when the folder is not valid.
       
    94         */
       
    95         TBool ValidFolderL( TMsvId aFolder , TBool aOutboxValid = ETrue );		
       
    96 		
       
    97        /**
       
    98         * Creates new user defined folder
       
    99         * 
       
   100         * @param aFolder    OUT: index of the new folder
       
   101         * @param aName      IN: name of the new folder
       
   102         *
       
   103         * @return     KErrNone or error
       
   104         */				
       
   105 		TInt AddUserFolderL( TMsvId& aFolder, const TDesC& aName );
       
   106 		
       
   107        /**
       
   108         * Updates name of user defined folder
       
   109         * 
       
   110         * @param aFolder    IN: index of the folder
       
   111         * @param aName      IN: new name of the folder
       
   112         *
       
   113         * @return     KErrNone or error
       
   114         */					
       
   115 		TInt UpdateUserFolderL( TMsvId aFolder, const TDesC& aName );
       
   116 		
       
   117         /**
       
   118         * Searches user folder with given UID
       
   119         * 
       
   120         * @param aFolder     IN: Folder UID
       
   121         * @param aName       OUT: name of found user folder
       
   122         * @param aDate       OUT: time stamp of found user folder 
       
   123         *
       
   124         * @return	Return value indicates whether folder was found or not
       
   125         */	        
       
   126         TBool FindUserFolderL(TMsvId aFolder, TPtrC& aName, TTime& aDate);	
       
   127         
       
   128         /**
       
   129         * Searches user folder with given UID
       
   130         * 
       
   131         * @param aFolder     IN: Folder UID
       
   132         *
       
   133         * @return	Return value indicates whether folder was found or not
       
   134         */	        
       
   135         TBool FindUserFolderL(TMsvId aFolder);
       
   136         
       
   137     private:	// Internal functions
       
   138 
       
   139         /**
       
   140         * Check whether folder with given name exists
       
   141         * 
       
   142         * @param aName     IN: Folder name
       
   143         * @parem aFolder   OUT: Folder UID if matching folder was found. 
       
   144         *
       
   145         * @return	Return value indicates whether folder was found or not 
       
   146         */	       
       
   147         TBool FindUserFolderL(const TDesC& aName, TMsvId& aFolder);		
       
   148     
       
   149     private:    // Data
       
   150         
       
   151         CMsvSession& 			iSession;
       
   152     			
       
   153     };
       
   154 
       
   155 #endif      //SMSADAPTERMSVAPI_H