phonebookui/Phonebook2/ccapplication/ccacommlauncherplugin/inc/ccappcommlauncherplugin.h
changeset 0 e686773b3f54
child 3 04ab22b956c2
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     1 /*
       
     2 * Copyright (c) 2007-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:  Implementation of comm launcher view plugin
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_CCAPPCOMMLAUNCHERPLUGIN_H
       
    20 #define C_CCAPPCOMMLAUNCHERPLUGIN_H
       
    21 
       
    22 #include <mccacontactobserver.h>
       
    23 
       
    24 #include "ccappcommlauncherheaders.h"
       
    25 #include <mccappviewpluginbase2.h>
       
    26 
       
    27 class CCCAppCommLauncherContactHandler;
       
    28 class CCCAppCommLauncherMenuHandler;
       
    29 class CCAContactorService;
       
    30 class CCCAppCommLauncherLSetDefault;
       
    31 
       
    32 /**
       
    33  *  Class implementing CCCAppViewPluginBase interface. This is
       
    34  *  the main class and controlling the other classes of the plugin.
       
    35  *
       
    36  *  @code
       
    37  *   ?good_class_usage_example(s)
       
    38  *  @endcode
       
    39  *
       
    40  *  @lib ccappcommlauncherplugin.dll
       
    41  *  @since S60 v3.2
       
    42  */
       
    43 class CCCAppCommLauncherPlugin :
       
    44     public CCCAppViewPluginBase,
       
    45     public MCCAppPluginsContactObserver,
       
    46     public MCCAppViewPluginBase2
       
    47     {
       
    48 #ifdef __COMMLAUNCHERPLUGINUNITTESTMODE
       
    49     friend class T_CCCAppCommLauncherPlugin;
       
    50 #endif// __COMMLAUNCHERPLUGINUNITTESTMODE
       
    51 
       
    52 public:
       
    53 
       
    54     /**
       
    55      * Two-phased constructor.
       
    56      */
       
    57     static CCCAppCommLauncherPlugin* NewL();
       
    58 
       
    59     /**
       
    60      * Destructor.
       
    61      */
       
    62     ~CCCAppCommLauncherPlugin();
       
    63 
       
    64 public: //From MCCAppPluginsContactObserver
       
    65 
       
    66     void NotifyPluginOfContactEventL();
       
    67 
       
    68 public:
       
    69 
       
    70 // from base class CCCAppViewPluginBase
       
    71 
       
    72     /**
       
    73      * From CCCAppViewPluginBase
       
    74      */
       
    75     void PreparePluginViewL(
       
    76         MCCAppPluginParameter& aPluginParameter );
       
    77 
       
    78     /**
       
    79      * From CCCAppViewPluginBase
       
    80      * NEW API
       
    81      */
       
    82     void ProvideBitmapL(
       
    83         TCCAppIconType aIconType,
       
    84         CAknIcon& aIcon );
       
    85 
       
    86     /**
       
    87      * From CCCAppViewPluginBase
       
    88      */
       
    89     TAny* CCCAppViewPluginBaseExtension( TUid aExtensionUid );
       
    90 
       
    91 // from base class CAknView
       
    92 
       
    93     /**
       
    94      * From CAknView
       
    95      */
       
    96     void DynInitMenuPaneL(
       
    97         TInt aResourceId,
       
    98         CEikMenuPane* aMenuPane );
       
    99 
       
   100     /**
       
   101      * From CAknView
       
   102      */
       
   103     void HandleCommandL(
       
   104         TInt aCommand );
       
   105 
       
   106     /**
       
   107      * From CAknView
       
   108      */
       
   109     void DoActivateL(
       
   110         const TVwsViewId& aPrevViewId,
       
   111         TUid aCustomMessageId,
       
   112         const TDesC8& aCustomMessage );
       
   113 
       
   114     /**
       
   115      * From CAknView
       
   116      */
       
   117     void DoDeactivate();
       
   118 
       
   119     /**
       
   120      * From CAknView
       
   121      */
       
   122     TUid Id() const;
       
   123 
       
   124 // from base class CCCAppViewPluginAknView
       
   125 
       
   126     /**
       
   127      * From CCCAppViewPluginAknView
       
   128      */
       
   129     void PrepareViewResourcesL();
       
   130 
       
   131     /**
       
   132      * From CCCAppViewPluginAknView
       
   133      */
       
   134     void NewContainerL();
       
   135     
       
   136 public: //From MCCAppViewPluginBase2
       
   137     
       
   138     TBool PluginBusy();
       
   139 
       
   140 public:
       
   141 
       
   142     /**
       
   143      * Returns a pointer to preferred comm methods
       
   144      *
       
   145      * @since S60 v5.0
       
   146      * @return pointer to preferred comm method array
       
   147      */
       
   148     RArray<VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector>&
       
   149         PreferredCommMethods();
       
   150 
       
   151    /**
       
   152      * Classes enumerated, see ErrorNotifierL() below
       
   153      *
       
   154      * @since S60 v5.0
       
   155      */
       
   156     enum TCCAppCommLauncherPluginErrorSource
       
   157         {
       
   158         ECCAppCommLauncherContactHandler = 1
       
   159         };
       
   160 
       
   161    /**
       
   162      * Error handler for errors coming from differen classes
       
   163      *
       
   164      * @since S60 v5.0
       
   165      */
       
   166     void ErrorNotifierL(
       
   167         TCCAppCommLauncherPluginErrorSource aErrorSource,
       
   168         TInt aError );
       
   169 
       
   170     /**
       
   171      * For getting information if the contact is Top Contact
       
   172      *
       
   173      * @since S60 v5.0
       
   174      * @return TBool
       
   175      */
       
   176     TBool IsTopContactL();
       
   177 
       
   178     /**
       
   179      * For getting information if the contact is from the contacts db
       
   180      *
       
   181      * @since S60 v5.0
       
   182      * @return TBool
       
   183      */
       
   184     TBool IsContactL();
       
   185 
       
   186     /**
       
   187      * For getting reference to container-class
       
   188      *
       
   189      * @since S60 v5.0
       
   190      * @return reference to container-class
       
   191      */
       
   192     CCCAppCommLauncherContainer& Container();
       
   193 
       
   194     /**
       
   195      * For getting reference to contacthandler-class
       
   196      *
       
   197      * @since S60 v5.0
       
   198      * @return reference to contacthandler-class
       
   199      */
       
   200     CCCAppCommLauncherContactHandler& ContactHandler();
       
   201 
       
   202     /**
       
   203      * Helper function for get the reference
       
   204      * to container data.
       
   205      *
       
   206      * return container
       
   207      */
       
   208     CCCAppViewPluginAknContainer& GetContainer()
       
   209     {
       
   210         return *iContainer;
       
   211     }
       
   212 
       
   213     /**
       
   214      * Return pointer to contactor service.
       
   215      */
       
   216     CCAContactorService* ContactorService();
       
   217     
       
   218     void DefaultSettingComplete();
       
   219 
       
   220 private: // new
       
   221 
       
   222     /**
       
   223      * Initialises the preferred communication methods array.
       
   224      *
       
   225      * @since S60 v5.0
       
   226      */
       
   227     void InitialisePreferredCommMethods();
       
   228 
       
   229     /**
       
   230      * Loads preferred communication methods array from CenRep.
       
   231      *
       
   232      * @since S60 v5.0
       
   233      */
       
   234     void LoadPreferredCommMethodsL();
       
   235 
       
   236     /**
       
   237      * Creates menuhandler if not created already.
       
   238      *
       
   239      * @since S60 v5.0
       
   240      */
       
   241     void EnsureMenuHandlerCreatedL();
       
   242 
       
   243 private: // constructors
       
   244 
       
   245     CCCAppCommLauncherPlugin();
       
   246     void ConstructL();
       
   247 
       
   248 public:
       
   249     /*
       
   250      * Sets the title to the plugin
       
   251      * @param aTitle - title to be set
       
   252      */
       
   253     void SetTitleL( const TDesC& aTitle );
       
   254 
       
   255     /**
       
   256      * Sets the CBA labels.
       
   257      * @param aEditable Boolean that tells if contact has communication
       
   258      * methods or not.
       
   259      */
       
   260     void UpdateMSKinCbaL( TBool aCommMethodsAvailable );
       
   261 
       
   262 private:// data
       
   263 
       
   264     /**
       
   265      * Pointer to contact data fetcher.
       
   266      * Own.
       
   267      */
       
   268     CCCAppCommLauncherContactHandler* iContactHandler;
       
   269     
       
   270     CCCAppCommLauncherLSetDefault* iSetDefault;
       
   271 
       
   272     /**
       
   273      * Pointer to preferred communication methods.
       
   274      * In case of deactivation, this is not deleted for making the new opening faster.
       
   275      * Own.
       
   276      */
       
   277     RArray<VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector>
       
   278         iPreferredCommMethods;
       
   279 
       
   280     /**
       
   281      * Pointer to commlauncher's menuhandler
       
   282      * Own.
       
   283      */
       
   284     CCCAppCommLauncherMenuHandler* iMenuHandler;
       
   285 
       
   286     /**
       
   287      * Flag if contact must be refetched.
       
   288      */
       
   289     TBool iRefetchContact;
       
   290 
       
   291     /**
       
   292      * Pointer to contactor service.
       
   293      * Own.
       
   294      */
       
   295     CCAContactorService* iContactorService;
       
   296     
       
   297     CActiveSchedulerWait* iWaitFinish;
       
   298 
       
   299     };
       
   300 
       
   301 #endif // C_CCAPPCOMMLAUNCHERPLUGIN_H
       
   302 
       
   303 // End of File