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