idlehomescreen/xmluirendering/uiengine/inc/xnpublisherdata.h
branchRCL_3
changeset 23 7be2816dbabd
equal deleted inserted replaced
19:79311d856354 23:7be2816dbabd
       
     1 /*
       
     2 * Copyright (c) 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:  Publisher data
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef _XNPUBLISHERDATA_H
       
    20 #define _XNPUBLISHERDATA_H
       
    21 
       
    22 // System includes
       
    23 #include <e32base.h>
       
    24 #include <babitflags.h>
       
    25 
       
    26 // User includes
       
    27 #include <hspublisherinfo.h>
       
    28 
       
    29 // Forward declarations
       
    30 class CXnAppUiAdapter;
       
    31 class CXnPluginData;
       
    32 class CXnNode;
       
    33 
       
    34 /**
       
    35  * Publisher data
       
    36  * 
       
    37  * @ingroup group_xnlayoutengine
       
    38  * @lib xn3layoutengine.lib
       
    39  * @since S60 5.2
       
    40  */
       
    41 NONSHARABLE_CLASS( CXnPublisherData ) : public CBase
       
    42     {
       
    43 public:    
       
    44     // Constructors and destructor
       
    45     
       
    46     /**
       
    47      * Two-phased constructor.
       
    48      */
       
    49     static CXnPublisherData* NewL( CXnPluginData& aOwner, CXnNode& aNode );        
       
    50 
       
    51     /**
       
    52      * Two-phased constructor. Leaving on stack
       
    53      */
       
    54     static CXnPublisherData* NewLC( CXnPluginData& aOwner, CXnNode& aNode );         
       
    55 
       
    56     /**
       
    57      * Destructor
       
    58      */
       
    59     ~CXnPublisherData();
       
    60 
       
    61 private:
       
    62     // private constructors
       
    63 
       
    64     /**
       
    65      * Leaving constructor
       
    66      */
       
    67     void ConstructL();
       
    68     
       
    69     /**
       
    70      * C++ default constructor
       
    71      */
       
    72     CXnPublisherData( CXnPluginData& aOwner, CXnNode& aNode );         
       
    73     
       
    74 public: 
       
    75     // new functions
       
    76     
       
    77     /**
       
    78      * Equals operator
       
    79      *
       
    80      * @since S60 5.2 
       
    81      * @param aNode Node
       
    82      * @return ETrue if this equals to aNode, EFalse otherwise     
       
    83      */
       
    84     TBool operator==( CXnNode& aNode ) const;
       
    85 
       
    86     /**
       
    87      * Equals operator
       
    88      *
       
    89      * @since S60 5.2 
       
    90      * @param aInfo Publisher info
       
    91      * @return ETrue if this equals to aInfo, EFalse otherwise     
       
    92      */    
       
    93     TBool operator==( const THsPublisherInfo& aInfo ) const;
       
    94     
       
    95     /**
       
    96      * Returns publisher info
       
    97      * 
       
    98      * @since S60 5.2
       
    99      * @return Publisher info
       
   100      */
       
   101     const THsPublisherInfo& Info() const;
       
   102     
       
   103     /** 
       
   104      * Returns the <contentsource> element
       
   105      * 
       
   106      * @since S60 5.2
       
   107      * @return Node defining <contentsource> element
       
   108      */
       
   109     CXnNode* ContentSource() const;
       
   110 
       
   111     /**
       
   112      * Schedules publisher load with given reason
       
   113      * 
       
   114      * @since S60 5.2
       
   115      * @param aReason Load reason
       
   116      */    
       
   117     void Load( TInt aReason );
       
   118     
       
   119     /**
       
   120      * Schedules publisher destroy with given reason
       
   121      * 
       
   122      * @since S60 5.2
       
   123      * @param aReason Destroy reason
       
   124      */
       
   125     void Destroy( TInt aReason );
       
   126     
       
   127     /**
       
   128      * Queries wheter this publisher loading is failed
       
   129      * 
       
   130      * @since S60 5.2
       
   131      * @return ETrue if failed, EFalse otherwise
       
   132      */
       
   133     TBool IsFailed() const;
       
   134     
       
   135     /**
       
   136      * Queries wheter this publisher loading is ongoing
       
   137      * 
       
   138      * @since S60 5.2
       
   139      * @return ETrue if ongoing, EFalse otherwise
       
   140      */    
       
   141     TBool IsLoading() const;
       
   142 
       
   143     /**
       
   144      * Gets publisher owner
       
   145      * 
       
   146      * @since S60 5.2
       
   147      * @return Owner
       
   148      */        
       
   149     CXnPluginData* Owner() const;
       
   150     
       
   151 private:
       
   152     // new functions
       
   153     
       
   154     static void NotifyLoaded( TAny* aAny, TInt aResult );        
       
   155     static void NotifyDestroyed( TAny* aAny, TInt aResult );
       
   156         
       
   157 private:
       
   158     // data
       
   159     
       
   160     /** CXnPluginData, Not owned */
       
   161     CXnPluginData& iOwner;
       
   162     /** <contentsource> element, Not owned */
       
   163     CXnNode& iNode;
       
   164     /** AppUiAdapter, Not owned */
       
   165     CXnAppUiAdapter* iAppUi;
       
   166     /** Publisher info built from <contentsource> element */
       
   167     mutable THsPublisherInfo iInfo;
       
   168     /** Flags to define this plugin's state */
       
   169     TBitFlags32 iFlags;    
       
   170     };
       
   171 
       
   172 #endif // _XNPUBLISHERDATA_H
       
   173 
       
   174 // End of file