commondrm/drmutility/inc/drmutilityui.h
changeset 23 493788a4a8a4
parent 0 95b198f216e5
child 32 457cd4423b8c
equal deleted inserted replaced
5:79d62d1d7957 23:493788a4a8a4
    20 #define CDRMUTILITYUI_H
    20 #define CDRMUTILITYUI_H
    21 
    21 
    22 //*** system include files go here:
    22 //*** system include files go here:
    23 #include <e32base.h>
    23 #include <e32base.h>
    24 #include <f32file.h>
    24 #include <f32file.h>
    25 #include <aknnotifystd.h>
    25 #include <AknNotifyStd.h>
    26 
    26 
    27 //*** forward declarations go here:
    27 //*** forward declarations go here:
    28 class CDRMConstraint;
    28 class CDRMConstraint;
    29 class CCoeEnv;
    29 class CCoeEnv;
    30 class CStringResourceReader;
    30 class CStringResourceReader;
    35 namespace ContentAccess
    35 namespace ContentAccess
    36     {
    36     {
    37     class CData;
    37     class CData;
    38     }
    38     }
    39 
    39 
    40 namespace DRM 
    40 namespace DRM
    41 {
    41 {
    42     
    42 
    43     //*** forward declarations go here:
    43     //*** forward declarations go here:
    44     class CDrmUtilityInfoNoteWrapper;
    44     class CDrmUtilityInfoNoteWrapper;
    45     
    45 
    46  /**
    46  /**
    47   *  Utility class for DRM utility related graphic functions
    47   *  Utility class for DRM utility related graphic functions
    48   *
    48   *
    49   *  @lib drmutilitycommon.lib
    49   *  @lib drmutilitycommon.lib
    50   *  @since S60 v5.0
    50   *  @since S60 v5.0
    57     /**
    57     /**
    58      * Creates a new CDrmUtilityUI object and returns a pointer to it
    58      * Creates a new CDrmUtilityUI object and returns a pointer to it
    59      *
    59      *
    60      * @return A functional CDrmUtilityUI -object
    60      * @return A functional CDrmUtilityUI -object
    61      * @leave System wide error code
    61      * @leave System wide error code
    62      */	
    62      */
    63     IMPORT_C static CDrmUtilityUI* NewL( CCoeEnv* aCoeEnv = NULL );
    63     IMPORT_C static CDrmUtilityUI* NewL( CCoeEnv* aCoeEnv = NULL );
    64 
    64 
    65     /**
    65     /**
    66      * Creates a new CDrmUtilityUI object and returns a pointer to it
    66      * Creates a new CDrmUtilityUI object and returns a pointer to it
    67      * leaves the returned object to the cleanup stack
    67      * leaves the returned object to the cleanup stack
    68      *
    68      *
    69      * @return A functional CDrmUtilityUI -object
    69      * @return A functional CDrmUtilityUI -object
    70      * @leave System wide error code
    70      * @leave System wide error code
    71      */	
    71      */
    72     IMPORT_C static CDrmUtilityUI* NewLC( CCoeEnv* aCoeEnv = NULL );
    72     IMPORT_C static CDrmUtilityUI* NewLC( CCoeEnv* aCoeEnv = NULL );
    73 
    73 
    74     /**
    74     /**
    75      * Destructor
    75      * Destructor
    76      */
    76      */
    77     virtual ~CDrmUtilityUI();
    77     virtual ~CDrmUtilityUI();
    78      
    78 
    79     /**
    79     /**
    80     * Display query dialog
    80     * Display query dialog
    81     */
    81     */
    82     IMPORT_C TInt DisplayQueryWithIdL( TInt aTextResourceId, 
    82     IMPORT_C TInt DisplayQueryWithIdL( TInt aTextResourceId,
    83                                        TInt aQueryResourceId );
    83                                        TInt aQueryResourceId );
    84     
    84 
    85     IMPORT_C TInt DisplayQueryWithIdValueL( TInt aTextResourceId, 
    85     IMPORT_C TInt DisplayQueryWithIdValueL( TInt aTextResourceId,
    86                                             TInt aQueryResourceId, 
    86                                             TInt aQueryResourceId,
    87                                             const TDesC& aString );
    87                                             const TDesC& aString );
    88     
    88 
    89     IMPORT_C TInt DisplayQueryL( TInt aTextResourceId, TInt aValue );
    89     IMPORT_C TInt DisplayQueryL( TInt aTextResourceId, TInt aValue );
    90     
    90 
    91     IMPORT_C TInt DisplayQueryL( TInt aTextResourceId, const TDesC& aString );
    91     IMPORT_C TInt DisplayQueryL( TInt aTextResourceId, const TDesC& aString );
    92     
    92 
    93     IMPORT_C TInt DisplayQueryL( TInt aTextResourceId, 
    93     IMPORT_C TInt DisplayQueryL( TInt aTextResourceId,
    94         	                     const TDesC& aString, 
    94                                  const TDesC& aString,
    95                                  TInt aValue,
    95                                  TInt aValue,
    96         	                     TInt aStringPos = -1,
    96                                  TInt aStringPos = -1,
    97         	                     TInt aValuePos = -1 );
    97                                  TInt aValuePos = -1 );
    98     
    98 
    99     IMPORT_C TInt DisplayQueryL( TDesC& aPromptText, TInt aQueryResourceId );
    99     IMPORT_C TInt DisplayQueryL( TDesC& aPromptText, TInt aQueryResourceId );
   100     
   100 
   101     IMPORT_C TInt SetAutomatedQueryL( CDRMConstraint* aConstraint );
   101     IMPORT_C TInt SetAutomatedQueryL( CDRMConstraint* aConstraint );
   102 
   102 
   103    /**
   103    /**
   104     * Display note
   104     * Display note
   105     */
   105     */
   106     IMPORT_C void ShowFutureRightsNoteL( CDRMConstraint* aConstraint );
   106     IMPORT_C void ShowFutureRightsNoteL( CDRMConstraint* aConstraint );
   107 
   107 
   108     IMPORT_C void DisplayNoteL( TInt aTextResourceId );
   108     IMPORT_C void DisplayNoteL( TInt aTextResourceId );
   109     
   109 
   110     IMPORT_C void DisplayNoteL( TInt aTextResourceId, const TDesC& aString );
   110     IMPORT_C void DisplayNoteL( TInt aTextResourceId, const TDesC& aString );
   111     
   111 
   112     IMPORT_C void DisplayNoteL( TInt aTextResourceId, TInt aValue );
   112     IMPORT_C void DisplayNoteL( TInt aTextResourceId, TInt aValue );
   113     
   113 
   114     IMPORT_C void DisplayNoteL( TDesC& aPromptText, 
   114     IMPORT_C void DisplayNoteL( TDesC& aPromptText,
   115                                 TInt aResourceId, 
   115                                 TInt aResourceId,
   116                                 const TDesC& aString = KNullDesC, 
   116                                 const TDesC& aString = KNullDesC,
   117                                 TInt aValue = -1 );   
   117                                 TInt aValue = -1 );
   118                                 
   118 
   119    /**
   119    /**
   120     * Display list query
   120     * Display list query
   121     */
   121     */
   122     IMPORT_C TInt DisplayPopupWindowsForPreviewL( 
   122     IMPORT_C TInt DisplayPopupWindowsForPreviewL(
   123                                                 ContentAccess::CData& aContent,
   123                                                 ContentAccess::CData& aContent,
   124                                                 TInt aPreviewType, 
   124                                                 TInt aPreviewType,
   125                                                 TInt aMediaType );
   125                                                 TInt aMediaType );
   126 
   126 
   127 
   127 
   128 protected:
   128 protected:
   129 
   129 
   130 private:
   130 private:
   131 
   131 
   132     CDrmUtilityUI( CCoeEnv* aCoeEnv );
   132     CDrmUtilityUI( CCoeEnv* aCoeEnv );
   133 
   133 
   134     void ConstructL();
   134     void ConstructL();
   135     
   135 
   136     CAknResourceNoteDialog* CreateNoteForResourceL( TInt aResId );
   136     CAknResourceNoteDialog* CreateNoteForResourceL( TInt aResId );
   137     
   137 
   138     TAknGlobalNoteType GlobalNoteTypeForResource( TInt aResId );
   138     TAknGlobalNoteType GlobalNoteTypeForResource( TInt aResId );
   139     
   139 
   140     TInt GetOmaStartTime( CDRMConstraint* aConstraint, TTime& aStartTime );
   140     TInt GetOmaStartTime( CDRMConstraint* aConstraint, TTime& aStartTime );
   141     
   141 
   142     TInt EvaluatePreviewMediaTypeL( ContentAccess::CData& aContent,
   142     TInt EvaluatePreviewMediaTypeL( ContentAccess::CData& aContent,
   143                                     TInt aPreviewType );
   143                                     TInt aPreviewType );
   144     
   144 
   145     void PrepareSecondaryDisplayL( CEikDialog& aDialog, 
   145     void PrepareSecondaryDisplayL( CEikDialog& aDialog,
   146                                    TInt aResourceId,
   146                                    TInt aResourceId,
   147                                    const TDesC& aString = KNullDesC, 
   147                                    const TDesC& aString = KNullDesC,
   148                                    TInt aValue = -1 );
   148                                    TInt aValue = -1 );
   149                                    
   149 
   150     void CancelSecondaryDisplayL( TInt aResourceId );
   150     void CancelSecondaryDisplayL( TInt aResourceId );
   151 
   151 
   152 
   152 
   153 private: // Data members
   153 private: // Data members
   154 
   154 
   155     // Control environment, not owned
   155     // Control environment, not owned
   156     CCoeEnv* iCoeEnv;
   156     CCoeEnv* iCoeEnv;
   157     
   157 
   158     // Paths of the resource files
   158     // Paths of the resource files
   159     HBufC* iUtilityResourceFile;
   159     HBufC* iUtilityResourceFile;
   160     HBufC* iAvkonResourceFile;
   160     HBufC* iAvkonResourceFile;
   161 
   161 
   162     // Resource offsets in CoeEnv, when it is available
   162     // Resource offsets in CoeEnv, when it is available
   164     TInt iAvkonResourceFileOffset;
   164     TInt iAvkonResourceFileOffset;
   165 
   165 
   166     // Used to read resources when CoeEnv is not available
   166     // Used to read resources when CoeEnv is not available
   167     CStringResourceReader* iUtilityStringResourceReader;
   167     CStringResourceReader* iUtilityStringResourceReader;
   168     CStringResourceReader* iAvkonStringResourceReader;
   168     CStringResourceReader* iAvkonStringResourceReader;
   169     
   169 
   170     // File server
   170     // File server
   171     RFs iFs;
   171     RFs iFs;
   172     
   172 
   173     // Used to queue up global notes
   173     // Used to queue up global notes
   174     RPointerArray<CDrmUtilityInfoNoteWrapper> iNoteList;
   174     RPointerArray<CDrmUtilityInfoNoteWrapper> iNoteList;
   175 
   175 
   176     CMediatorEventProvider* iEventProvider;
   176     CMediatorEventProvider* iEventProvider;
   177 
   177