serviceproviders/sapi_sysinfo/sysinfoservice/src/sysinfo.cpp
changeset 22 fc9cf246af83
parent 19 989d2f495d90
child 33 50974a8b132e
equal deleted inserted replaced
19:989d2f495d90 22:fc9cf246af83
  1197 //		
  1197 //		
  1198 EXPORT_C TPtrC CConnectionInfo::ConnectionName() const
  1198 EXPORT_C TPtrC CConnectionInfo::ConnectionName() const
  1199     {
  1199     {
  1200     return	TPtrC(*iConnectionName);
  1200     return	TPtrC(*iConnectionName);
  1201     }
  1201     }
       
  1202 
       
  1203 
       
  1204 // --------------------------------------------------------------------
       
  1205 // CCameraResolutionList::CCameraResolutionList()
       
  1206 // Constructor.
       
  1207 // --------------------------------------------------------------------
       
  1208 //
       
  1209 CCameraResolutionList::CCameraResolutionList() :
       
  1210     CSysData( ECameraInfo )
       
  1211     {
       
  1212     }
       
  1213 
       
  1214 // --------------------------------------------------------------------
       
  1215 // CConnectionList::~CConnectionList()
       
  1216 // Destructor
       
  1217 // --------------------------------------------------------------------
       
  1218 //
       
  1219 CCameraResolutionList::~CCameraResolutionList()
       
  1220     {
       
  1221     iresArray.ResetAndDestroy();
       
  1222     iresArray.Close();
       
  1223     }
       
  1224 
       
  1225 // --------------------------------------------------------------------
       
  1226 // CCameraResolutionList::NewL()
       
  1227 // Two-phased constructor. returns new instance of this class.
       
  1228 // --------------------------------------------------------------------
       
  1229 //
       
  1230 CCameraResolutionList* CCameraResolutionList::NewL( RPointerArray<CResolution>& aCamResArray )
       
  1231     {
       
  1232     CCameraResolutionList* self = CCameraResolutionList::NewLC( aCamResArray );
       
  1233     CleanupStack::Pop( self );
       
  1234     return self;
       
  1235     }
       
  1236 
       
  1237 // --------------------------------------------------------------------
       
  1238 // CCameraResolutionList::NewLC()
       
  1239 // Two-phased constructor. returns new instance of this class.
       
  1240 // --------------------------------------------------------------------
       
  1241 //
       
  1242 CCameraResolutionList* CCameraResolutionList::NewLC( RPointerArray<CResolution>& aCamResArray )
       
  1243     {
       
  1244     CCameraResolutionList* self = new (ELeave) CCameraResolutionList();
       
  1245     CleanupStack::PushL( self );
       
  1246     self->ConstructL( aCamResArray );
       
  1247     return self;
       
  1248     }
       
  1249 
       
  1250 // --------------------------------------------------------------------
       
  1251 // CCameraResolutionList::ConstructL()
       
  1252 // 2nd phase construtor
       
  1253 // --------------------------------------------------------------------
       
  1254 //
       
  1255 void CCameraResolutionList::ConstructL( RPointerArray<CResolution>& aCamResArray )
       
  1256     {
       
  1257     iCount = aCamResArray.Count();
       
  1258     if ( iCount > 0 )
       
  1259         {
       
  1260         for ( TInt index = 0; index < iCount; index++ )
       
  1261             {
       
  1262             iresArray.AppendL( aCamResArray[index] );
       
  1263             }
       
  1264         }
       
  1265     }
       
  1266 
       
  1267 // --------------------------------------------------------------------
       
  1268 // CCameraResolutionList::At()
       
  1269 // On return val contains supported resolution XPixel or YPixel depending upon whether flag is 0 or 1.
       
  1270 // --------------------------------------------------------------------
       
  1271 //
       
  1272 EXPORT_C TBool CCameraResolutionList::At( TInt aIndex, TInt aFlag, TInt& aVal ) const
       
  1273     {
       
  1274     if ( 0 <= aIndex && aIndex<iCount )
       
  1275         {
       
  1276         if ( aFlag == 0 )
       
  1277             {
       
  1278             aVal = iresArray[aIndex]->XPixels();
       
  1279             }
       
  1280         else if ( aFlag == 1 )
       
  1281             {
       
  1282             aVal = iresArray[aIndex]->YPixels();
       
  1283             }
       
  1284         else
       
  1285             {
       
  1286             return EFalse;
       
  1287             }
       
  1288         return ETrue;
       
  1289         }
       
  1290     return EFalse;
       
  1291     }
       
  1292 
       
  1293 // --------------------------------------------------------------------
       
  1294 // CCameraResolutionList::[]
       
  1295 // gets Resolution at specified index.
       
  1296 // --------------------------------------------------------------------
       
  1297 //
       
  1298 EXPORT_C const CResolution* CCameraResolutionList::operator[]( TInt aIndex ) const
       
  1299     {
       
  1300     return iresArray[aIndex];
       
  1301     }
       
  1302 
       
  1303 // --------------------------------------------------------------------
       
  1304 // CCameraResolutionList::Count()
       
  1305 // returns number of resolutions supported.
       
  1306 // --------------------------------------------------------------------
       
  1307 //
       
  1308 EXPORT_C TInt CCameraResolutionList::Count() const
       
  1309     {
       
  1310     return iCount;
       
  1311     }
       
  1312 
       
  1313 // --------------------------------------------------------------------
       
  1314 // CCameraInfo::CCameraInfo()
       
  1315 // Constructor.
       
  1316 // --------------------------------------------------------------------
       
  1317 //
       
  1318 CCameraInfo::CCameraInfo() :
       
  1319     CSysData( ECameraInfo )
       
  1320     {
       
  1321     }
       
  1322 
       
  1323 // --------------------------------------------------------------------
       
  1324 // CCameraInfo::~CCameraInfo()
       
  1325 // Destructor
       
  1326 // --------------------------------------------------------------------
       
  1327 //
       
  1328 CCameraInfo::~CCameraInfo()
       
  1329     {
       
  1330     delete iResList;
       
  1331     delete iMimeTypesList;
       
  1332     }
       
  1333 
       
  1334 // --------------------------------------------------------------------
       
  1335 // CCameraInfo::NewL()
       
  1336 // Two-phased constructor. returns new instance of this class.
       
  1337 // --------------------------------------------------------------------
       
  1338 //
       
  1339 CCameraInfo* CCameraInfo::NewL( CCameraResolutionList* aCamResList, CStringList* aMimeTypesList )
       
  1340     {
       
  1341     CCameraInfo* self = CCameraInfo::NewLC( aCamResList, aMimeTypesList );
       
  1342     CleanupStack::Pop( self );
       
  1343     return self;
       
  1344     }
       
  1345 
       
  1346 // --------------------------------------------------------------------
       
  1347 // CCameraInfo::NewLC()
       
  1348 // Two-phased constructor. returns new instance of this class.
       
  1349 // --------------------------------------------------------------------
       
  1350 //
       
  1351 CCameraInfo* CCameraInfo::NewLC( CCameraResolutionList* aCamResList, CStringList* aMimeTypesList )
       
  1352     {
       
  1353     CCameraInfo* self = new (ELeave) CCameraInfo();
       
  1354     CleanupStack::PushL( self );
       
  1355     self->ConstructL( aCamResList, aMimeTypesList );
       
  1356     return self;
       
  1357     }
       
  1358 
       
  1359 // --------------------------------------------------------------------
       
  1360 // CCameraInfo::ConstructL()
       
  1361 // 2nd phase construtor
       
  1362 // --------------------------------------------------------------------
       
  1363 //
       
  1364 void CCameraInfo::ConstructL( CCameraResolutionList* aCamResList, CStringList* aMimeTypesList )
       
  1365     {
       
  1366     iResList = aCamResList;
       
  1367     iMimeTypesList = aMimeTypesList;
       
  1368     }
       
  1369 
       
  1370 // --------------------------------------------------------------------
       
  1371 // CCameraInfo::ResolutionList()
       
  1372 // Gives a list containing supported resolutions
       
  1373 // --------------------------------------------------------------------
       
  1374 //
       
  1375 EXPORT_C CCameraResolutionList* CCameraInfo::ResolutionList() const
       
  1376     {
       
  1377     return iResList;
       
  1378     }
       
  1379 
       
  1380 // --------------------------------------------------------------------
       
  1381 // CCameraInfo::MimeTypesList()
       
  1382 // Gives a list containing supported mime types
       
  1383 // --------------------------------------------------------------------
       
  1384 //
       
  1385 EXPORT_C CStringList* CCameraInfo::MimeTypesList() const
       
  1386     {
       
  1387     return iMimeTypesList;
       
  1388     }
  1202 	
  1389 	
  1203 // End of file.		
  1390 // End of file.