Home | History | Annotate | Download | only in include
      1 /* ------------------------------------------------------------------
      2  * Copyright (C) 1998-2009 PacketVideo
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
     13  * express or implied.
     14  * See the License for the specific language governing permissions
     15  * and limitations under the License.
     16  * -------------------------------------------------------------------
     17  */
     18 #ifndef PVMF_CPMPLUGIN_LICENSE_INTERFACE_TYPES_H_INCLUDED
     19 #define PVMF_CPMPLUGIN_LICENSE_INTERFACE_TYPES_H_INCLUDED
     20 
     21 #ifndef OSCL_BASE_H_INCLUDED
     22 #include "oscl_base.h"
     23 #endif
     24 #ifndef OSCL_TYPES_H_INCLUDED
     25 #include "oscl_types.h"
     26 #endif
     27 #ifndef OSCL_VECTOR_H_INCLUDED
     28 #include "oscl_vector.h"
     29 #endif
     30 #ifndef OSCL_STRING_H_INCLUDED
     31 #include "oscl_string.h"
     32 #endif
     33 #ifndef PV_UUID_H_INCLUDED
     34 #include "pv_uuid.h"
     35 #endif
     36 #ifndef PV_INTERFACE_H_INCLUDED
     37 #include "pv_interface.h"
     38 #endif
     39 #include "pvmf_return_codes.h"
     40 #include "pvmf_event_handling.h"
     41 
     42 
     43 //A class to hold detailed license status information
     44 class PVMFCPMLicenseStatus
     45 {
     46     public:
     47         PVMFCPMLicenseStatus():
     48                 iNumLicenseChallengesSent(0)
     49                 , iNumLicenseResponsesReceived(0)
     50                 , iLastLicenseResponseResult(0)
     51                 , iNumLicenseAckChallengesSent(0)
     52                 , iNumLicenseAckResponsesReceived(0)
     53                 , iLastLicenseAckResponseResult(0)
     54                 , iNumFallbackLicenseChallengesSent(0)
     55                 , iNumFallbackLicenseResponsesReceived(0)
     56                 , iLastFallbackLicenseResponseResult(0)
     57                 , iNumJoinChallengesSent(0)
     58                 , iNumJoinResponsesReceived(0)
     59                 , iLastJoinResponseResult(0)
     60                 , iNumLeaveChallengesSent(0)
     61                 , iNumLeaveResponsesReceived(0)
     62                 , iLastLeaveResponseResult(0)
     63                 , iLastErrorResult(0)
     64         {}
     65 
     66 
     67         OSCL_HeapString<OsclMemAllocator> iLastLicenseURL;
     68         uint32 iNumLicenseChallengesSent;
     69         uint32 iNumLicenseResponsesReceived;
     70         uint32 iLastLicenseResponseResult;
     71 
     72         uint32 iNumLicenseAckChallengesSent;
     73         uint32 iNumLicenseAckResponsesReceived;
     74         uint32 iLastLicenseAckResponseResult;
     75 
     76         OSCL_HeapString<OsclMemAllocator> iLastFallbackLicenseURL;
     77         uint32 iNumFallbackLicenseChallengesSent;
     78         uint32 iNumFallbackLicenseResponsesReceived;
     79         uint32 iLastFallbackLicenseResponseResult;
     80 
     81         OSCL_HeapString<OsclMemAllocator> iLastJoinURL;
     82         uint32 iNumJoinChallengesSent;
     83         uint32 iNumJoinResponsesReceived;
     84         uint32 iLastJoinResponseResult;
     85 
     86         OSCL_HeapString<OsclMemAllocator> iLastLeaveURL;
     87         uint32 iNumLeaveChallengesSent;
     88         uint32 iNumLeaveResponsesReceived;
     89         uint32 iLastLeaveResponseResult;
     90 
     91         uint32 iLastErrorResult;
     92 
     93         void Clear()
     94         {
     95             iLastLicenseURL = "";
     96             iNumLicenseChallengesSent = iNumLicenseResponsesReceived = iLastLicenseResponseResult = 0;
     97             iNumLicenseAckChallengesSent = iNumLicenseAckResponsesReceived = iLastLicenseAckResponseResult = 0;
     98 
     99             iLastFallbackLicenseURL = "";
    100             iNumFallbackLicenseChallengesSent = iNumFallbackLicenseResponsesReceived = iLastFallbackLicenseResponseResult = 0;
    101 
    102             iLastJoinURL = "";
    103             iNumJoinChallengesSent = iNumJoinResponsesReceived = iLastJoinResponseResult = 0;
    104 
    105             iLastLeaveURL = "";
    106             iNumLeaveChallengesSent = iNumLeaveResponsesReceived = iLastLeaveResponseResult = 0;
    107 
    108             iLastErrorResult = 0;
    109         }
    110         void Set(const PVMFCPMLicenseStatus& aStatus)
    111         {
    112             iLastLicenseURL = aStatus.iLastLicenseURL;
    113             iNumLicenseChallengesSent = aStatus.iNumLicenseChallengesSent;
    114             iNumLicenseResponsesReceived = aStatus.iNumLicenseResponsesReceived;
    115             iLastLicenseResponseResult = aStatus.iLastLicenseResponseResult;
    116             iNumLicenseAckChallengesSent = aStatus.iNumLicenseAckChallengesSent;
    117             iNumLicenseAckResponsesReceived = aStatus.iNumLicenseAckResponsesReceived;
    118             iLastLicenseAckResponseResult = aStatus.iLastLicenseAckResponseResult;
    119             iLastFallbackLicenseURL = aStatus.iLastFallbackLicenseURL;
    120             iNumFallbackLicenseChallengesSent = aStatus.iNumFallbackLicenseChallengesSent;
    121             iNumFallbackLicenseResponsesReceived = aStatus.iNumFallbackLicenseResponsesReceived;
    122             iLastFallbackLicenseResponseResult = aStatus.iLastFallbackLicenseResponseResult;
    123             iLastJoinURL = aStatus.iLastJoinURL;
    124             iNumJoinChallengesSent = aStatus.iNumJoinChallengesSent;
    125             iNumJoinResponsesReceived = aStatus.iNumJoinResponsesReceived;
    126             iLastJoinResponseResult = aStatus.iLastJoinResponseResult;
    127             iLastLeaveURL = aStatus.iLastLeaveURL;
    128             iNumLeaveChallengesSent = aStatus.iNumLeaveChallengesSent;
    129             iNumLeaveResponsesReceived = aStatus.iNumLeaveResponsesReceived;
    130             iLastLeaveResponseResult = aStatus.iLastLeaveResponseResult;
    131             iLastErrorResult = aStatus.iLastErrorResult;
    132         }
    133 };
    134 
    135 #endif //PVMF_CPMPLUGIN_LICENSE_INTERFACE_TYPES_H_INCLUDED
    136 
    137