idlefw/plugins/devicestatus/inc/aidevicestatusplugin.h
branchRCL_3
changeset 9 d0529222e3f0
parent 0 79c6a41cd166
equal deleted inserted replaced
4:1a2a00e78665 9:d0529222e3f0
    17 
    17 
    18 
    18 
    19 #ifndef C_AIDEVICESTATUSPLUGIN_H
    19 #ifndef C_AIDEVICESTATUSPLUGIN_H
    20 #define C_AIDEVICESTATUSPLUGIN_H
    20 #define C_AIDEVICESTATUSPLUGIN_H
    21 
    21 
       
    22 // System includes
    22 
    23 
    23 #include <aicontentpublisher.h>
    24 // User includes
    24 #include <aipropertyextension.h>
    25 #include <hscontentpublisher.h>
    25 #include <aicontentrequest.h>
    26 #include <aicontentrequest.h>
    26 
    27 
       
    28 // Forward declarations
    27 class MAiDeviceStatusPublisher;
    29 class MAiDeviceStatusPublisher;
    28 class CAiContentItemArrayIterator;
    30 class CAiContentItemArrayIterator;
    29 class CAiDeviceStatusPluginEngine;
    31 class CAiDeviceStatusPluginEngine;
    30 class CAiMultiContentObserver;
    32 class CAiMultiContentObserver;
    31 class CAiPublishPrioritizer;
    33 class CAiPublishPrioritizer;
    38  *
    40  *
    39  *  This class implements required active idle plugin API.
    41  *  This class implements required active idle plugin API.
    40  *
    42  *
    41  *  @since S60 3.2
    43  *  @since S60 3.2
    42  */
    44  */
    43 class CAiDeviceStatusPlugin : public CAiContentPublisher, 
    45 NONSHARABLE_CLASS( CAiDeviceStatusPlugin ) : public CHsContentPublisher, 
    44                                 public MAiPropertyExtension, 
    46     public MAiContentRequest                                 
    45                                 public MAiContentRequest
       
    46     {
    47     {
    47 public:
    48 public:
    48 
    49     // constructors and destructor
    49     static CAiDeviceStatusPlugin* NewL();
    50     static CAiDeviceStatusPlugin* NewL();
    50     static CAiDeviceStatusPlugin* NewLC();
    51     static CAiDeviceStatusPlugin* NewLC();
    51 
    52 
    52     virtual ~CAiDeviceStatusPlugin();
    53     virtual ~CAiDeviceStatusPlugin();
    53 
    54 
    54 protected:
    55 protected:
       
    56     // from CHsContentPublisher
       
    57     
       
    58     /**
       
    59      * @see CHsContentPublisher
       
    60      */
       
    61     void Start( CHsContentPublisher::TStartReason aReason );
    55 
    62 
    56 // from base class CAiContentPublisher
    63     /**
    57     void Resume( TAiTransitionReason aReason );
    64      * @see CHsContentPublisher
    58     void Suspend( TAiTransitionReason aReason );
    65      */    
    59     void Stop( TAiTransitionReason aReason );
    66     void Stop( CHsContentPublisher::TStopReason aReason );
    60     void SubscribeL(MAiContentObserver& aObserver);
    67     
    61     TAny* Extension(TUid aUid);
    68     /**
    62     void ConfigureL(RAiSettingsItemArray& aSettings);
    69      * @see CHsContentPublisher
       
    70      */    
       
    71     void Resume( CHsContentPublisher::TResumeReason aReason );
       
    72     
       
    73     /**
       
    74      * @see CHsContentPublisher
       
    75      */    
       
    76     void Suspend( CHsContentPublisher::TSuspendReason aReason );
    63 
    77 
       
    78     /**
       
    79      * @see CHsContentPublisher
       
    80      */    
       
    81     void SubscribeL( MAiContentObserver& aObserver );
       
    82     
       
    83     /**
       
    84      * @see CHsContentPublisher
       
    85      */    
       
    86     void ConfigureL( RAiSettingsItemArray& aSettings );
       
    87     
       
    88     /**
       
    89      * @see CHsContentPublisher
       
    90      */    
       
    91     TAny* GetProperty( CHsContentPublisher::TProperty aProperty );
       
    92     
    64 protected:
    93 protected:
    65 
    94     // from MAiContentRequest
    66 // from base class MAiPropertyExtension
    95     
    67     TAny* GetPropertyL(TInt aProperty);
    96     /**
    68     void SetPropertyL(TInt aProperty, TAny* aValue);
    97      * @see MAiContentRequest
    69 
    98      */
    70 // from base class MAiContentRequest
       
    71     TBool RefreshContent( TInt aContentId );
    99     TBool RefreshContent( TInt aContentId );
    72 
   100 
       
   101     /**
       
   102      * @see MAiContentRequest
       
   103      */    
       
   104     TBool SuspendContent( TInt aContentId );
       
   105     
       
   106 private:
       
   107     // constructors
       
   108     
       
   109     /**
       
   110      * C++ default constructor
       
   111      */
       
   112     CAiDeviceStatusPlugin();
       
   113     
       
   114     /**
       
   115      * 2nd phase constructor
       
   116      */
       
   117     void ConstructL();
    73 
   118 
    74 private:
   119 private:
    75 
   120     // new functions
    76     CAiDeviceStatusPlugin();
   121     
    77     void ConstructL();
       
    78 
       
    79     void AllocateResourcesL();
   122     void AllocateResourcesL();
    80     void FreeResources();
   123     void FreeResources();
    81     void DoResumeL( TAiTransitionReason aReason );
   124     void DoResumeL();
    82     TBool IgnoreReason( TAiTransitionReason aReason );
   125     
    83 
       
    84      /**
       
    85      * Add device status publisher.
       
    86      */
       
    87     void AddPublisherL( MAiDeviceStatusPublisher* aPublisher );
   126     void AddPublisherL( MAiDeviceStatusPublisher* aPublisher );
    88 
   127 
    89 private: // data
   128 private: 
       
   129     // data
    90 
   130 
    91 	/**
   131 	/** Device Status Plug-in Engine, owned */
    92 	 * Device Status Plug-in Engine.
       
    93 	 * Own.
       
    94 	 */
       
    95 	 CAiDeviceStatusPluginEngine* iEngine;
   132 	 CAiDeviceStatusPluginEngine* iEngine;
    96 
   133     /** Content observers, owned */
    97     /**
       
    98      * Content observers.
       
    99      * Own.
       
   100      */
       
   101     CAiMultiContentObserver* iContentObservers;
   134     CAiMultiContentObserver* iContentObservers;
   102 
   135 	/** Device Status Plug-in content prioritizer, owned */
   103 	/**
       
   104 	 * Device Status Plug-in content prioritizer.
       
   105 	 * Own.
       
   106 	 */
       
   107 	 CAiPublishPrioritizer* iPrioritizer;
   136 	 CAiPublishPrioritizer* iPrioritizer;
   108 
   137     /** Content item array iterator, owned */
   109     /**
       
   110      * Content item array iterator.
       
   111      * Own.
       
   112      */
       
   113     MAiContentItemIterator* iContent;
   138     MAiContentItemIterator* iContent;
   114 
   139     /** Content item array iterator for resources, owned */
   115     /**
       
   116      * Content item array iterator for resources.
       
   117      * Own.
       
   118      */
       
   119     MAiContentItemIterator* iResources;
   140     MAiContentItemIterator* iResources;
   120 
   141     /** Offset of the loaded resource file */
   121     /**
   142     TInt iResourceOffset;    
   122      * Publisher info.
   143     /** Network info listener, owned */
   123      */
       
   124     TAiPublisherInfo iInfo;
       
   125 
       
   126     /**
       
   127      * Offset of the loaded resource file.
       
   128      */
       
   129     TInt iResourceOffset;
       
   130     
       
   131     /**
       
   132      * Network info listener.
       
   133      * Own.
       
   134      */
       
   135     CAiNetworkInfoListener* iListener;    
   144     CAiNetworkInfoListener* iListener;    
       
   145     /** Flag to indicate republish need */
       
   146     TBool iRequirePublish;
   136     };
   147     };
   137 
   148 
       
   149 #endif // C_AIDEVICESTATUSPLUGIN_H
   138 
   150 
   139 #endif // C_AIDEVICESTATUSPLUGIN_H
   151 // End of file