videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/src/apstubs.cpp
branchRCL_3
changeset 10 112a725ff2c2
parent 9 5294c000a26d
child 11 8970fbd719ec
equal deleted inserted replaced
9:5294c000a26d 10:112a725ff2c2
     1 /*
       
     2 * Copyright (c) 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:  Stubs for Access Point selection for STIF testing
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // Version : %version: ou1cpsw#2 %
       
    20 
       
    21 
       
    22 #include <commsdattypesv1_1.h>
       
    23 #include <metadatabase.h>
       
    24 #include <cmmanagerext.h>
       
    25 #include <elements/metacontainer.h>
       
    26 #include <cmpluginwlandef.h>
       
    27 #include <f32file.h>
       
    28 #include "mpxvideo_debug.h"
       
    29 
       
    30 static TBool wlanAccessPoint = EFalse;
       
    31 
       
    32 RCmConnectionMethodExt::RCmConnectionMethodExt()
       
    33 {
       
    34 }
       
    35 
       
    36 RCmConnectionMethodExt::~RCmConnectionMethodExt()
       
    37 {
       
    38 }
       
    39 
       
    40 TUint32 RCmConnectionMethodExt::GetIntAttributeL( TUint32 /*aAttribute*/ ) const
       
    41 {
       
    42     MPX_DEBUG(_L("RCmConnectionMethodExt::GetIntAttributeL(%d)"), wlanAccessPoint);
       
    43 
       
    44     TUint32 bearer( 0 );
       
    45 
       
    46     if ( wlanAccessPoint )
       
    47     {
       
    48         bearer = KUidWlanBearerType;
       
    49     }
       
    50 
       
    51     return bearer;
       
    52 }
       
    53 
       
    54 void
       
    55 RCmManagerExt::OpenL()
       
    56 {
       
    57 }
       
    58 
       
    59 void
       
    60 RCmManagerExt::Close()
       
    61 {
       
    62 }
       
    63 
       
    64 
       
    65 RCmConnectionMethodExt
       
    66 RCmManagerExt::ConnectionMethodL( TUint32 aConnectionMethodId )
       
    67 {
       
    68     MPX_DEBUG(_L("RCmManagerExt::ConnectionMethodL(%d)"), aConnectionMethodId);
       
    69 
       
    70     RCmConnectionMethodExt connMethod;
       
    71 
       
    72     if ( aConnectionMethodId == 5 || aConnectionMethodId == 6 )
       
    73     {
       
    74         //
       
    75         //  WLan Access Points
       
    76         //
       
    77         wlanAccessPoint = ETrue;
       
    78     }
       
    79 
       
    80     return connMethod;
       
    81 }
       
    82 
       
    83 CBase::CBase( CBase const & /*a*/ )
       
    84 {
       
    85 }
       
    86 
       
    87 namespace CommsDat
       
    88 {
       
    89 
       
    90 using namespace Meta;
       
    91 
       
    92 
       
    93 static const SRecordTypeInfo bearerRecord = { 0, 0, ENoAttrs, KCDNull };
       
    94 
       
    95 const SRecordTypeInfo* const CCDWAPIPBearerRecord::iRecordInfo = &bearerRecord;
       
    96 
       
    97 
       
    98 CMDBTextFieldBase::CMDBTextFieldBase()
       
    99 {
       
   100 }
       
   101 
       
   102 CMDBTextFieldBase::~CMDBTextFieldBase()
       
   103 {
       
   104 }
       
   105 
       
   106 TVersion
       
   107 CMDBSession::LatestVersion()
       
   108 {
       
   109     return TVersion( 1, 1, 1 );
       
   110 }
       
   111 
       
   112 CMDBSession::CMDBSession()
       
   113 {
       
   114 }
       
   115 
       
   116 CMDBSession::~CMDBSession()
       
   117 {
       
   118 }
       
   119 
       
   120 CMDBSession* 
       
   121 CMDBSession::NewL( TVersion /*aRequiredVersion*/ )
       
   122 {
       
   123     CMDBSession* self = new( ELeave ) CMDBSession();
       
   124 
       
   125     return self;
       
   126 }
       
   127 
       
   128 CCDRecordBase::CCDRecordBase( TMDBElementId /*aElementId*/ )
       
   129 {
       
   130 }
       
   131 
       
   132 CCDWAPIPBearerRecord::CCDWAPIPBearerRecord( TMDBElementId aElementId )
       
   133     : CCDRecordBase( aElementId )
       
   134 {
       
   135 }
       
   136 
       
   137 TBool
       
   138 MMetaDatabase::FindL( CMDBSession& /*aSession*/ )
       
   139 {
       
   140     CCDWAPIPBearerRecord* br = static_cast<CCDWAPIPBearerRecord*>(this);
       
   141     br->iWAPIAP = br->iWAPAccessPointId;
       
   142 
       
   143     return ETrue;
       
   144 }
       
   145 
       
   146 CMDBRecordBase* 
       
   147 CCDRecordBase::RecordFactoryL( TMDBElementId /*aInput*/ )
       
   148 {
       
   149     TMDBElementId elementId(0);
       
   150 
       
   151     CCDWAPIPBearerRecord* recordBase = new( ELeave ) CCDWAPIPBearerRecord( elementId );
       
   152 
       
   153     return recordBase;
       
   154 }
       
   155 
       
   156 CMDBNumFieldBase::CMDBNumFieldBase()
       
   157 {
       
   158 }
       
   159 
       
   160 CMDBRecordLinkBase::CMDBRecordLinkBase()
       
   161 {
       
   162 }
       
   163 
       
   164 MMetaDatabase::MMetaDatabase()
       
   165 {
       
   166 }
       
   167 
       
   168 MMetaDatabase::~MMetaDatabase()
       
   169 {
       
   170 }
       
   171 
       
   172 CMDBElement::CMDBElement()
       
   173 {
       
   174 }
       
   175 
       
   176 CMDBElement::~CMDBElement()
       
   177 {
       
   178 }
       
   179 
       
   180 CMDBRecordLinkBase::~CMDBRecordLinkBase()
       
   181 {
       
   182 }
       
   183 
       
   184 CMDBElement* 
       
   185 CMDBRecordBase::GetFieldByIdL( TMDBElementId /*aId*/ )
       
   186 {
       
   187     CMDBNumFieldBase* element = new( ELeave ) CMDBNumFieldBase();
       
   188     return element;
       
   189 }
       
   190 
       
   191 CMDBElement* 
       
   192 CommsDat::CMDBRecordBase::GetFieldByNameL( const TPtrC& /*aFieldName*/, TInt& /*aValType*/ )
       
   193 {
       
   194     CMDBNumFieldBase* element = new( ELeave ) CMDBNumFieldBase();
       
   195     return element;
       
   196 }
       
   197 
       
   198 SVDataTableEntry const * 
       
   199 CCDWAPIPBearerRecord::GetVDataTable() const
       
   200 {
       
   201     SVDataTableEntry* entry = NULL;
       
   202 
       
   203     return entry;
       
   204 }
       
   205 
       
   206 TUint8* 
       
   207 CCDWAPIPBearerRecord::GetAttribPtr( const TInt /*aOffset*/ ) const
       
   208 {
       
   209     TUint8* ptr = new( ELeave ) TUint8();
       
   210     return ptr;
       
   211 }
       
   212 
       
   213 SVDataTableEntry const * 
       
   214 CMDBNumFieldBase::GetVDataTable() const
       
   215 {
       
   216     SVDataTableEntry* entry = NULL;
       
   217 
       
   218     return entry;
       
   219 }
       
   220 
       
   221 TUint8* 
       
   222 CMDBNumFieldBase::GetAttribPtr( const TInt /*aOffset*/ ) const
       
   223 {
       
   224     TUint8* ptr = new( ELeave ) TUint8();
       
   225     return ptr;
       
   226 }
       
   227 
       
   228 SVDataTableEntry const * 
       
   229 CMDBRecordLinkBase::GetVDataTable() const
       
   230 {
       
   231     SVDataTableEntry* entry = NULL;
       
   232 
       
   233     return entry;
       
   234 }
       
   235 
       
   236 TUint8* 
       
   237 CMDBRecordLinkBase::GetAttribPtr( const TInt /*aOffset*/ ) const
       
   238 {
       
   239     TUint8* ptr = new( ELeave ) TUint8();
       
   240     return ptr;
       
   241 }
       
   242 
       
   243 CMDBRecordLinkBase& 
       
   244 CMDBRecordLinkBase::operator=( const TMDBElementId aValue ) 
       
   245 {
       
   246     iValue = (TAny*)aValue;
       
   247     
       
   248     // iElementId |= (KCDChangedFlag | KCDNotNullFlag);
       
   249             
       
   250     return *this;
       
   251 }
       
   252 
       
   253 CMDBRecordLinkBase::operator TMDBElementId()
       
   254 { 
       
   255     return (TMDBElementId&)iValue; 
       
   256 }
       
   257 
       
   258 SVDataTableEntry const * 
       
   259 CCDRecordBase::GetVDataTable() const
       
   260 {
       
   261     SVDataTableEntry* entry = NULL;
       
   262 
       
   263     return entry;
       
   264 }
       
   265 
       
   266 TUint8* 
       
   267 CCDRecordBase::GetAttribPtr( const TInt /*aOffset*/ ) const
       
   268 {
       
   269     TUint8* ptr = new( ELeave ) TUint8();
       
   270     return ptr;
       
   271 }
       
   272 
       
   273 const SRecordTypeInfo* 
       
   274 CMDBRecordBase::GetRecordInfo()
       
   275 {
       
   276     SRecordTypeInfo* typeInfo = NULL;
       
   277     return typeInfo;
       
   278 }
       
   279 
       
   280 SVDataTableEntry const * 
       
   281 CMDBTextFieldBase::GetVDataTable() const
       
   282 {
       
   283     SVDataTableEntry* entry = NULL;
       
   284 
       
   285     return entry;
       
   286 }
       
   287 
       
   288 TUint8* 
       
   289 CMDBTextFieldBase::GetAttribPtr( const TInt /*aOffset*/ ) const
       
   290 {
       
   291     TUint8* ptr = new( ELeave ) TUint8();
       
   292     return ptr;
       
   293 }
       
   294 
       
   295 SVDataTableEntry const * 
       
   296 CMDBElement::GetVDataTable() const
       
   297 {
       
   298     SVDataTableEntry* entry = NULL;
       
   299 
       
   300     return entry;
       
   301 }
       
   302 
       
   303 TUint8* 
       
   304 CMDBElement::GetAttribPtr( const TInt /*aOffset*/ ) const
       
   305 {
       
   306     TUint8* ptr = new( ELeave ) TUint8();
       
   307     return ptr;
       
   308 }
       
   309 
       
   310 }  // namespace CommsDat
       
   311 
       
   312 
       
   313 namespace Meta
       
   314 {
       
   315 
       
   316 SMetaData::SMetaData()
       
   317 {
       
   318 }
       
   319 
       
   320 SMetaData::~SMetaData()
       
   321 {
       
   322 }
       
   323 
       
   324 SMetaDataECom::SMetaDataECom()
       
   325 {
       
   326 }
       
   327 
       
   328 SMetaDataECom::~SMetaDataECom()
       
   329 {
       
   330 }
       
   331 
       
   332 SMetaDataECom* 
       
   333 SMetaDataECom::LoadL( TPtrC8& /*aDes*/ )
       
   334 {
       
   335     SMetaDataECom* data = NULL;
       
   336     return data;
       
   337 }
       
   338 
       
   339 RMetaDataContainerBase::RMetaDataContainerBase()
       
   340 {
       
   341 }
       
   342 
       
   343 } // namespace Meta
       
   344 
       
   345 
       
   346 #include <es_sock.h>
       
   347 
       
   348 _LIT( KQueryAccessPointFilename, "c:\\queryApId.txt" );
       
   349 
       
   350 TInt
       
   351 ReadApIdFromFile()
       
   352 {
       
   353     RFs fs;
       
   354     RFile file;
       
   355 
       
   356     TInt err = fs.Connect();
       
   357 
       
   358     err = file.Open( fs, KQueryAccessPointFilename, EFileRead | EFileShareAny );
       
   359 
       
   360     TInt apId(0);
       
   361 
       
   362     HBufC8* fBuf = HBufC8::NewL( 16 );
       
   363     TPtr8 fileBuf = fBuf->Des();
       
   364 
       
   365     file.Read( fileBuf, 16 );
       
   366 
       
   367     TLex8 number( fileBuf );
       
   368     number.Val( apId );
       
   369 
       
   370     file.Close();
       
   371     fs.Close();
       
   372 
       
   373     return apId;
       
   374 }
       
   375 
       
   376 void
       
   377 WriteApIdToFile( TInt aNewValue )
       
   378 {
       
   379     RFile file;
       
   380 
       
   381     RFs fs;
       
   382     User::LeaveIfError( fs.Connect() );
       
   383 
       
   384     TBuf8<16> tgt;
       
   385     tgt.Num( aNewValue );
       
   386 
       
   387     file.Replace( fs, KQueryAccessPointFilename, EFileWrite );
       
   388 
       
   389     file.Write( tgt );
       
   390 
       
   391     file.Close();
       
   392     fs.Close();
       
   393 }
       
   394 
       
   395 TInt
       
   396 RConnection::Open( RSocketServ& /*aSocketServer*/, TUint /*aConnectionType*/ )
       
   397 {
       
   398     return KErrNone;
       
   399 }
       
   400     
       
   401 TInt
       
   402 RConnection::Start( TConnPref& /*aPref*/ )
       
   403 {
       
   404     TInt retVal = KErrNone;
       
   405 
       
   406     TInt apId = ReadApIdFromFile();
       
   407 
       
   408     if ( apId == 0 )
       
   409     {
       
   410         WriteApIdToFile( KErrCancel );
       
   411         retVal = KErrNotFound;
       
   412     }
       
   413     else if ( apId == 8 )
       
   414     {
       
   415         WriteApIdToFile( 9 );
       
   416         retVal = KErrNotFound;
       
   417     }
       
   418     else if ( apId == KErrCancel )
       
   419     {
       
   420         retVal = KErrCancel;
       
   421     }
       
   422 
       
   423     MPX_DEBUG( _L("RConnection::Start(%d)"), retVal );
       
   424 
       
   425     return retVal;
       
   426 }
       
   427     
       
   428 void
       
   429 RConnection::Close()
       
   430 {
       
   431 }
       
   432 
       
   433 RConnection::RConnection()
       
   434     : iNewISPId(0)
       
   435 {
       
   436 }
       
   437 
       
   438 RConnection::~RConnection()
       
   439 {
       
   440 }
       
   441 
       
   442 TInt 
       
   443 RConnection::GetIntSetting( const TDesC& /*aSettingName*/, TUint32& aValue )
       
   444 {
       
   445     MPX_ENTER_EXIT(_L("RConnection::GetIntSetting()"));
       
   446 
       
   447     TInt apId = ReadApIdFromFile();
       
   448 
       
   449     MPX_DEBUG( _L("RConnection::GetIntSetting(%d)"), apId );
       
   450 
       
   451     aValue = apId;
       
   452 
       
   453     return KErrNone;
       
   454 }
       
   455 
       
   456 
       
   457 #include <connpref.h>
       
   458 
       
   459 TConnPref::TConnPref()
       
   460 {
       
   461 }
       
   462 
       
   463 TConnPrefList::TConnPrefList()
       
   464 {
       
   465 }
       
   466 
       
   467 TConnPrefList::~TConnPrefList()
       
   468 {
       
   469 }
       
   470 
       
   471 void 
       
   472 TConnPrefList::AppendL( SMetaDataECom* /*aFamily*/ )
       
   473 {
       
   474 }
       
   475 
       
   476 
       
   477 
       
   478 #include <extendedconnpref.h>
       
   479 
       
   480 TExtendedConnPref::TExtendedConnPref()
       
   481 {
       
   482 }
       
   483 
       
   484 void 
       
   485 TExtendedConnPref::SetSnapPurpose( CMManager::TSnapPurpose /*aSnapPurpose*/ )
       
   486 {
       
   487 }
       
   488 
       
   489 void 
       
   490 TExtendedConnPref::SetNoteBehaviour( TUint32 /*aNoteBehaviour*/ )
       
   491 {
       
   492 }
       
   493 
       
   494 void 
       
   495 TExtendedConnPref::SetConnSelectionDialog( TBool /*aConnSelectionDialog*/ )
       
   496 {
       
   497 }
       
   498 
       
   499 TUint8* 
       
   500 TExtendedConnPref::GetAttribPtr( const TInt /*aOffset*/ ) const
       
   501 {
       
   502     TUint8* ptr = new( ELeave ) TUint8();
       
   503     return ptr;
       
   504 }
       
   505 
       
   506 SVDataTableEntry const * 
       
   507 TExtendedConnPref::GetVDataTable() const
       
   508 {
       
   509     SVDataTableEntry* entry = NULL;
       
   510 
       
   511     return entry;
       
   512 }
       
   513 
       
   514 
       
   515 
       
   516 RSocketServ::RSocketServ()
       
   517 {
       
   518 }
       
   519 
       
   520 TInt
       
   521 RSocketServ::Connect( TUint /*aMessageSlots*/ )
       
   522 {
       
   523     return KErrNone;
       
   524 }
       
   525 
       
   526 
       
   527 // EOF