idlefw/plugins/devicestatus/inc/aidevicestatuspluginengine.h
branchRCL_3
changeset 114 a5a39a295112
equal deleted inserted replaced
113:0efa10d348c0 114:a5a39a295112
       
     1 /*
       
     2 * Copyright (c) 2006-2006 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:  Engine class for Device Status Plug-in
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef AIDEVICESTATUSPLUGINENGINE_H
       
    20 #define AIDEVICESTATUSPLUGINENGINE_H
       
    21 
       
    22 // System includes
       
    23 #include <e32base.h>
       
    24 
       
    25 // User includes
       
    26 #include <aisystemuids.hrh>
       
    27 #include "aipublisherbroadcaster.h"
       
    28 #include "aidevicestatuspublisher.h"
       
    29 
       
    30 // Forward declarations
       
    31 class CHsContentPublisher;
       
    32 class MAiContentObserver;
       
    33 class MAiPublishPrioritizer;
       
    34 
       
    35 // Constants
       
    36 //device status plugin UI
       
    37 const TInt KImplUidDevStaPlugin = AI_UID_ECOM_IMPLEMENTATION_CONTENTPUBLISHER_DEVSTAPLUGIN;
       
    38 
       
    39 
       
    40 /**
       
    41  *  @ingroup group_devicestatusplugin
       
    42  *
       
    43  *  Engine class for Device Status Plug-in
       
    44  *
       
    45  *  This class works as an engine for Device Status Plug-in.
       
    46  *  It owns the publishers and communicates between them and
       
    47  *	the subscribers.
       
    48  *
       
    49  *  @since S60 v3.2
       
    50  */
       
    51 NONSHARABLE_CLASS( CAiDeviceStatusPluginEngine ) : public CBase, 
       
    52     public MAiPublisherBroadcaster
       
    53     {
       
    54 public:
       
    55     // constructor and destructor
       
    56     
       
    57     static CAiDeviceStatusPluginEngine* NewL( MAiContentObserver& aObserver, 
       
    58         CHsContentPublisher& aExtension, MAiPublishPrioritizer& aPrioritizer );
       
    59                                                 
       
    60     virtual ~CAiDeviceStatusPluginEngine();
       
    61 
       
    62 public:
       
    63     // new functions
       
    64 
       
    65     /**
       
    66      * Refreshes all active publishers.
       
    67      */
       
    68     void RefreshActivePublishersL( TBool aClean );    
       
    69 
       
    70     /**
       
    71      * Resumes all publishers.
       
    72      */
       
    73     void ResumePublishersL();
       
    74     
       
    75     /**
       
    76      * Refreshes all publishers.
       
    77      * @param aClean Indicates if publishers should clean their content before
       
    78      *                  re-publish.
       
    79      */    
       
    80     void RefreshPublishersL( TBool aClean );
       
    81 
       
    82     /**
       
    83      * Refreshes specific publishers.
       
    84      * @param aContentId Indicates which publishers should publish their 
       
    85      *                  content.
       
    86      * @param aClean Indicates if publishers should clean their content before
       
    87      *                  re-publish.
       
    88      * @return ETrue if publisher informed that publish was successful.
       
    89      */    
       
    90     TBool RefreshPublishersL( TInt aContentId, TBool aClean );
       
    91 
       
    92     /**
       
    93      * Suspends specific publishers.
       
    94      * @param aContentId Indicates which publishers should suspend their 
       
    95      *                  content.
       
    96      * @param aClean Indicates if publishers should clean their content before
       
    97      *                  suspend.
       
    98      * @return ETrue if publisher informed that publish was successful.
       
    99      */    
       
   100     TBool SuspendPublishersL( TInt aContentId, TBool aClean );
       
   101     
       
   102 
       
   103 public: 
       
   104     // from MAiPublisherBroadcaster
       
   105     
       
   106     TBool RefreshPriorizedPublishersL( TInt aContentId, TInt aPriority );
       
   107 
       
   108 
       
   109 private:
       
   110     // constructors
       
   111 
       
   112     CAiDeviceStatusPluginEngine( MAiContentObserver& aObserver, 
       
   113         CHsContentPublisher& aExtension, MAiPublishPrioritizer& aPrioritizer );
       
   114                                     
       
   115     void ConstructL();
       
   116 
       
   117 private:
       
   118     // new functions
       
   119     
       
   120      /**
       
   121       * Add Device Status publisher.
       
   122       */
       
   123     void AddPublisherL( MAiDeviceStatusPublisher* aPublisher );
       
   124 
       
   125 private: 
       
   126     // data
       
   127 
       
   128     /**
       
   129      * Array of publishers.
       
   130      * Own.
       
   131      */
       
   132     RPointerArray<MAiDeviceStatusPublisher> iPublishers;
       
   133 
       
   134     /**
       
   135      * Content observer.
       
   136      * Not own.
       
   137      */
       
   138     MAiContentObserver* iContentObserver;
       
   139 
       
   140     /**
       
   141      * Property extension.
       
   142      * Not own.
       
   143      */
       
   144     CHsContentPublisher* iExtension;
       
   145 
       
   146 	/**
       
   147 	 * Content prioritizer.
       
   148 	 * Not own.
       
   149 	 */
       
   150 	MAiPublishPrioritizer* iPrioritizer;
       
   151     };
       
   152 
       
   153 #endif // AIDEVICESTATUSPLUGINENGINE_H
       
   154 
       
   155 // End of file