satui/satplugin/aisatplugininc/caisatengine.h
changeset 0 ff3b6d0fd310
child 9 71e7b994dff4
equal deleted inserted replaced
-1:000000000000 0:ff3b6d0fd310
       
     1 /*
       
     2 * Copyright (c) 2006-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:  Header file for the CAiSatEngine class
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CAISATENGINE_H
       
    20 #define CAISATENGINE_H
       
    21 
       
    22 // INCLUDE FILES
       
    23 
       
    24 #include <e32property.h>
       
    25 #include <SATInternalPSKeys.h>
       
    26 #include <RSatSession.h>          // For idle mode text and icon  
       
    27 #include <rsatservice.h>          // For idle mode text and icon
       
    28 #include <tsaticoninfo.h>
       
    29 
       
    30 class CAiSatNotifier;
       
    31 class TAIPluginInitData;
       
    32 class MPluginAPI;
       
    33 
       
    34 /**
       
    35  *  CAiSatEngine
       
    36  *
       
    37  *  @since S60 v3.2
       
    38  */
       
    39 class CAiSatEngine : public CBase
       
    40     {
       
    41 
       
    42 public:  // Constructors and destructor
       
    43 
       
    44     /**
       
    45      * Part of the two phased constuction
       
    46      *
       
    47      * @param MPluginAPI& aPlugin a ref to a object implementing MPluginAPI
       
    48      *       (the object ordering a notification of the content status change)
       
    49      * @return Pointer to the created CAiSatEngine object
       
    50      */
       
    51     static CAiSatEngine* NewL( MPluginAPI& aPlugin );
       
    52 
       
    53     /**
       
    54      * Destructor
       
    55      */
       
    56     ~CAiSatEngine();
       
    57 
       
    58 public: // New functions
       
    59 
       
    60     /**
       
    61      * Offers the Idle Mode text
       
    62      *
       
    63      * @param aString Idle mode text for publishing
       
    64      */
       
    65     void ContentText( TPtrC& aString );
       
    66  
       
    67     /**
       
    68      * Offers the Idle Mode icon
       
    69      *
       
    70      * @param aGulIcon icon for publishing
       
    71      * 
       
    72      */    
       
    73     void ContentIconL( CGulIcon*& aGulIcon );
       
    74     
       
    75     /**
       
    76      * Formulates response to SatIcon API.
       
    77      */
       
    78     void HandleNotifyL();
       
    79  
       
    80     /**
       
    81      * Get idle text, icon id, icon qulifier and load icon as bitmap.
       
    82      *
       
    83      * @param aDupIcon If the icon is the same as previous one.
       
    84      * @param aDupText If the text is the same as previous one.
       
    85      */    
       
    86     void PrepareIdleModeDataL( TBool& aDupIcon, TBool& aDupText );  
       
    87             
       
    88 private: // private construction method
       
    89 
       
    90     /**
       
    91      * Constructor to use in the object creation. 
       
    92      * Initializes the necessary data.
       
    93      *
       
    94      * @param MPluginAPI& aPlugin a ref to a object implementing MPluginAPI
       
    95      *      (the object ordering a notification of the content status change)
       
    96      */
       
    97     CAiSatEngine( MPluginAPI& aPlugin);
       
    98 
       
    99     /**
       
   100      * Part of the two phased construction
       
   101      */
       
   102     void ConstructL();     
       
   103 
       
   104 private: // New functions
       
   105 
       
   106     /**
       
   107      * Duplicate a bitmap by copying memory.
       
   108      *
       
   109      * @param aSrcBmp The source bitmap.
       
   110      * @param aDestBmp The destination bitmap.
       
   111      * @return The error code.
       
   112      */
       
   113     TInt DuplicateBitmap( const CFbsBitmap* aDestBmp,
       
   114                           const CFbsBitmap* aSrcBmp );    
       
   115 
       
   116     /**
       
   117      * Loads the Idle Mode icon from SatIcon.
       
   118      *
       
   119      * @param aIconId The icon record id.
       
   120      * @param aIconQualifier the icon qualifier.
       
   121      * @return The Idle Mode icon id in TInt, the caller need to delete
       
   122      *         the pointer.
       
   123      */
       
   124     CFbsBitmap* LoadIconL( TUint8 aIconId, 
       
   125         RSatService::TSatIconQualifier aIconQualifier );  
       
   126         
       
   127     /**
       
   128      * Information of the content availability.
       
   129      *
       
   130      * @return ETrue if there is content to show, EFalse if not.
       
   131      */
       
   132     TBool HasContent();    
       
   133     
       
   134     /**
       
   135      * Sends idle information to satIconInfo
       
   136      *
       
   137      * @param const RSatService::TSATIdleResult& aResponse
       
   138      */
       
   139     void SendSatResponseL(
       
   140         const RSatService::TSATIdleResult& aResponse ) const;                                      
       
   141            
       
   142 private: // Data
       
   143 
       
   144     /**
       
   145      * Pointer to the Display Text proactive command handler
       
   146      * Own 
       
   147      */
       
   148     CAiSatNotifier* iNotifier;
       
   149 
       
   150     /**
       
   151      * ref to the class implementing the MPluginAPI interface
       
   152      */    
       
   153     MPluginAPI& iPlugin;
       
   154    
       
   155     /**
       
   156      * SIM icon buffer
       
   157      * Own
       
   158      */     
       
   159     CFbsBitmap* iIcon;
       
   160     
       
   161     /**
       
   162      * Icon id in previous icon loading (to check if icon is changed)
       
   163      */    
       
   164     TUint8 iPreviousIconId;
       
   165     
       
   166     /**
       
   167      * SatClient session. 
       
   168      */    
       
   169     RSatSession iSatSession;
       
   170     
       
   171     /**
       
   172      * SatClient service.
       
   173      */    
       
   174     RSatService iSatService;
       
   175     };
       
   176 
       
   177 #endif // CAISATENGINE_H