omadrm/drmplugins/drmromtm/uiData/inc/RoMtmDat.h
changeset 0 95b198f216e5
child 18 8a03a285ab14
equal deleted inserted replaced
-1:000000000000 0:95b198f216e5
       
     1 /*
       
     2 * Copyright (c) 2002-2009 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:  Implementation of Rights Object MTM UI Data
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef RIGHTSOBJECTMTMUIDATA_H
       
    20 #define RIGHTSOBJECTMTMUIDATA_H
       
    21 
       
    22 //  INCLUDES
       
    23 #if !defined(__MSVSTD_H__)
       
    24 #include <MSVSTD.H>
       
    25 #endif
       
    26 
       
    27 #if !defined(__MTUDBAS_H__)
       
    28 #include <MTUDCBAS.H>
       
    29 #endif
       
    30 
       
    31 // CONSTANTS
       
    32 // MACROS
       
    33 // DATA TYPES
       
    34 // FUNCTION PROTOTYPES
       
    35 // FORWARD DECLARATIONS
       
    36 class CRightsObjectMtmUiDataSessionObserver;
       
    37 class CMsvSession;
       
    38 
       
    39 // CLASS DECLARATION
       
    40 /**
       
    41 *	CRightsObjectMtmUiDataSessionObserver
       
    42 *  
       
    43 *   CMsvSession Observer
       
    44 *
       
    45 *  @lib RoMtmDat.lib
       
    46 *  @since 2.5
       
    47 */
       
    48 class CRightsObjectMtmUiDataSessionObserver : public CBase, public MMsvSessionObserver
       
    49 	{
       
    50 	public:
       
    51 
       
    52         /**
       
    53 		* Two-phased constructor.
       
    54 		*/
       
    55 		static CRightsObjectMtmUiDataSessionObserver* NewL();
       
    56 
       
    57 		/**
       
    58 		* Destructor.
       
    59 		*/
       
    60 		~CRightsObjectMtmUiDataSessionObserver();
       
    61 
       
    62         /**
       
    63         * From MMsvSessionObserver
       
    64         */
       
    65         void HandleSessionEventL( 
       
    66             TMsvSessionEvent aEvent, 
       
    67             TAny* aArg1, 
       
    68             TAny* aArg2, 
       
    69             TAny* aArg3 );
       
    70 
       
    71     private:
       
    72         CRightsObjectMtmUiDataSessionObserver();
       
    73         void ConstructL();
       
    74     };
       
    75 
       
    76 
       
    77 // CLASS DECLARATION
       
    78 /**
       
    79 *	CRightsObjectMtmUiData
       
    80 *  
       
    81 *  @lib RoMtmDat.lib
       
    82 *  @since 2.5
       
    83 */
       
    84 class CRightsObjectMtmUiData : public CBaseMtmUiData
       
    85 	{
       
    86 	public:
       
    87 	// Construction, initialisation, and destruction 
       
    88 	
       
    89 		/**
       
    90 		* Two-phased constructor.
       
    91 		*/
       
    92 		static CRightsObjectMtmUiData* NewL( CRegisteredMtmDll& aRegisteredDll );
       
    93 
       
    94 		/**
       
    95 		* Destructor.
       
    96 		*/
       
    97 		~CRightsObjectMtmUiData();
       
    98 
       
    99 		/*************************************
       
   100 		*
       
   101 		*		from CBaseMtm
       
   102 		*
       
   103 		**************************************/	
       
   104 
       
   105 		// Context-specific information 
       
   106 
       
   107 		/**
       
   108         * CanEditEntryL
       
   109         * @since 2.5
       
   110         * 
       
   111 		* Not supported
       
   112 		*
       
   113         */
       
   114 		TBool CanEditEntryL( const TMsvEntry& aContext , TInt& aReasonResourceId ) const;
       
   115 		
       
   116 		/**
       
   117         * CanViewEntryL
       
   118         * @since 2.5
       
   119         * 
       
   120 		* @param aContext  The entry to which the operation applies. 
       
   121  		* @param aReasonResourceId  On return, a resource string ID or 0. 
       
   122  		*   
       
   123 		* @return KErrNone: the operation is appropriate on the entry. KErrNotSupported: the operation is not appropriate on the entry. 
       
   124         */		
       
   125 		TBool CanViewEntryL( const TMsvEntry& aContext , TInt& aReasonResourceId ) const;
       
   126 		
       
   127 		/**
       
   128         * CanOpenEntryL
       
   129         * @since 2.5
       
   130         * 
       
   131 		* @param aContext  The entry to which the operation applies. 
       
   132  		* @param aReasonResourceId  On return, a resource string ID or 0. 
       
   133  		*   
       
   134 		* @return KErrNone: the operation is appropriate on the entry. KErrNotSupported: the operation is not appropriate on the entry. 
       
   135 	    */		
       
   136 		TBool CanOpenEntryL( const TMsvEntry& aContext , TInt& aReasonResourceId ) const;
       
   137 		
       
   138 		/**
       
   139         * CanCloseEntryL
       
   140         * @since 2.5
       
   141         * 
       
   142 		* Not supported
       
   143 		*
       
   144         */		
       
   145 		TBool CanCloseEntryL( const TMsvEntry& aContext , TInt& aReasonResourceId ) const;
       
   146 		
       
   147 		/**
       
   148         * CanDeleteFromEntryL
       
   149         * @since 2.5
       
   150         * 
       
   151 		* Not supported
       
   152 		*
       
   153         */		
       
   154 		TBool CanDeleteFromEntryL( const TMsvEntry& aContext , TInt& aReasonResourceId ) const;
       
   155 		
       
   156 		/**
       
   157         * CanCopyMoveToEntryL
       
   158         * @since 2.5
       
   159         * 
       
   160 		* Not supported
       
   161 		*
       
   162         */		
       
   163 		TBool CanCopyMoveToEntryL( const TMsvEntry& aContext , TInt& aReasonResourceId ) const;
       
   164 		
       
   165 		/**
       
   166         * CanCopyMoveFromEntryL
       
   167         * @since 2.5
       
   168         * 
       
   169 		* Not supported
       
   170 		*
       
   171         */		
       
   172 		TBool CanCopyMoveFromEntryL( const TMsvEntry& aContext , TInt& aReasonResourceId ) const;
       
   173 		
       
   174 		/**
       
   175         * CanReplyToEntryL
       
   176         * @since 2.5
       
   177         * 
       
   178 		* Not supported
       
   179 		*
       
   180         */		
       
   181 		TBool CanReplyToEntryL( const TMsvEntry& aContext , TInt& aReasonResourceId ) const;
       
   182 		
       
   183 		/**
       
   184         * CanForwardEntryL
       
   185         * @since 2.5
       
   186         * 
       
   187 		* Not supported
       
   188 		*
       
   189         */		
       
   190 		TBool CanForwardEntryL( const TMsvEntry& aContext , TInt& aReasonResourceId ) const;
       
   191 		
       
   192 		/**
       
   193         * CanCreateEntryL
       
   194         * @since 2.5
       
   195         * 
       
   196 		* Not supported
       
   197 		*
       
   198         */		
       
   199 		TBool CanCreateEntryL( const TMsvEntry& aContext , TMsvEntry& aNewEntry , TInt& aReasonResourceId ) const;
       
   200 		
       
   201 		/**
       
   202         * CanDeleteServiceL
       
   203         * @since 2.5
       
   204         * 
       
   205 		* Not supported
       
   206 		*
       
   207         */		
       
   208 		TBool CanDeleteServiceL( const TMsvEntry& aService , TInt& aReasonResourceId ) const;
       
   209 		
       
   210 		/**
       
   211         * CanCancelL
       
   212         * @since 2.5
       
   213         * 
       
   214 		* Not supported
       
   215 		*
       
   216         */		
       
   217 		TBool CanCancelL( const TMsvEntry& aContext , TInt& aReasonResourceId ) const;
       
   218 
       
   219 	// Context-specific icons 
       
   220 
       
   221 		/**
       
   222         * ContextIcon
       
   223         * @since 2.5
       
   224         * 
       
   225 		* @param aContext  Context entry to return the icons for. 
       
   226   		* @param aStateFlags  Flasgs indicating the user interface state of the entry. 
       
   227   		*   
       
   228 		* @return Bitmap array for the given context.. 
       
   229 	    */	
       
   230 		const CBitmapArray& ContextIcon( const TMsvEntry& aContext , TInt aStateFlags ) const;
       
   231 
       
   232 		/**
       
   233         * GetResourceFileName
       
   234         * @since 2.5
       
   235         * 
       
   236 		* @param aFileName Filename buffer to be filled with the resource file path and name 
       
   237 	    */	
       
   238 		void GetResourceFileName( TFileName& aFileName ) const;	
       
   239 		
       
   240 		/**
       
   241         * PopulateArraysL
       
   242         * @since 2.5
       
   243         * 
       
   244 	    */			
       
   245 		void PopulateArraysL();
       
   246 
       
   247 		
       
   248 		/**
       
   249         * StatusTextL
       
   250         * @since 2.5
       
   251         * 
       
   252 		* Not supported
       
   253 		*
       
   254 		*/			
       
   255 		HBufC* StatusTextL( const TMsvEntry& aContext ) const;
       
   256 
       
   257 
       
   258 	// MTM-specific functionality 
       
   259 
       
   260 		/**
       
   261         * OperationSupportedL
       
   262         * @since 2.5
       
   263         * 
       
   264 		* Not supported
       
   265 		*
       
   266 		*/	
       
   267 		TInt OperationSupportedL( 
       
   268             TInt aOperationId , 
       
   269             const TMsvEntry& aContext ) const;
       
   270 		
       
   271 		/**
       
   272         * QueryCapability
       
   273         * @since 2.5
       
   274         * 
       
   275 		* @param aCapability UID of capability to be queried 
       
   276 		* @param aResponse Response value. The format of the response varies 
       
   277         * according to the capability
       
   278 		*
       
   279 		* @return KErrNone if aCapability is a recognised value and a response is 
       
   280         * returned KErrNotSupported if aCapability is not a recognised value 
       
   281         */			
       
   282 		TInt QueryCapability( TUid aCapability , TInt& aResponse ) const;
       
   283 
       
   284 
       
   285     protected:
       
   286         /**
       
   287         * Creates skinned icons. Fallbacks are normal icons
       
   288         * @since Series60 2.8
       
   289         * @param aNumZoomStates: amount of elements in vector
       
   290         *        ( bitmap & bitmapmask )
       
   291         */
       
   292         void CreateSkinnedBitmapsL( TInt aNumZoomStates );
       
   293 
       
   294 	private:
       
   295         void ConstructL();
       
   296 
       
   297 		CRightsObjectMtmUiData( CRegisteredMtmDll& aRegisteredDll );
       
   298 
       
   299         void SetDescriptionL( const TMsvEntry& aContext ) const;
       
   300         
       
   301 
       
   302 	public:     // Data
       
   303     protected:  // Data
       
   304     private:    // Data
       
   305 
       
   306         CRightsObjectMtmUiDataSessionObserver*  iObserver;
       
   307         CMsvSession*                            iSession;
       
   308         
       
   309     public:     // Friend classes
       
   310     protected:  // Friend classes
       
   311     private:    // Friend classes
       
   312 
       
   313 	};
       
   314 
       
   315 #endif      // RIGHTSOBJECTMTMUIDATA_H
       
   316             
       
   317 // End of File