ncdengine/provider/client/inc/ncdinstalledcontentimpl.h
changeset 0 ba25891c3a9e
equal deleted inserted replaced
-1:000000000000 0:ba25891c3a9e
       
     1 /*
       
     2 * Copyright (c) 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:   Contains CNcdInstalledContent class
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef NCD_INSTALLED_CONTENT_H
       
    20 #define NCD_INSTALLED_CONTENT_H
       
    21 
       
    22 
       
    23 // For streams
       
    24 #include <s32mem.h>
       
    25 
       
    26 #include "catalogsinterfacebase.h"
       
    27 #include "ncdinstalledcontent.h"
       
    28 
       
    29 class CNcdNodeInstallProxy;
       
    30 
       
    31 /**
       
    32  * Base class for installed content 
       
    33  *
       
    34  *  @lib ?library
       
    35  *  @since S60 ?S60_version *** for example, S60 v3.0
       
    36  */
       
    37 class CNcdInstalledContent: public CCatalogsInterfaceBase,
       
    38                             public MNcdInstalledContent                     
       
    39     {
       
    40 
       
    41 public: // MNcdInstalledContent
       
    42 
       
    43     /**
       
    44      * @see MNcdInstalledContent::IsLaunchable()
       
    45      */
       
    46     virtual TBool IsLaunchable() const;
       
    47 
       
    48 
       
    49     /**
       
    50      * @see MNcdInstalledContent::ContentType()
       
    51      */
       
    52     virtual MNcdInstalledContent::TInstalledContentType ContentType() const;
       
    53     
       
    54     
       
    55 public: // New methods
       
    56 
       
    57     /**
       
    58      * Sets the launchable state for the object
       
    59      *
       
    60      * @param aLaunchable
       
    61      */
       
    62     virtual void SetLaunchable( TBool aLaunchable );
       
    63         
       
    64     
       
    65 public: // MCatalogsBase
       
    66 
       
    67     /**
       
    68      * @note In addition to using the AddRef of the base class,
       
    69      * this function increases the internal reference count of the owner.
       
    70      * This way, the owner will not be deleted before the reference count
       
    71      * of this object is zero. 
       
    72      * The owner should not be deleted before this class object's 
       
    73      * reference count is back to zero. The owner should
       
    74      * handle the deletion of this class object separately for example 
       
    75      * when its destructor is called.
       
    76      *
       
    77      * @see MCatalogsBase::AddRef()
       
    78      */
       
    79     virtual TInt AddRef();
       
    80     
       
    81     /**
       
    82      * @note In addition to using the Rlease of the base class,
       
    83      * this function uses the Release of the owner.
       
    84      * This way, the owner will know if it can be deleted in other words if
       
    85      * this class object is not used anymore.  
       
    86      * The owner should not be deleted before this class object's 
       
    87      * reference count is back to zero. The owner should
       
    88      * handle the deletion of this class object separately for example 
       
    89      * when its destructor is called.
       
    90      *
       
    91      * @see MCatalogsBase::Release()
       
    92      */
       
    93     virtual TInt Release();
       
    94        
       
    95 protected:
       
    96 
       
    97     /**
       
    98      * Constructor
       
    99      *
       
   100      */
       
   101     CNcdInstalledContent( 
       
   102         CNcdNodeInstallProxy& aParent, 
       
   103         TInstalledContentType aType = EInstalledContent );
       
   104 
       
   105 
       
   106     /**
       
   107      * ConstructL
       
   108      */
       
   109     void ConstructL();
       
   110 
       
   111     /**
       
   112      * Destructor
       
   113      *
       
   114      * Informs the node manager that this node is deleted.
       
   115      */
       
   116     virtual ~CNcdInstalledContent();
       
   117 
       
   118     /**
       
   119      * @return CNcdNodeInstallProxy& reference to the class that owns
       
   120      * this class.
       
   121      */
       
   122     CNcdNodeInstallProxy& ContentOwner() const;
       
   123     
       
   124     
       
   125 private:
       
   126     // Prevent if not implemented
       
   127     CNcdInstalledContent( const CNcdInstalledContent& aObject );
       
   128     CNcdInstalledContent& operator =( const CNcdInstalledContent& aObject );
       
   129             
       
   130 
       
   131 private: // data
       
   132 
       
   133     // Not owned
       
   134     CNcdNodeInstallProxy& iOwner;
       
   135     
       
   136     TInstalledContentType iContentType;
       
   137     TBool iLaunchable;
       
   138     };
       
   139 
       
   140 
       
   141 #endif // NCD_INSTALLED_CONTENT_H