omadrm/drmhelper/drmhelperserver/inc/EndTimeBased.h
changeset 0 95b198f216e5
equal deleted inserted replaced
-1:000000000000 0:95b198f216e5
       
     1 /*
       
     2 * Copyright (c) 2002 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:  Handling end time based automated content
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef ENDTIMEBASED_H
       
    21 #define ENDTIMEBASED_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32base.h>
       
    25 // CONSTANTS
       
    26 // MACROS
       
    27 // DATA TYPES
       
    28 // FUNCTION PROTOTYPES
       
    29 // FORWARD DECLARATIONS
       
    30 class CDRMHelperServer;
       
    31 
       
    32 // CLASS DECLARATION
       
    33 
       
    34 /**
       
    35 *  End time based rights storage class
       
    36 *  
       
    37 *
       
    38 *  @lib DRMHelperServer.lib
       
    39 *  @since Series60 2.6
       
    40 */
       
    41 class CEndTimeBased : public CBase
       
    42     {
       
    43     public:  // Constructors and destructor
       
    44         
       
    45         /**
       
    46         * Two-phased constructor.
       
    47         */
       
    48         static CEndTimeBased* NewL( 
       
    49             const TDesC8& aUri , 
       
    50             const TUint8& aPermType , 
       
    51             const TUint8& aRegType , 
       
    52             const TUint8& aAutoType );
       
    53         
       
    54         /**
       
    55         * Destructor.
       
    56         */
       
    57         virtual ~CEndTimeBased();
       
    58 
       
    59     public: // New functions
       
    60         
       
    61         /**
       
    62         * SetIsExpired
       
    63         * set whether the content rights is expired
       
    64         * @since Series60 2.6
       
    65         * @param aIsExpired if expired or not
       
    66         * 
       
    67         */
       
    68         void SetIsExpired( TBool aIsExpired );
       
    69 
       
    70         /**
       
    71         * check if the content rights is expired
       
    72         * @since Series60 2.6
       
    73         * @return ETrue if expired otherwise EFalse,
       
    74         */
       
    75         TBool IsExpired() const;
       
    76         
       
    77         /**
       
    78         * Set the value of count
       
    79         * @since Series60 2.6
       
    80         * @param aCount the times the content was handled
       
    81         */
       
    82         void SetCount(TInt8 aCount);
       
    83 
       
    84         /**
       
    85         * IncreaseCount the value of count by 1
       
    86         * @since Series60 2.6
       
    87         * 
       
    88         */
       
    89         void IncreaseCount();
       
    90         
       
    91         /**
       
    92         * get the value of count
       
    93         * @since Series60 2.6
       
    94         * @return the value of count
       
    95         */
       
    96         TInt8 Count() const;
       
    97 
       
    98         /**
       
    99         * IncreaseRegTimes the value of registered times by 1
       
   100         * @since Series60 2.6
       
   101         * 
       
   102         */
       
   103         void IncreaseRegTimes();
       
   104 
       
   105         /**
       
   106         * DecreaseRegTimes the value of registered times by 1
       
   107         * @since Series60 2.6
       
   108         * 
       
   109         */
       
   110         void DecreaseRegTimes();
       
   111 
       
   112         /**
       
   113         * Set the value of registered times
       
   114         * @since Series60 2.6
       
   115         * @param aCount the times the content was registered
       
   116         */
       
   117         void SetRegTimes(TInt aRegTimes);
       
   118         
       
   119         /**
       
   120         * get the value of times the content is registered
       
   121         * @since Series60 2.6
       
   122         * @return the value of count
       
   123         */
       
   124         TInt RegTimes() const;
       
   125 
       
   126         /**
       
   127         * get the value of register type
       
   128         * @since Series60 2.6
       
   129         * @return the value of register type
       
   130         */
       
   131         TUint8 RegType() const;
       
   132 
       
   133         /**
       
   134         * get the value of automated content type
       
   135         * @since Series60 2.6
       
   136         * @return the value of automated content type
       
   137         */
       
   138         TUint8 AutoType() const;
       
   139 
       
   140         /**
       
   141         * get the value of permission type
       
   142         * @since Series60 2.6
       
   143         * @return the value of permission type
       
   144         */
       
   145         TUint8 PermType() const;        
       
   146 
       
   147         /**
       
   148         * Set the value of end time
       
   149         * @since Series60 2.6
       
   150         * @param aEndTime end time for content rights
       
   151         */
       
   152         void SetEndTime( TTime aEndTime );
       
   153 
       
   154         /**
       
   155         * get the value of end time
       
   156         * @since Series60 2.6
       
   157         * @return the value of end time
       
   158         */
       
   159         TTime EndTime() const;
       
   160 
       
   161         /**
       
   162         * Set the value of content uri
       
   163         * @since Series60 2.6
       
   164         * @param aUri content uri for the automated content
       
   165         * @return KErrNone if everything works fine.
       
   166         */
       
   167         TInt SetContentUri( const TDesC8& aUri );
       
   168 
       
   169         /**
       
   170         * get the value of content uri
       
   171         * @since Series60 2.6
       
   172         * @return the value of content uri
       
   173         */
       
   174         HBufC8* Uri() const;
       
   175 
       
   176         
       
   177 
       
   178     public: // Functions from base classes
       
   179 
       
   180     protected:  // New functions
       
   181         
       
   182     protected:  // Functions from base classes
       
   183 
       
   184     private:
       
   185 
       
   186         /**
       
   187         * C++ default constructor.
       
   188         */
       
   189         CEndTimeBased( 
       
   190             const TUint8& aPermType , 
       
   191             const TUint8& aRegType , 
       
   192             const TUint8& aAutoType );
       
   193 
       
   194         /**
       
   195         * By default Symbian 2nd phase constructor is private.
       
   196         */
       
   197         void ConstructL( const TDesC8& aUri );
       
   198     public:     // Data
       
   199     protected:  // Data
       
   200     private:    // Data
       
   201     public:     // Friend classes
       
   202     protected:  // Friend classes
       
   203     private:    // Friend classes
       
   204         HBufC8* iUri;
       
   205         TTime iEndTime;
       
   206         TBool iIsExpired;
       
   207         TInt8 iCount;
       
   208         TInt iCountReg;
       
   209         TUint8 iPermType;
       
   210         TUint8 iRegType;
       
   211         TUint8 iAutoType;
       
   212     };
       
   213 
       
   214 #endif      // ENDTIMEBASED_H   
       
   215             
       
   216 // End of File