idlehomescreen/examples/carouselwidgetexample/publisher/inc/carouselplugin.h
branchRCL_3
changeset 102 ba63c83f4716
parent 93 b01126ce0bec
child 103 966d119a7e67
equal deleted inserted replaced
93:b01126ce0bec 102:ba63c83f4716
     1 /*
       
     2 * Copyright (c) 2009-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:  Plug-in main class
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CMCSPLUGIN_H
       
    20 #define CMCSPLUGIN_H
       
    21 
       
    22 // System includes
       
    23 
       
    24 // User includes
       
    25 #include <hscontentpublisher.h>
       
    26 #include <aicontentmodel.h>
       
    27 
       
    28 // Forward declarations
       
    29 class MAiContentObserver;
       
    30 class MAiContentItemIterator;
       
    31 class CCarouselPluginEngine;
       
    32 class CCarouselData;
       
    33 
       
    34 
       
    35 /**
       
    36  * @ingroup group_mcsplugin
       
    37  *
       
    38  * MCS Plug-in main class
       
    39  *
       
    40  * @since S60 5.2
       
    41  */
       
    42 NONSHARABLE_CLASS( CCarouselPlugin ) : public CHsContentPublisher    
       
    43     {
       
    44 public:
       
    45     // constructor and destructor
       
    46 
       
    47     static CCarouselPlugin* NewL();
       
    48 
       
    49     ~CCarouselPlugin();
       
    50 
       
    51 private:
       
    52     // constructors
       
    53     
       
    54     /**
       
    55     * C++ default constructor
       
    56     */
       
    57     CCarouselPlugin();
       
    58 
       
    59     /**
       
    60     * 2nd phase constructor
       
    61     */
       
    62     void ConstructL();
       
    63     
       
    64 public:
       
    65     // from CHsContentPublisher
       
    66   
       
    67     /**
       
    68      * @see CHsContentPublisher
       
    69      */
       
    70     void Start( TStartReason aReason );
       
    71 
       
    72     /**
       
    73      * @see CHsContentPublisher
       
    74      */
       
    75     void Stop( TStopReason aReason );
       
    76 
       
    77     /**
       
    78      * @see CHsContentPublisher
       
    79      */    
       
    80     void Resume( TResumeReason aReason );
       
    81 
       
    82     /**
       
    83      * @see CHsContentPublisher
       
    84      */    
       
    85     void Suspend( TSuspendReason aReason );
       
    86 
       
    87     /**
       
    88      * @see CHsContentPublisher
       
    89      */    
       
    90     void SubscribeL( MAiContentObserver& aObserver );
       
    91 
       
    92     /**
       
    93      * @see CHsContentPublisher
       
    94      */    
       
    95     void ConfigureL( RAiSettingsItemArray& aSettings );
       
    96 
       
    97     /**
       
    98      * @see CHsContentPublisher
       
    99      */    
       
   100     TAny* GetProperty( TProperty aProperty );
       
   101 
       
   102     /**
       
   103      * @see CHsContentPublisher
       
   104      */   
       
   105     void HandleEvent( const TDesC& aEventName, const TDesC& aParam );
       
   106     
       
   107 public:
       
   108     // new functions
       
   109 
       
   110     /**
       
   111     * Publishes data
       
   112     */
       
   113     void PublishL();
       
   114     
       
   115 private:
       
   116     // new functions
       
   117     
       
   118     /**
       
   119      * CompareItems
       
   120      */
       
   121     static TInt CompareItems( const MAiPluginSettings& aFirst,
       
   122         const MAiPluginSettings& aSecond );
       
   123           
       
   124     /**
       
   125      * Publishes content for one menu item
       
   126      */
       
   127     void PublishLItemL( MAiContentObserver& aObserver, CCarouselData& aDataItem, TInt aIndex );
       
   128     
       
   129     void PublishEditorItemsL();
       
   130         
       
   131     /**
       
   132     * Delete content model
       
   133     */  
       
   134     void DeleteContentModel();    
       
   135     
       
   136     /**
       
   137      * Determines if dirty items exists
       
   138      */
       
   139     TBool PublishRequired() const; 
       
   140     
       
   141 private: 
       
   142     // data
       
   143 
       
   144     /** Iterator for plugin content, owned */    
       
   145     MAiContentItemIterator* iContent;
       
   146     /** Number of data in the content model */
       
   147     TInt iDataCount;
       
   148     /** Dynamic content model, owned */    
       
   149     TAiContentItem* iContentModel;
       
   150     /** Plugin engine, owned */    
       
   151     CCarouselPluginEngine* iEngine;
       
   152     /** Array of content observers, not owned */    
       
   153     RPointerArray<MAiContentObserver> iObservers;
       
   154     };
       
   155 
       
   156 #endif // CMCSPLUGIN_H
       
   157 
       
   158 // End of file