psln/pslnengine/inc/PslnSkinNameEntry.h
changeset 37 89c890c70182
parent 34 6b5204869ed5
child 45 667edd0b8678
equal deleted inserted replaced
34:6b5204869ed5 37:89c890c70182
     1 /*
       
     2 * Copyright (c) 2004-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:  Class defining a specific skin within Psln.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_PSLNSKINNAMEENTRY_H
       
    20 #define C_PSLNSKINNAMEENTRY_H
       
    21 
       
    22 #include <e32base.h>
       
    23 #include <AknsSrvSkinInformationPkg.h>
       
    24 
       
    25 /**
       
    26 * Class defining a specific skin within Psln.
       
    27 * Defined attributes are name, ID and location.
       
    28 * @since S60 v2.5
       
    29 */
       
    30 class CPslnSkinNameEntry : public CBase    
       
    31     {
       
    32     public:
       
    33         
       
    34     /**
       
    35     * Two-phased constructor.
       
    36     * @return new instance of CPslnSkinNameEntry.
       
    37     */
       
    38     static CPslnSkinNameEntry* NewL();
       
    39     
       
    40     /**
       
    41     * Destructor.
       
    42     */
       
    43     virtual ~CPslnSkinNameEntry();
       
    44 
       
    45     /**
       
    46     * Method for getting skin name.
       
    47     * @param aDst returns skin name for the entry.
       
    48     */
       
    49     void GetName( TDes& aDst ) const;
       
    50     
       
    51     /**
       
    52     * Method for setting skin name.
       
    53     * @param aName sets skin name for the entry to this descriptor.
       
    54     */
       
    55     void SetNameL( const TDesC& aName );
       
    56 
       
    57     /**
       
    58     * Method for fetching the location of skin package.
       
    59     * @see details from AknsSrvSkinInformationPkg.h.
       
    60     * @return skin package location.
       
    61     */
       
    62     TAknSkinSrvSkinPackageLocation Location() const;
       
    63     
       
    64     /**
       
    65     * Method for setting skin package location.
       
    66     * @see details from AknsSrvSkinInformationPkg.h.
       
    67     * @param aLocation skin package location.
       
    68     */
       
    69     void SetLocation( const TAknSkinSrvSkinPackageLocation aLocation );
       
    70 
       
    71     /**
       
    72     * Method for getting skin package name.
       
    73     * @return skin package ID.
       
    74     */
       
    75     TAknsPkgID PkgID() const;
       
    76     
       
    77     /**
       
    78     * Method for setting skin package name.
       
    79     * @param aPID skin package ID.
       
    80     */
       
    81     void SetPkgID( const TAknsPkgID& aPID );
       
    82 
       
    83     /**
       
    84     * Determines the order of two objects.
       
    85     * Default system skin is always less than anything else.
       
    86     * Otherwise the order is the (folded) order of names.
       
    87     *
       
    88     * @param aFirst First object to be compared.
       
    89     *
       
    90     * @param aSecond Second object to be compared.
       
    91     *
       
    92     * @return 0 if the two objects are equal, negative value if the first 
       
    93     *   object is less than the second and positive value if the first 
       
    94     *   object is greater than the second.
       
    95     */
       
    96     static TInt LinearOrder( 
       
    97         const CPslnSkinNameEntry& aFirst, 
       
    98         const CPslnSkinNameEntry& aSecond );
       
    99         
       
   100     /**
       
   101     * Returns skin package location, based on path parameter.
       
   102     * @param aPath path of skin package
       
   103     * @return skin package location
       
   104     */
       
   105     static TAknSkinSrvSkinPackageLocation LocationFromPath( 
       
   106         const TDesC& aPath );
       
   107 
       
   108 protected:
       
   109 
       
   110     /* Copies data honoring size. */
       
   111     static void CopyHonoringSize( TDes& aDst, const TDesC* aSrc );
       
   112     
       
   113     /* Copies data honoring size. */
       
   114     static void CopyHonoringSize( TDes& aDst, const TDesC& aSrc );        
       
   115 
       
   116     /* Base construct.  */
       
   117     void BaseConstructL( CAknsSrvSkinInformationPkg* aInfo = NULL );
       
   118 
       
   119     /**
       
   120     * C++ default constructor.
       
   121     */
       
   122     CPslnSkinNameEntry();
       
   123 
       
   124 private: // data
       
   125 
       
   126     /**
       
   127     * Skin name.
       
   128     * Own
       
   129     */
       
   130     HBufC* iName;
       
   131 
       
   132     /** 
       
   133     * Skin package location.
       
   134     */
       
   135     TAknSkinSrvSkinPackageLocation iLocation;
       
   136 
       
   137     /**
       
   138     * Skin package ID.
       
   139     */
       
   140     TAknsPkgID iPID;
       
   141 
       
   142     };
       
   143 
       
   144 
       
   145 #endif // C_PSLNSKINNAMEENTRY_H
       
   146 
       
   147 
       
   148 // End of File