commondrm/drmutility/src/DrmUiHandling.cpp
changeset 0 95b198f216e5
child 18 8a03a285ab14
equal deleted inserted replaced
-1:000000000000 0:95b198f216e5
       
     1 /*
       
     2 * Copyright (c) 2006-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:  DRM UI Handling
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include <drmutility.h>
       
    21 #include <drmuihandling.h>
       
    22 #include <coemain.h>
       
    23 
       
    24 #include "drmuierrorhandling.h"
       
    25 #include "drmuihandlingimpl.h"
       
    26 
       
    27 // ============================= LOCAL FUNCTIONS ===============================
       
    28 
       
    29 // ============================ MEMBER FUNCTIONS ===============================
       
    30 
       
    31 // -----------------------------------------------------------------------------
       
    32 // CDrmUiHandling::CDrmUiHandling
       
    33 // C++ default constructor can NOT contain any code, that
       
    34 // might leave.
       
    35 // -----------------------------------------------------------------------------
       
    36 //
       
    37 DRM::CDrmUiHandling::CDrmUiHandling( )
       
    38     {
       
    39     }
       
    40 
       
    41 // -----------------------------------------------------------------------------
       
    42 // CDrmUiHandling::ConstructL
       
    43 // Symbian 2nd phase constructor can leave.
       
    44 // -----------------------------------------------------------------------------
       
    45 //
       
    46 void DRM::CDrmUiHandling::ConstructL( CCoeEnv* aCoeEnv )
       
    47     {
       
    48     // CDrmUtility instance
       
    49     iUtility = DRM::CDrmUtility::NewL();
       
    50 
       
    51     // Implementation instance
       
    52     iImplementation = DRM::CDrmUiHandlingImpl::NewL(
       
    53         iUtility, aCoeEnv ? aCoeEnv : CCoeEnv::Static() );
       
    54 
       
    55     // Does not take ownership of the iImplementation, just uses it
       
    56     iErrorHandler = DRM::CDrmUiErrorHandling::NewL( iImplementation );
       
    57     }
       
    58 
       
    59 // -----------------------------------------------------------------------------
       
    60 // CDrmUiHandling::NewL
       
    61 // Two-phased constructor.
       
    62 // -----------------------------------------------------------------------------
       
    63 //
       
    64 EXPORT_C DRM::CDrmUiHandling* DRM::CDrmUiHandling::NewL( CCoeEnv* aCoeEnv )
       
    65     {
       
    66     DRM::CDrmUiHandling* self( NewLC( aCoeEnv ) );
       
    67 
       
    68     CleanupStack::Pop( self );
       
    69 
       
    70     return self;
       
    71     }
       
    72 
       
    73 
       
    74 // -----------------------------------------------------------------------------
       
    75 // CDrmUiHandling::NewLC
       
    76 // Two-phased constructor.
       
    77 // -----------------------------------------------------------------------------
       
    78 //
       
    79 EXPORT_C DRM::CDrmUiHandling* DRM::CDrmUiHandling::NewLC( CCoeEnv* aCoeEnv )
       
    80     {
       
    81    DRM:: CDrmUiHandling* self( new( ELeave ) CDrmUiHandling );
       
    82 
       
    83     CleanupStack::PushL( self );
       
    84     self->ConstructL( aCoeEnv );
       
    85 
       
    86     return self;
       
    87     }
       
    88 
       
    89 
       
    90 // Destructor
       
    91 DRM::CDrmUiHandling::~CDrmUiHandling()
       
    92     {
       
    93     delete static_cast< DRM::CDrmUiErrorHandling* >( iErrorHandler );
       
    94     delete iImplementation;
       
    95     delete iUtility;
       
    96     }
       
    97 
       
    98 // -----------------------------------------------------------------------------
       
    99 // CDrmUiHandling::GetUtility
       
   100 // (other items were commented in a header).
       
   101 // -----------------------------------------------------------------------------
       
   102 //
       
   103 EXPORT_C DRM::CDrmUtility& DRM::CDrmUiHandling::GetUtility() const
       
   104     {
       
   105     return *iUtility;
       
   106     }
       
   107 
       
   108 
       
   109 // -----------------------------------------------------------------------------
       
   110 // CDrmUiHandling::GetErrorHandler
       
   111 // (other items were commented in a header).
       
   112 // -----------------------------------------------------------------------------
       
   113 //
       
   114 EXPORT_C DRM::MDrmErrorHandling& DRM::CDrmUiHandling::GetErrorHandler() const
       
   115     {
       
   116     return *iErrorHandler;
       
   117     }
       
   118 
       
   119 
       
   120 
       
   121 // -----------------------------------------------------------------------------
       
   122 // CDrmUiHandling::CheckRightsAmountAsyncL
       
   123 // Check how much rights there are left for the content.
       
   124 // (other items were commented in a header).
       
   125 // -----------------------------------------------------------------------------
       
   126 //
       
   127 EXPORT_C TInt DRM::CDrmUiHandling::CheckRightsAmountAsyncL(
       
   128     RFile& aFile,
       
   129     ContentAccess::TIntent aIntent,
       
   130     DRM::MDrmUiCheckRightsObserver& aObserver )
       
   131     {
       
   132     TInt operation = iImplementation->CheckRightsAmountAsyncL( aFile,
       
   133                                                                aIntent,
       
   134                                                                aObserver );
       
   135     return operation;
       
   136     }
       
   137 
       
   138 // -----------------------------------------------------------------------------
       
   139 // CDrmUiHandling::CheckRightsAmount
       
   140 // Check how much rights there are left for the content.
       
   141 // (other items were commented in a header).
       
   142 // -----------------------------------------------------------------------------
       
   143 //
       
   144 EXPORT_C void DRM::CDrmUiHandling::CheckRightsAmountL(
       
   145     RFile& aFile,
       
   146     ContentAccess::TIntent aIntent,
       
   147     DRM::MDrmUiCheckRightsObserver* aObserver )
       
   148     {
       
   149     iImplementation->CheckRightsAmountL( aFile, aIntent, aObserver );
       
   150     }
       
   151 
       
   152 // -----------------------------------------------------------------------------
       
   153 // CDrmUiHandling::CheckRightsAmountAsyncL
       
   154 // Check how much rights there are left for the content.
       
   155 // (other items were commented in a header).
       
   156 // -----------------------------------------------------------------------------
       
   157 //
       
   158 EXPORT_C TInt DRM::CDrmUiHandling::CheckRightsAmountAsyncL(
       
   159     ContentAccess::CData& aFile,
       
   160     ContentAccess::TIntent aIntent,
       
   161     DRM::MDrmUiCheckRightsObserver& aObserver )
       
   162     {
       
   163     TInt operation = iImplementation->CheckRightsAmountAsyncL( aFile,
       
   164                                                                aIntent,
       
   165                                                                aObserver );
       
   166     return operation;
       
   167     }
       
   168 
       
   169 // -----------------------------------------------------------------------------
       
   170 // CDrmUiHandling::CheckRightsAmountL
       
   171 // Check how much rights there are left for the content.
       
   172 // (other items were commented in a header).
       
   173 // -----------------------------------------------------------------------------
       
   174 //
       
   175 EXPORT_C void DRM::CDrmUiHandling::CheckRightsAmountL(
       
   176     ContentAccess::CData& aFile,
       
   177     ContentAccess::TIntent aIntent,
       
   178     DRM::MDrmUiCheckRightsObserver* aObserver )
       
   179     {
       
   180     iImplementation->CheckRightsAmountL( aFile, aIntent, aObserver );
       
   181     }
       
   182 
       
   183 // -----------------------------------------------------------------------------
       
   184 // CDrmUiHandling::ShowDetailsViewAsyncL
       
   185 // Shows DRM specif details
       
   186 // (other items were commented in a header).
       
   187 // -----------------------------------------------------------------------------
       
   188 //
       
   189 EXPORT_C TInt DRM::CDrmUiHandling::ShowDetailsViewAsyncL(
       
   190     RFile& aFile,
       
   191     DRM::MDrmAsyncObserver& aObserver )
       
   192     {
       
   193     TInt operation = iImplementation->ShowDetailsViewAsyncL( aFile, aObserver );
       
   194     return operation;
       
   195     }
       
   196 
       
   197 // -----------------------------------------------------------------------------
       
   198 // CDrmUiHandling::ShowDetailsViewL
       
   199 // Shows DRM specif details
       
   200 // (other items were commented in a header).
       
   201 // -----------------------------------------------------------------------------
       
   202 //
       
   203 EXPORT_C void DRM::CDrmUiHandling::ShowDetailsViewL( RFile& aFile )
       
   204     {
       
   205     iImplementation->ShowDetailsViewL( aFile );
       
   206     }
       
   207 
       
   208 // -----------------------------------------------------------------------------
       
   209 // CDrmUiHandling::ShowDetailsViewAsyncL
       
   210 // Shows DRM specif details
       
   211 // (other items were commented in a header).
       
   212 // -----------------------------------------------------------------------------
       
   213 //
       
   214 EXPORT_C TInt DRM::CDrmUiHandling::ShowDetailsViewAsyncL(
       
   215     ContentAccess::CData& aFile,
       
   216     DRM::MDrmAsyncObserver& aObserver )
       
   217     {
       
   218     TInt operation = iImplementation->ShowDetailsViewAsyncL( aFile, aObserver );
       
   219     return operation;
       
   220     }
       
   221 
       
   222 // -----------------------------------------------------------------------------
       
   223 // CDrmUiHandling::ShowDetailsViewL
       
   224 // Shows DRM specif details
       
   225 // (other items were commented in a header).
       
   226 // -----------------------------------------------------------------------------
       
   227 //
       
   228 EXPORT_C void DRM::CDrmUiHandling::ShowDetailsViewL( ContentAccess::CData& aFile )
       
   229     {
       
   230     iImplementation->ShowDetailsViewL( aFile );
       
   231     }
       
   232 
       
   233 // -----------------------------------------------------------------------------
       
   234 // CDrmUiHandling::HandleUrlAsyncL
       
   235 // Handles the specific url defined by the file
       
   236 // (other items were commented in a header).
       
   237 // -----------------------------------------------------------------------------
       
   238 //
       
   239 EXPORT_C TInt DRM::CDrmUiHandling::HandleUrlAsyncL(
       
   240     RFile& aFile,
       
   241     DRM::TDrmUiUrlType aType,
       
   242     DRM::MDrmAsyncObserver& aObserver )
       
   243     {
       
   244     TInt operation = iImplementation->HandleUrlAsyncL( aFile, aType, aObserver );
       
   245     return operation;
       
   246     }
       
   247 
       
   248 // -----------------------------------------------------------------------------
       
   249 // CDrmUiHandling::HandleUrlL
       
   250 // Handles the specific url defined by the file
       
   251 // (other items were commented in a header).
       
   252 // -----------------------------------------------------------------------------
       
   253 //
       
   254 EXPORT_C void DRM::CDrmUiHandling::HandleUrlL(
       
   255     RFile& aFile,
       
   256     DRM::TDrmUiUrlType aType )
       
   257     {
       
   258     iImplementation->HandleUrlL( aFile, aType );
       
   259     }
       
   260 
       
   261 // -----------------------------------------------------------------------------
       
   262 // CDrmUiHandling::HandleUrlAsyncL
       
   263 // Handles the specific url defined by the file
       
   264 // (other items were commented in a header).
       
   265 // -----------------------------------------------------------------------------
       
   266 //
       
   267 EXPORT_C TInt DRM::CDrmUiHandling::HandleUrlAsyncL(
       
   268     ContentAccess::CData& aFile,
       
   269     DRM::TDrmUiUrlType aType,
       
   270     DRM::MDrmAsyncObserver& aObserver  )
       
   271     {
       
   272     TInt operation = iImplementation->HandleUrlAsyncL( aFile, aType, aObserver );
       
   273     return operation;
       
   274     }
       
   275 
       
   276 // -----------------------------------------------------------------------------
       
   277 // CDrmUiHandling::HandleUrlL
       
   278 // Handles the specific url defined by the file
       
   279 // (other items were commented in a header).
       
   280 // -----------------------------------------------------------------------------
       
   281 //
       
   282 EXPORT_C void DRM::CDrmUiHandling::HandleUrlL(
       
   283     ContentAccess::CData& aFile,
       
   284     DRM::TDrmUiUrlType aType )
       
   285     {
       
   286     iImplementation->HandleUrlL( aFile, aType );
       
   287     }
       
   288 
       
   289 // -----------------------------------------------------------------------------
       
   290 // CDrmUiHandling::AvailableUrlsAsyncL
       
   291 // Gets information of the available urls
       
   292 // (other items were commented in a header).
       
   293 // -----------------------------------------------------------------------------
       
   294 //
       
   295 EXPORT_C TInt DRM::CDrmUiHandling::AvailableUrlsAsyncL(
       
   296     RFile& aFile,
       
   297     DRM::TDrmUiUrlType& aType,
       
   298     DRM::MDrmAsyncObserver& aObserver )
       
   299     {
       
   300     TInt operation = iImplementation->AvailableUrlsAsyncL( aFile, aType, aObserver );
       
   301     return operation;
       
   302     }
       
   303 
       
   304 // -----------------------------------------------------------------------------
       
   305 // CDrmUiHandling::AvailableUrlsL
       
   306 // Gets information of the available urls
       
   307 // (other items were commented in a header).
       
   308 // -----------------------------------------------------------------------------
       
   309 //
       
   310 EXPORT_C void DRM::CDrmUiHandling::AvailableUrlsL(
       
   311     RFile& aFile,
       
   312     DRM::TDrmUiUrlType& aType )
       
   313     {
       
   314     iImplementation->AvailableUrlsL( aFile, aType );
       
   315     }
       
   316 
       
   317 // -----------------------------------------------------------------------------
       
   318 // CDrmUiHandling::AvailableUrlsAsyncL
       
   319 // Gets information of the available urls
       
   320 // (other items were commented in a header).
       
   321 // -----------------------------------------------------------------------------
       
   322 //
       
   323 EXPORT_C TInt DRM::CDrmUiHandling::AvailableUrlsAsyncL(
       
   324     ContentAccess::CData& aFile,
       
   325     DRM::TDrmUiUrlType& aType,
       
   326     DRM::MDrmAsyncObserver& aObserver  )
       
   327     {
       
   328     TInt operation = iImplementation->AvailableUrlsAsyncL( aFile, aType, aObserver );
       
   329     return operation;
       
   330     }
       
   331 
       
   332 // -----------------------------------------------------------------------------
       
   333 // CDrmUiHandling::AvailableUrlsL
       
   334 // Gets information of the available urls
       
   335 // (other items were commented in a header).
       
   336 // -----------------------------------------------------------------------------
       
   337 //
       
   338 EXPORT_C void DRM::CDrmUiHandling::AvailableUrlsL(
       
   339     ContentAccess::CData& aFile,
       
   340     DRM::TDrmUiUrlType& aType )
       
   341     {
       
   342     iImplementation->AvailableUrlsL( aFile, aType );
       
   343     }
       
   344 
       
   345 // -----------------------------------------------------------------------------
       
   346 // CDrmUiHandling::CancelOperation
       
   347 // Cancels the operation
       
   348 // (other items were commented in a header).
       
   349 // -----------------------------------------------------------------------------
       
   350 //
       
   351 EXPORT_C TInt DRM::CDrmUiHandling::CancelOperation( TInt aOperationId )
       
   352     {
       
   353     return iImplementation->CancelOperation( aOperationId );
       
   354     }
       
   355 
       
   356 
       
   357 //  End of File