emailcontacts/contactactionservice/inc/mfscactionutils.h
changeset 0 8466d47a6819
equal deleted inserted replaced
-1:000000000000 0:8466d47a6819
       
     1 /*
       
     2 * Copyright (c) 2008 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:  Declaration of interface MFscActionUtils.
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef M_FSCACTIONUTILS_H
       
    20 #define M_FSCACTIONUTILS_H
       
    21 
       
    22 #include <e32base.h>
       
    23 #include <AknsItemID.h> 
       
    24 
       
    25 // FORWARD DECLARATIONS
       
    26 class CPbkContactItem;
       
    27 class CFscContactAction;
       
    28 class MFscReasonCallback;
       
    29 class CGulIcon;
       
    30 class CVPbkContactManager;
       
    31 class MVPbkStoreContact;
       
    32 
       
    33 // ENUM DECLARATIONS
       
    34 
       
    35 /**
       
    36  * Enumeration for contact's types
       
    37  */
       
    38 enum TContactNumberType
       
    39     {
       
    40     ETypeVoiceCallNumber,
       
    41     ETypeVideoCallNumber,
       
    42     ETypeConfNumber,
       
    43     ETypeInternetTel,
       
    44     ETypePttNumber,
       
    45     ETypeAudioAddress,
       
    46     ETypeEmailAddress,
       
    47     ETypeMsgAddress,
       
    48     ETypeInvalid
       
    49     };
       
    50 
       
    51 /**
       
    52  *   Utility method interface for contact actions
       
    53  *
       
    54  *  @since S60 3.1
       
    55  */
       
    56 class MFscActionUtils
       
    57     {
       
    58 
       
    59 public:
       
    60     // Public methods
       
    61 
       
    62     /**
       
    63      * Reference to virtual phonebook's contact manager
       
    64      *
       
    65      * @return contact manager
       
    66      */
       
    67     virtual CVPbkContactManager& ContactManager() = 0;
       
    68 
       
    69     /**
       
    70      * Shows information note
       
    71      *
       
    72      * @param aNote Resource ID of text to be shown
       
    73      * @param aContactName contact's name to be displayed in note text
       
    74      */ 
       
    75     virtual void ShowInfoNoteL( TInt aNote, 
       
    76             const HBufC* aContactName = NULL ) = 0;
       
    77 
       
    78     /**
       
    79      * Shows information note
       
    80      *
       
    81      * @param aNote Resource ID of text to be shown
       
    82      * @param aCounter Count of contacts displayed in note
       
    83      */
       
    84     virtual void ShowInfoNoteL( TInt aNote, 
       
    85                 TInt aCounter ) = 0;
       
    86     
       
    87     /**
       
    88      * Shows confirmation note
       
    89      *
       
    90      * @param aNote Resource ID of text to be shown
       
    91      * @param aName name to be displayed in note text
       
    92      */ 
       
    93     virtual void ShowCnfNoteL( TInt aNote, const HBufC* aName = NULL ) = 0;
       
    94             
       
    95     /**
       
    96      * Show number missing dialog
       
    97      *
       
    98      * @param aMissingCount number missing count
       
    99      * @param aTotalCount total contact count
       
   100      * @param aNote note to be displaed
       
   101      * @param aDialog dialog
       
   102      * @return return Ok or Cancel based on user selection
       
   103      */
       
   104     virtual TInt ShowNumberMissingNoteL( TInt aMissingCount, TInt aTotalCount,
       
   105             TInt aNote, TInt aDialog ) = 0;
       
   106 
       
   107     /**
       
   108      * Get contacts name from MVPbkStoreContact
       
   109      *
       
   110      * @param aStoreContact virtual phonebook store.
       
   111      * @return HBufC* contact's name or company name
       
   112      */
       
   113     virtual HBufC* GetContactNameL( MVPbkStoreContact& aStoreContact ) = 0;
       
   114 
       
   115     /**
       
   116      * Get phone number for voice call from MVPbkStoreContact
       
   117      *
       
   118      * @param aStoreContact virtual phonebook store contact.
       
   119      * @param aNumber Default or selected phone number from number 
       
   120      * selection dialog.
       
   121      * @return KErrNone if successfully, KErrNotFound if there is no phone
       
   122      * number field, KErrCancel if user cancel number selection.
       
   123      */
       
   124     virtual TInt GetVoiceCallNumberL( MVPbkStoreContact& aStoreContact,
       
   125             TDes& aNumber ) = 0;
       
   126 
       
   127     /**
       
   128      * Get phone number for video call from MVPbkStoreContact
       
   129      *
       
   130      * @param aStoreContact virtual phonebook contact store.
       
   131      * @param aNumber Default or selected phone number from number 
       
   132      * selection dialog.
       
   133      * @return KErrNone if successfully, KErrNotFound if there is no phone
       
   134      * number field, KErrCancel if user cancel number selection.
       
   135      */
       
   136      virtual TInt GetVideoCallNumberL( MVPbkStoreContact& aStoreContact,
       
   137              TDes& aNumber ) = 0;
       
   138      
       
   139     /**
       
   140      * Get Voip address from MVPbkStoreContact
       
   141      *
       
   142      * @param aStoreContact virtual phonebook contact store.
       
   143      * @param aNumber Default or selected voip phone number from number 
       
   144      * selection dialog.
       
   145      * @return KErrNone if successfully, KErrNotFound if there is no phone
       
   146      * number field, KErrCancel if user cancel number selection.
       
   147      */
       
   148     virtual TInt GetVoipAddressL( MVPbkStoreContact& aStoreContact, 
       
   149             TDes& aNumber ) = 0;
       
   150 
       
   151     /**
       
   152      * Get Conference Number, Id and PIN from MVPbkStoreContact
       
   153      *
       
   154      * @param aStoreContact virtual phonebook contact store.
       
   155      * @param aConfNum conference number
       
   156      * @param aConfId conference ID
       
   157      * @param aConfPin conference PIN
       
   158      * @return KErrNone if successful, KErrNotFound if there is no conference 
       
   159      * number set.
       
   160      */
       
   161     virtual TInt GetConfInfoL( MVPbkStoreContact& aStoreContact, 
       
   162             TDes& aConfNum, TDes& aConfId, TDes& aConfPin ) = 0;
       
   163 
       
   164     /**
       
   165      * Get PoC (PTT over Cellular) Address from MVPbkStoreContact
       
   166      *
       
   167      * @param aStoreContact virtual phonebook contact store.
       
   168      * @param aPocAddress will be updated with selected address from address 
       
   169      * selection dialog.
       
   170      * @return KErrNone if successful, KErrNotFound if there is no address
       
   171      * field, KErrCancel if user cancel address selection.
       
   172      */
       
   173     virtual TInt GetPocAddressL( MVPbkStoreContact& aStoreContact,
       
   174             TDes& aPocAddress ) = 0;
       
   175 
       
   176     /**
       
   177      * Get Message Address from MVPbkStoreContact
       
   178      *
       
   179      * @param aStoreContact virtual phonebook contact store.
       
   180      * @param aMsgAddress will be updated with selected address from address 
       
   181      * selection dialog.
       
   182      * @return KErrNone if successful, KErrNotFound if there is no address
       
   183      * field, KErrCancel if user cancel address selection.
       
   184      */
       
   185     virtual TInt GetMessageAddressL( MVPbkStoreContact& aStoreContact,
       
   186             TDes& aMmsAddress ) = 0;
       
   187     
       
   188     /**
       
   189      * Get Email Address from MVPbkStoreContact
       
   190      *
       
   191      * @param  aStoreContact virtual phonebook contact store.
       
   192      * @param aEmailAddress will be updated with selected address from address
       
   193      * selection dialog.
       
   194      * @return KErrNone if successful, KErrNotFound if there is no address
       
   195      * field, KErrCancel if user cancel address selection.
       
   196      */
       
   197     virtual TInt GetEmailAddressL( MVPbkStoreContact& aStoreContact, 
       
   198             TDes& aMmsAddress ) = 0;
       
   199     
       
   200     /**
       
   201      * Removes Invalid Char from aNumber
       
   202      *
       
   203      * @param aNumber number to be updated
       
   204      * @param aValidChars is valid phone number characters
       
   205      * @param aOutNumber returned with valid ph number chars 
       
   206      */
       
   207     virtual void RemoveInvalidChar( const TDesC& aNumber, 
       
   208             const TDesC& aValidChars, TDes& aOutNumber ) = 0;
       
   209 
       
   210     /**
       
   211      * Finds specified contact number from store contact
       
   212      *
       
   213      * @param aStoreContact virtual phonebook store contact
       
   214      * @param aContactNumberType specifies contact type
       
   215      * @return ETrue if specified contact number available
       
   216      *   otherwise EFalse
       
   217      */                
       
   218     virtual TBool IsContactNumberAvailableL( MVPbkStoreContact& aStoreContact,
       
   219             TContactNumberType aContactNumberType ) = 0;
       
   220         
       
   221     /**
       
   222      * Finds availability of 3G network
       
   223      *
       
   224      * @return ETrue if 3G network available, otherwise EFalse
       
   225      */  
       
   226     virtual TBool Is3GNetworkAvailable() = 0;
       
   227 
       
   228     /**
       
   229      * Checks if phone is in offline mode
       
   230      *
       
   231      * @return ETrue if phone is in offline mode
       
   232      */
       
   233     virtual TBool IsOfflineModeL() = 0;
       
   234 
       
   235     /**
       
   236      * Finds availability of PTT settings
       
   237      *
       
   238      * @return ETrue if PTT is configured, otherwise EFalse
       
   239      */ 
       
   240     virtual TBool IsPttConfiguredL() = 0;
       
   241 
       
   242     /**
       
   243      * Finds availability of VOIP settings
       
   244      *
       
   245      * @return ETrue if voip configured, otherwise EFalse
       
   246      */ 
       
   247     virtual TBool IsVoipConfiguredL() = 0;
       
   248 
       
   249     /**
       
   250      * Creates icon from skin
       
   251      *
       
   252      * @param aItemId TAknsItemID
       
   253      * @param aFilename icon file's filename
       
   254      * @param aFileBitmapId containc bitmap id for from .miffile
       
   255      * @param aFileMaskId contains mask id from .mif file
       
   256      * @return CGulIcon* if icon is created successfully, 
       
   257      *  leaves if there is error in icon creation
       
   258      */
       
   259     virtual CGulIcon* SkinIconL( TAknsItemID aItemId, const TDesC& aFilename,
       
   260             TInt aFileBitmapId, TInt aFileMaskId ) = 0;
       
   261 
       
   262     /**
       
   263      * Reads action priority from central repositary
       
   264      *
       
   265      * @param aActionPriorityCrKey central repository key
       
   266      * @param aDefaultPriority default priority
       
   267      * @return Priority
       
   268      */
       
   269     virtual TInt ActionPriority( TUint32 aActionPriorityCrKey, 
       
   270             TInt aDefaultPriority ) = 0;
       
   271 
       
   272     /**
       
   273      * creates and returns pointer to CFscContactAction instance
       
   274      * Ownership is transferred
       
   275      *
       
   276      * @param aReasonCallback reference to MFscReasonCallback interface
       
   277      * @param aContactActionUid is Uid of action
       
   278      * @param aActionType specifies action type
       
   279      * @param aActionMenuTextResourceId action menu text
       
   280      * @param aIcon specifies icon for the action
       
   281      * @return CFscContactAction* pointer to contact action
       
   282      */
       
   283     virtual CFscContactAction* CreateActionL( 
       
   284             MFscReasonCallback& aReasonCallback, TUid aContactActionUid,
       
   285             TUint64 aActionType, TInt aActionMenuTextResourceId, 
       
   286             CGulIcon* aIcon ) = 0;
       
   287     
       
   288     /**
       
   289      * Closes selection dialog.
       
   290      */
       
   291     virtual void CloseSelectDialogL() = 0;
       
   292     
       
   293 public:
       
   294     
       
   295     /**
       
   296      * Destructor.
       
   297      */
       
   298     virtual ~MFscActionUtils() {}
       
   299         
       
   300     };
       
   301 
       
   302 #endif // M_FSCACTIONUTILS_H