internetradio2.0/presetplugininc/irpreset.h
changeset 14 896e9dbc5f19
parent 12 608f67c22514
child 15 065198191975
equal deleted inserted replaced
12:608f67c22514 14:896e9dbc5f19
     1 /*
       
     2 * Copyright (c) 2006-2008 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:  ?Description
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef IRPRESET_H
       
    20 #define IRPRESET_H
       
    21 
       
    22 #include <badesca.h>
       
    23 
       
    24 #include "pspresetinterface.h"
       
    25 
       
    26 class CIRIsdsPreset;
       
    27 class CIRChannelServerUrl;
       
    28 
       
    29 const TUid KIRPreset = { 0x10009DC1 };
       
    30 
       
    31 /**
       
    32  *preset abstract class to expose general apis to the app
       
    33  *it is the base class for IRPresetImpl,which is a plugin
       
    34  *the plugin implements all the pure virtual functions
       
    35 */
       
    36 class CIRPreset:public CPSPresetInterface
       
    37 	{
       
    38 
       
    39 public:
       
    40 
       
    41 	/**
       
    42 	*CIRPreset::SetId()
       
    43 	*sets id
       
    44 	*@param TDesC,supplied by xml parser
       
    45 	*/
       
    46 	virtual void SetId(const TDesC &aId)=0;
       
    47 
       
    48 	/**
       
    49 	*CIRPreset::SetId()
       
    50 	*sets id
       
    51 	*@param TInt,provided to manipulate the id number
       
    52 	*/
       
    53 	virtual void SetId(TInt aId)=0;
       
    54 
       
    55 
       
    56 	/**
       
    57 	*CIRPreset::SetLangInfo()
       
    58 	*sets the preset language name and the code
       
    59 	*@param TdesC,TdesC language id and name to be set
       
    60 	*/
       
    61 	virtual void SetLangInfo(const TDesC &aLangId,const TDesC& aLangName)=0;
       
    62 
       
    63 	/**
       
    64 	*CIRPreset::SetCountryInfo()
       
    65 	*sets the preset country name and the code
       
    66 	*@param TdesC,TdesC country id and country name to be set
       
    67 	*/
       
    68 	virtual void SetCountryInfo(const TDesC &aCountryId,
       
    69 		const TDesC& aCountryName)=0;
       
    70 
       
    71 	/**
       
    72 	*CIRPreset::SetLangCode()
       
    73 	*sets the language code
       
    74 	*@param TdesC language code
       
    75 	*/
       
    76 	virtual void SetLangCode(const TDesC &aLangId)=0;
       
    77 
       
    78 	/**
       
    79 	*CIRPreset::SetLang()
       
    80 	*sets the language
       
    81 	*@param TdesC language
       
    82 	*/
       
    83 	virtual void SetLang(const TDesC& aLangName)=0;
       
    84 
       
    85 	/**
       
    86 	*CIRPreset::SetCountryCode()
       
    87 	*sets the language code
       
    88 	*@param TdesC language code
       
    89 	*/
       
    90 	virtual void SetCountryCode(const TDesC &aCountryId)=0;
       
    91 
       
    92 	/**
       
    93 	*CIRPreset::SetCountryName()
       
    94 	*sets the language name
       
    95 	*@param TdesC language name
       
    96 	*/
       
    97 	virtual void SetCountryName(const TDesC& aCountryName)=0;
       
    98 
       
    99 	/**
       
   100 	*CIRPreset::SetLastModifiedTime()
       
   101 	*gets the channel  url at a particular index
       
   102 	*@param TDesC,time stamp
       
   103 	*/
       
   104 	virtual void SetLastModifiedTime(const TDesC &aLastModified)=0;
       
   105 
       
   106 	/**
       
   107 	*CIRPreset::SetGenreInfo()
       
   108 	*sets the genreid and name
       
   109 	*@param aGenreId
       
   110 	*@param aGenreName
       
   111 	*/
       
   112 	virtual void SetGenreInfo(const TDesC& aGenreId,
       
   113 		const TDesC& aGenreName)=0;
       
   114 
       
   115 	/**
       
   116 	*CIRPreset::SetImgUrl()
       
   117 	*sets the image url
       
   118 	*@param aImgUrl
       
   119 	*/
       
   120 	virtual void SetImgUrl(const TDesC& aImgUrl)=0;
       
   121 
       
   122 	/**
       
   123 	*CIRPreset::SetAdvertisementInUse()
       
   124 	*sets the advertisementinuse url
       
   125 	*@param aAdvertisementInUse
       
   126 	*/
       
   127 	virtual void SetAdvertisementInUse(const TDesC& aAdvertisementInUse)=0;
       
   128 
       
   129 	/**
       
   130 	*CIRPreset::SetDescription()
       
   131 	*sets the description for the channel
       
   132 	*@param aDescription
       
   133 	*/
       
   134 	virtual void SetDescription(const TDesC& aDescription)=0;
       
   135 
       
   136 	/**
       
   137 	*CIRPreset::SetAdvertisementUrl()
       
   138 	*sets the advertisement url
       
   139 	*@param aAdvertisementUrl
       
   140 	*/
       
   141 	virtual void SetAdvertisementUrl(const TDesC& aAdvertisementUrl)=0;
       
   142 
       
   143 	/**
       
   144 	*CIRPreset::SetUrlCount()
       
   145 	*sets the count of the number of urls
       
   146 	*/
       
   147 	virtual void SetUrlCount()=0;
       
   148 
       
   149 	/**
       
   150 	*CIRPreset::SetShortDesc()
       
   151 	*sets the short description
       
   152 	*@param aShortDesc
       
   153 	*/
       
   154 	virtual void SetShortDesc(const TDesC& aShortDesc)=0;
       
   155 
       
   156 
       
   157 	/**
       
   158 	*CIRPreset::SetMusicStoreStatus()
       
   159 	*sets the musicStoreEnabled flag
       
   160 	*@param aMusicStoreStatus
       
   161 	*/
       
   162 	virtual void SetMusicStoreStatus(const TDesC& aMusicStoreStatus)=0;
       
   163 
       
   164 
       
   165 	/**
       
   166 	*CIRPreset::SetUrlCount()
       
   167 	*sets the count of the number of urls
       
   168 	*@param aCnt ,count
       
   169 	*/
       
   170 	virtual void SetUrlCount(TInt aCnt)=0;
       
   171 
       
   172 	/**
       
   173 	*CIRPreset::SetIndex()
       
   174 	*sets the index for the preset.used only for presets in the fav list
       
   175 	*@param aInt
       
   176 	*/
       
   177 	//not required
       
   178 	//virtual void SetIndex(TInt aInt)=0
       
   179 
       
   180 	/**
       
   181 	*CIRPreset::SetUrlL()
       
   182 	*sets the channel server url
       
   183 	*@param aServerName ,server name
       
   184 	*@param aUrl ,server url
       
   185 	*@param aBitrate .server bitrate
       
   186 	*/
       
   187 	virtual void SetUrlL(const TDesC &aServerName,const TDesC &aUrl,
       
   188 		const TDesC &aBitrate)=0;
       
   189 
       
   190 	/**
       
   191 	*CIRPreset::SetUrlL()
       
   192 	*sets the channel server url
       
   193 	*@param aServerName ,server name
       
   194 	*@param aUrl ,server url
       
   195 	*@param aBitrate ,server bitrate
       
   196 	*/
       
   197 	virtual void SetUrlL(const TDesC &aServerName,const TDesC &aUrl,
       
   198 		TInt aBitrate)=0;
       
   199 
       
   200 	/**
       
   201 	*CIRPreset::SetChannelType()
       
   202 	*sets the channel type
       
   203 	*@param aChannelType userdefined,isds,adhoc
       
   204 	*/
       
   205 	virtual void SetChannelType(TInt aChannelType)=0;
       
   206 
       
   207 	/**
       
   208 	*CIRPreset::GetId()
       
   209 	*gets the channel id
       
   210 	*@return TInt
       
   211 	*/
       
   212 	virtual TInt GetId()const=0;
       
   213 
       
   214 	/**
       
   215 	*CIRPreset::GetLangId()
       
   216 	*gets the channel channelangid
       
   217 	*@return TDesC
       
   218 	*/
       
   219 	virtual const TDesC& GetLangId() const=0;
       
   220 
       
   221 	/**
       
   222 	*CIRPreset::GetLangName()
       
   223 	*gets the channel language name
       
   224 	*@return TDesC
       
   225 	*/
       
   226 	virtual const TDesC& GetLangName() const=0;
       
   227 
       
   228 	/**
       
   229 	*CIRPreset::GetCountryId()
       
   230 	*gets the channel countryid
       
   231 	*@return TDesC
       
   232 	*/
       
   233 	virtual const TDesC& GetCountryId() const=0;
       
   234 
       
   235 	/**
       
   236 	*CIRPreset::GetCountryName()
       
   237 	*gets the channel country name
       
   238 	*@return TDesC
       
   239 	*/
       
   240 	virtual const TDesC& GetCountryName() const=0;
       
   241 
       
   242 	/**
       
   243 	*CIRPreset::GetLastModifiedTime()
       
   244 	*gets the channel last modified time stamp
       
   245 	*@return TDesC
       
   246 	*/
       
   247 	virtual const TDesC& GetLastModifiedTime() const=0;
       
   248 
       
   249 	/**
       
   250 	*CIRPreset::GetDescription()
       
   251 	*gets the channel description
       
   252 	*@return TDesC
       
   253 	*/
       
   254 	virtual const TDesC& GetDescription() const=0;
       
   255 
       
   256 	/**
       
   257 	*CIRPreset::GetShortDescription()
       
   258 	*gets the channel  short description
       
   259 	*@return TDesC
       
   260 	*/
       
   261 	virtual const TDesC& GetShortDescription() const=0;
       
   262 
       
   263 
       
   264 	/**
       
   265 	*CIRPreset::GetMusicStoreStatus()
       
   266 	*gets the channel  musicStoreEnabled flag
       
   267 	*@return TDesC
       
   268 	*/
       
   269 	virtual const TDesC& GetMusicStoreStatus() const=0;
       
   270 
       
   271 
       
   272     /**
       
   273     *CIRPreset::GetChannelType()
       
   274 	*gets the channel  Type
       
   275 	*@return TInt
       
   276 	*/
       
   277 	virtual TInt GetChannelType()const=0;
       
   278 
       
   279 	/**
       
   280 	*CIRPreset::GetGenreId()
       
   281 	*gets the channel  genreid
       
   282 	*@return TDesC
       
   283 	*/
       
   284 	virtual const TDesC& GetGenreId() const=0;
       
   285 
       
   286 	/**
       
   287 	*CIRPreset::GetGenreName()
       
   288 	*gets the channel  genre name
       
   289 	*@return TDesC
       
   290 	*/
       
   291 	virtual const TDesC& GetGenreName() const=0;
       
   292 
       
   293 	/**
       
   294 	*CIRPreset::GetAdvertisementUrl()
       
   295 	*gets the channel  advertisement url
       
   296 	*@return TDesC
       
   297 	*/
       
   298 	virtual const TDesC& GetAdvertisementUrl() const=0;
       
   299 
       
   300     /**
       
   301     *CIRPreset::GetAdvertisementInUse()
       
   302     *gets the channel  advertisement In Use
       
   303     *@return TDesC
       
   304     */
       
   305     virtual const TDesC& GetAdvertisementInUse() const = 0;
       
   306 	
       
   307 	/**
       
   308 	*CIRPreset::GetImgUrl()
       
   309 	*gets the channel  image url
       
   310 	*@return TDesC
       
   311 	*/
       
   312 	virtual const TDesC& GetImgUrl()const=0;
       
   313 
       
   314     /**
       
   315     *CIRPreset::GetUrlCount()
       
   316 	*gets the channel  url count
       
   317 	*@return TDesC
       
   318 	*/
       
   319 	virtual TInt GetUrlCount()const=0;
       
   320 
       
   321 	virtual CIRChannelServerUrl& GetUrl(TInt aIndex) const = 0;
       
   322 	
       
   323 	/*
       
   324 	 * get the channel url at specified position
       
   325 	 *
       
   326 	 */
       
   327 	virtual const TDesC& GetChannelUrlAt(TInt aIndex) const = 0;
       
   328 	
       
   329 	/**
       
   330 	*CIRPreset::GetAvailableBitrates()
       
   331 	*gets the bitrate array
       
   332 	*@return RArray<TInt>
       
   333 	*/
       
   334     virtual RArray<TInt>& GetAvailableBitrates()=0;
       
   335 
       
   336 	/**
       
   337  	*void CIRPresetImpl::CIRIsdsPresetToCIRPresetImpl(const CIRIsdsPreset& aIsdsPreset)
       
   338  	*used to convert the isdspresets to plugnized presets.
       
   339  	*Does a deep copy for all the member variables
       
   340  	*@param CIRIsdsPreset&,the preset to be copied from
       
   341 	*/
       
   342     virtual void CIRIsdsPresetToCIRPresetImpl(const CIRIsdsPreset& aIsdsPreset)=0;
       
   343 
       
   344 	/**
       
   345 	*CIRPreset::CopyPresetData()
       
   346 	*copy data to CIRIsdsPreset
       
   347 	*@param CIRIsdsPreset&,the preset to be copied into
       
   348 	*/
       
   349 	virtual void CopyPresetData(CIRIsdsPreset& aIsdsPreset) const =0;
       
   350 
       
   351 	 /**
       
   352      * Sets the logo data for this preset for a specific size.
       
   353      *
       
   354      * @param   aData           Raw image data to set.
       
   355      * @param   aSize           Size of the logo in pixels.
       
   356      */
       
   357     virtual void SetLogoData( const TDesC8& aData ) = 0;
       
   358 
       
   359     /**
       
   360      * Returns the logo data for this preset.
       
   361      *
       
   362      * If the returned descriptor's length is zero, then it means
       
   363      * that the preset does not have a logo.
       
   364      */
       
   365     virtual  const TDesC8& GetLogoData() const = 0;
       
   366 
       
   367     /*
       
   368      * Returns the played times of the channel
       
   369      */
       
   370     virtual TInt GetPlayedTimes() const = 0;
       
   371     
       
   372     /*
       
   373      * Set the played times of the channel
       
   374      */
       
   375     virtual void SetPlayedTimes(TInt aPlayedTimes) = 0;
       
   376     
       
   377     virtual TBool GetRenamed() const = 0;
       
   378     
       
   379     virtual void SetRenamed() = 0;
       
   380 	};
       
   381 
       
   382 #endif	//end of IRPRESET_H