phoneuis/easydialing/inc/dialingextensioninterface.h
branchRCL_3
changeset 3 8871b09be73b
child 4 24062c24fe38
equal deleted inserted replaced
2:c84cf270c54f 3:8871b09be73b
       
     1 /*
       
     2 * Copyright (c) 2010 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:  Ecom interface header
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __CDIALEREXTENSIONINTERFACE_H
       
    19 #define __CDIALEREXTENSIONINTERFACE_H
       
    20 
       
    21 #include <easydialingcommands.hrh>
       
    22 
       
    23 #include <ecom/ecom.h>
       
    24 #include <coecntrl.h>
       
    25 #include <eikmenup.h>
       
    26 
       
    27 
       
    28 /** UID of dialing extension ECom interface. */
       
    29 const TUid KEasyDialingPluginInterfaceUID = { 0x200212A1 };
       
    30 
       
    31 /** UID of easy dialing plugin. */
       
    32 const TUid KEasyDialingPluginImplementationUID = { 0x200212A0 };
       
    33 
       
    34 /**
       
    35  * Observer class for easy dialing.
       
    36  */
       
    37 class MDialingExtensionObserver
       
    38     {
       
    39 public:
       
    40     
       
    41     /**
       
    42      * Identifiers for easy dialing events.
       
    43      */
       
    44     typedef enum TEvent_enum
       
    45         {
       
    46         
       
    47         /** Contact search has completed. */
       
    48         ESearchComplete = 1,
       
    49         
       
    50         /** Easy dialing has gained or given up the focus. */
       
    51         EFocusChanged,
       
    52         
       
    53         /** Easy dialing has started communication launcher (a.k.a. contact view) */
       
    54         ECCALauncherStarted,
       
    55         
       
    56         /** Communication launcher a.k.a. contact view has been close. */
       
    57         ECCALauncherExit,
       
    58         
       
    59         /** Easy dialing feature has been switched on. */
       
    60         EEasyDialingEnabled,
       
    61         
       
    62         /** Easy dialing feature has been switched off. */
       
    63         EEasyDialingDisabled,
       
    64         
       
    65         /** User has started communication (SMS, IM, E-mail ...). Not used for phone calls. */
       
    66         ECommunicationStarted,
       
    67         
       
    68         /** User has cancelled communication once started. */
       
    69         ECommunicationCancelled
       
    70        
       
    71         } TEvent;
       
    72 
       
    73 
       
    74     /**
       
    75      * Handles event from easy dialing plugin.
       
    76      * 
       
    77      * @param aEvent    Event id.
       
    78      * 
       
    79      */
       
    80     virtual void HandleDialingExtensionEvent( MDialingExtensionObserver::TEvent aEvent ) = 0;
       
    81     };
       
    82 
       
    83 
       
    84 
       
    85 
       
    86 /**
       
    87  * Easy dialing plugin class.
       
    88  */
       
    89 
       
    90 class CDialingExtensionInterface : public CCoeControl
       
    91     {
       
    92 public:
       
    93     
       
    94     /**
       
    95      * Creates an instance of plugin.
       
    96      */
       
    97     static CDialingExtensionInterface* NewL();
       
    98 
       
    99 
       
   100     /**
       
   101      * Destructor.
       
   102      */
       
   103     virtual ~CDialingExtensionInterface();
       
   104     
       
   105     
       
   106     /**
       
   107      * Does the rest of the initialization of the plugin.
       
   108      * Must be called after NewL before using any other 
       
   109      * functions of the plugin.
       
   110      * 
       
   111      * @param aParent   Parent container of the plugin.
       
   112      */
       
   113     virtual void InitializeL( CCoeControl& aParent ) = 0;
       
   114     
       
   115 
       
   116     /**
       
   117      * Resets the previous search results. 
       
   118      */
       
   119     virtual void Reset() = 0;
       
   120     
       
   121         
       
   122     /**
       
   123      * Adds an observer to the plugin.
       
   124      * 
       
   125      * @param aObserver Observer to be added.
       
   126      */
       
   127     virtual void AddObserverL( MDialingExtensionObserver* aObserver ) = 0;
       
   128    
       
   129     
       
   130     /**
       
   131      * Removes an observer from the plugin.
       
   132      * 
       
   133      * @param aObserver Observer to be removed.
       
   134      */
       
   135     virtual void RemoveObserver( MDialingExtensionObserver* aObserver ) = 0;
       
   136 
       
   137     
       
   138     /**
       
   139      * Sets input string (search string) to plugin.
       
   140      * 
       
   141      * @param aDesC Input string descriptor.
       
   142      */
       
   143     virtual void SetInputL( const TDesC& aDesC ) = 0;
       
   144 
       
   145 
       
   146     /**
       
   147      * Gets the resource id of plugin's control button area resource.
       
   148      * 
       
   149      * @return  Resource id.
       
   150      */
       
   151     virtual TInt CbaResourceId( ) = 0;
       
   152     
       
   153     
       
   154     /**
       
   155      * Gets the resource id of plugin's menu bar resource.
       
   156      * 
       
   157      * @return  Resource id.
       
   158      */
       
   159     virtual TInt MenuResourceId() = 0;
       
   160     
       
   161     
       
   162     /**
       
   163      * Gets the resource id of plugin's menu bar resource.
       
   164      * 
       
   165      * @param   aMenuPane   Menu pane
       
   166      * @param   aMenuResourceId Menu bar resource id.
       
   167      * @return  Resource id.
       
   168      */
       
   169     virtual TBool InitializeMenuPaneL( CEikMenuPane& aMenuPane, TInt aMenuResourceId ) = 0;
       
   170 
       
   171     
       
   172     /**
       
   173      * Gets the resource id of plugin's menu bar resource.
       
   174      * 
       
   175      * @param   aCommand   Command id.
       
   176      * @return  ETrue if command was handled, EFalse otherwise.
       
   177      */
       
   178     virtual TBool HandleCommandL( TInt aCommand ) = 0;
       
   179 
       
   180     
       
   181     /**
       
   182      * Tells if extension is currently enabled from settings.
       
   183      * @return  ETrue if extension is enabled, EFalse otherwise.
       
   184      */
       
   185     virtual TBool IsEnabled() = 0;
       
   186     
       
   187 private: // data
       
   188 
       
   189     /** ECom instance identifier key. */
       
   190     TUid iDestructorIDKey;
       
   191     };
       
   192 
       
   193 
       
   194 
       
   195 // INLINE FUNCTIONS
       
   196 
       
   197 // -----------------------------------------------------------------------------
       
   198 // CDialingExtensionInterface::NewL
       
   199 //
       
   200 // -----------------------------------------------------------------------------
       
   201 //
       
   202 inline CDialingExtensionInterface* CDialingExtensionInterface::NewL()
       
   203     {
       
   204     // TEComResolverParams resolverParams; // data passed to the plugin
       
   205     // resolverParams.SetDataType();    // no data yet
       
   206 
       
   207     TAny* ptr = REComSession::CreateImplementationL( KEasyDialingPluginImplementationUID,
       
   208                                                      _FOFF( CDialingExtensionInterface, iDestructorIDKey )
       
   209                                                      // resolverParams 
       
   210                                                     );
       
   211 
       
   212     return STATIC_CAST( CDialingExtensionInterface*, ptr );
       
   213     }
       
   214 
       
   215 
       
   216 // -----------------------------------------------------------------------------
       
   217 // CDialingExtensionInterface::~CDialingExtensionInterface()
       
   218 //
       
   219 // -----------------------------------------------------------------------------
       
   220 //
       
   221 inline CDialingExtensionInterface::~CDialingExtensionInterface()
       
   222     {
       
   223     REComSession::DestroyedImplementation( iDestructorIDKey );
       
   224     }
       
   225     
       
   226 #endif //__CDIALEREXTENSIONINTERFACE_H
       
   227 
       
   228 // End of file