emailcontacts/contactactionservice/inc/cfscactionutils.h
changeset 0 8466d47a6819
child 70 968773a0b6ef
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 CFscActionUtils.
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_FSCACTIONUTILS_H
       
    20 #define C_FSCACTIONUTILS_H
       
    21 
       
    22 #include <e32base.h>
       
    23 //<cmail>
       
    24 #include "mfscactionutils.h"
       
    25 //</cmail>
       
    26 #include <RPbkViewResourceFile.h>
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 class CPbkContactItem;
       
    30 class CRepository;
       
    31 class CRCSEProfileRegistry;
       
    32 class CFscContactAction;
       
    33 class MFscReasonCallback;
       
    34 class CVPbkContactManager;
       
    35 class MVPbkStoreContact;
       
    36 class MVPbkStoreContactField;
       
    37 class CFscAddressSelect;
       
    38 
       
    39 /**
       
    40  *  Action utils.
       
    41  *  Implementation of a action utils.
       
    42  *
       
    43  *  @since S60 3.1
       
    44  */
       
    45 class CFscActionUtils : public CBase, public MFscActionUtils
       
    46     {
       
    47 
       
    48 public:
       
    49     // Constructors and destructor
       
    50 
       
    51     /**
       
    52      * Two-phased constructor.
       
    53      *
       
    54      * @param aContactManager Contact Manager
       
    55      * @return New instance of CFscActionUtils
       
    56      */
       
    57     static CFscActionUtils* NewL( CVPbkContactManager& aContactManager );
       
    58 
       
    59     /**
       
    60      * Two-phased constructor.
       
    61      *
       
    62      * @param aContactManager Contact Manager
       
    63      * @return New instance of CFscActionUtils
       
    64      */
       
    65     static CFscActionUtils* NewLC( CVPbkContactManager& aContactManager );
       
    66 
       
    67     /**
       
    68      * Destructor.
       
    69      */
       
    70     virtual ~CFscActionUtils();
       
    71 
       
    72 public:
       
    73     // From base class MFscActionUtils
       
    74 
       
    75     /**
       
    76      * @see MFscActionUtils::ContactEngine
       
    77      */
       
    78     CVPbkContactManager& ContactManager();
       
    79 
       
    80     /**
       
    81      * @see MFscActionUtils::ShowInfoNoteL
       
    82      */
       
    83     void ShowInfoNoteL( TInt aNote, const HBufC* aContactName );
       
    84 
       
    85     /**
       
    86      * @see MFscActionUtils::ShowInfoNoteL
       
    87      */
       
    88     void ShowInfoNoteL( TInt aNote, TInt aCounter );
       
    89     
       
    90     /**
       
    91      * @see MFscActionUtils::ShowCnfNoteL
       
    92      */
       
    93     void ShowCnfNoteL( TInt aNote, const HBufC* aName );
       
    94         
       
    95     /**
       
    96      * @see MFscActionUtils::ShowNumberMissingDialogL
       
    97      */
       
    98     TInt ShowNumberMissingNoteL( TInt aMissingCount, TInt aTotalCount,
       
    99             TInt aNote, TInt aDialog );
       
   100 
       
   101     /**
       
   102      * @see MFscActionUtils::GetContactNameL
       
   103      */
       
   104     HBufC* GetContactNameL( MVPbkStoreContact& aStoreContact );
       
   105 
       
   106     /**
       
   107      * @see MFscActionUtils::GetVoiceCallNumberL
       
   108      */
       
   109     TInt GetVoiceCallNumberL( MVPbkStoreContact& aStoreContact, 
       
   110             TDes& aNumber );
       
   111 
       
   112     /**
       
   113      * @see MFscActionUtils::GetVideoCallNumberL
       
   114      */
       
   115     TInt GetVideoCallNumberL( MVPbkStoreContact& aStoreContact, 
       
   116             TDes& aNumber );
       
   117 
       
   118     /**
       
   119      * @see MFscActionUtils::GetVoipAddressL
       
   120      */
       
   121     TInt GetVoipAddressL( MVPbkStoreContact& aStoreContact, TDes& aNumber );
       
   122 
       
   123     /**
       
   124      * @see MFscActionUtils::GetConfInfoL
       
   125      */
       
   126     TInt GetConfInfoL( MVPbkStoreContact& aStoreContact, TDes& aConfNum,
       
   127             TDes& aConfId, TDes& aConfPin );
       
   128 
       
   129     /**
       
   130      * @see MFscActionUtils::GetPocAddressL
       
   131      */
       
   132     TInt GetPocAddressL( MVPbkStoreContact& aStoreContact, 
       
   133             TDes& aPocAddress );
       
   134 
       
   135     /**
       
   136      * @see MFscActionUtils::GetMessageAddressL
       
   137      */
       
   138     TInt GetMessageAddressL( MVPbkStoreContact& aStoreContact,
       
   139             TDes& aMsgAddress );
       
   140     
       
   141     /**
       
   142      * @see MFscActionUtils::GetEmailAddressL
       
   143      */
       
   144     TInt GetEmailAddressL( MVPbkStoreContact& aStoreContact,
       
   145             TDes& aEmailAddress );
       
   146 
       
   147     /**
       
   148      * @see MFscActionUtils::RemoveInvalidChar
       
   149      */
       
   150     void RemoveInvalidChar( const TDesC& aNumber, const TDesC& aValidChars,
       
   151             TDes& aOutNumber );
       
   152 
       
   153     /**
       
   154      * @see MFscActionUtils::IsContactNumberAvailableL
       
   155      */
       
   156     TBool IsContactNumberAvailableL( MVPbkStoreContact& aStoreContact,
       
   157             TContactNumberType aContactNumberType );
       
   158 
       
   159     /**
       
   160      * @see MFscActionUtils::Is3GNetworkAvailable
       
   161      */
       
   162     TBool Is3GNetworkAvailable();
       
   163 
       
   164     /**
       
   165      * @see MFscActionUtils::IsOfflineModeL
       
   166      */
       
   167     TBool IsOfflineModeL();
       
   168 
       
   169     /**
       
   170      * @see MFscActionUtils::IsPttConfiguredL
       
   171      */
       
   172     TBool IsPttConfiguredL();
       
   173 
       
   174     /**
       
   175      * @see MFscActionUtils::IsVoipConfiguredL
       
   176      */
       
   177     TBool IsVoipConfiguredL();
       
   178 
       
   179     /**
       
   180      * @see MFscActionUtils::SkinIconL
       
   181      */
       
   182     CGulIcon* SkinIconL( TAknsItemID aItemId, const TDesC& aFilename,
       
   183             TInt aFileBitmapId, TInt aFileMaskId );
       
   184 
       
   185     /**
       
   186      * @see MFscActionUtils::ActionPriorityL
       
   187      */
       
   188     TInt ActionPriority( TUint32 aActionPriorityCrKey, 
       
   189             TInt aDefaultPriority );
       
   190 
       
   191     /**
       
   192      * @see MFscActionUtils::CreateActionL
       
   193      */
       
   194     CFscContactAction* CreateActionL( MFscReasonCallback& aReasonCallback,
       
   195             TUid aContactActionUid, TUint64 aActionType,
       
   196             TInt aActionMenuTextResourceId, CGulIcon* aIcon );
       
   197     
       
   198     /**
       
   199      * Closes selection dialog.
       
   200      */
       
   201     void CloseSelectDialogL();
       
   202     
       
   203 protected:
       
   204     
       
   205     /**
       
   206      * Opens selection dialog.
       
   207      * 
       
   208      * @param aResourceId resource identifying type of select dialog.
       
   209      * @param aStoreContact contact for which dialog is opened.
       
   210      * 
       
   211      * @return selected contact field or NULL if canceled. 
       
   212      */
       
   213     MVPbkStoreContactField* OpenSelectDialogL( TInt aResourceId, 
       
   214             MVPbkStoreContact& aStoreContact );    
       
   215 
       
   216 private:
       
   217     // Private constructors
       
   218 
       
   219     /**
       
   220      * Constructor.
       
   221      *
       
   222      * @param aContactManager Contact Manager
       
   223      */
       
   224     CFscActionUtils( CVPbkContactManager& aContactManager );
       
   225 
       
   226     /**
       
   227      * Second phase constructor.
       
   228      */
       
   229     void ConstructL();
       
   230     
       
   231 private:
       
   232     // Private methods
       
   233 
       
   234     /**
       
   235      * Returns full file path with drive.
       
   236      * 
       
   237      * @param aFilePath path to file with filename
       
   238      */
       
   239     TPtrC GetFileDirL( const TDesC& aFilePath );
       
   240     
       
   241     // Fix for EMZG-7M23KX
       
   242     /**
       
   243      * Find and add resource file to the list maintained by CCoeEnv.
       
   244      * Resource file must be deleted (remove from the list) after usage.
       
   245      * @return The offset value defined for this resource file
       
   246      */
       
   247     TInt FindAndAddResourceFileL();
       
   248 
       
   249 private:
       
   250     // Private members
       
   251 
       
   252     /**
       
   253      * Contact Manager.
       
   254      */
       
   255     CVPbkContactManager& iContactManager;
       
   256 
       
   257     /**
       
   258      * Priority cenrep
       
   259      * Own.
       
   260      */
       
   261     CRepository* iRep;
       
   262 
       
   263     /**
       
   264      * CRCSEProfileRegistry for checking voip status
       
   265      */
       
   266     CRCSEProfileRegistry* iRCSEProfileRegistry;
       
   267     
       
   268     /**
       
   269      * Letter drive.
       
   270      */
       
   271     TFileName iLetterDrive;
       
   272     
       
   273     /**
       
   274      * Phone number/address selection dialog.
       
   275      * Own.
       
   276      */
       
   277     CFscAddressSelect* iAddressSelect;
       
   278     };
       
   279 
       
   280 #endif // C_FSCACTIONUTILS_H