engine/src/FeedInfo.cpp
author Lars Persson <lars.persson@embeddev.se>
Wed, 31 Mar 2010 08:19:35 +0200
changeset 91 87cb33beeae2
parent 32 26a3f2dfba08
child 92 dc142c8740eb
permissions -rw-r--r--
Remove icon index. Start caching icons as mbms.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
     1
/*
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
     2
* Copyright (c) 2007-2010 Sebastian Brannstrom, Lars Persson, EmbedDev AB
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
     3
*
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
     4
* All rights reserved.
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
     5
* This component and the accompanying materials are made available
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
     6
* under the terms of the License "Eclipse Public License v1.0"
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
     7
* which accompanies this distribution, and is available
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
     8
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
     9
*
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    10
* Initial Contributors:
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    11
* EmbedDev AB - initial contribution.
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    12
*
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    13
* Contributors:
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    14
*
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    15
* Description:
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    16
*
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    17
*/
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    18
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    19
#include "FeedInfo.h"
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    20
#include <e32hashtab.h>
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    21
#include <fbs.h>
91
87cb33beeae2 Remove icon index. Start caching icons as mbms.
Lars Persson <lars.persson@embeddev.se>
parents: 32
diff changeset
    22
#include <bautils.h>
87cb33beeae2 Remove icon index. Start caching icons as mbms.
Lars Persson <lars.persson@embeddev.se>
parents: 32
diff changeset
    23
#include <eikenv.h>
87cb33beeae2 Remove icon index. Start caching icons as mbms.
Lars Persson <lars.persson@embeddev.se>
parents: 32
diff changeset
    24
_LIT(KMbmExtension, ".mbm");
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    25
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    26
EXPORT_C CFeedInfo* CFeedInfo::NewL()
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    27
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    28
	CFeedInfo* self = new (ELeave) CFeedInfo();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    29
	CleanupStack::PushL(self);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    30
	self->ConstructL();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    31
	CleanupStack::Pop();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    32
	return self;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    33
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    34
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    35
EXPORT_C CFeedInfo* CFeedInfo::NewLC()
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    36
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    37
	CFeedInfo* self = new (ELeave) CFeedInfo();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    38
	CleanupStack::PushL(self);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    39
	self->ConstructL();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    40
	return self;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    41
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    42
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    43
EXPORT_C CFeedInfo* CFeedInfo::CopyL() const
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    44
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    45
	CFeedInfo* copy = CFeedInfo::NewLC();	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    46
	copy->SetUrlL(Url());
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    47
	copy->SetTitleL(Title());
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    48
	copy->SetDescriptionL(Description());
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    49
	copy->SetImageUrlL(ImageUrl());
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    50
	copy->SetLinkL(Link());
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    51
	copy->SetBuildDate(BuildDate());
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    52
	copy->SetLastUpdated(LastUpdated());
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    53
	copy->SetImageFileNameL(ImageFileName());
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    54
	copy->iFeedIcon->Duplicate(iFeedIcon->Handle());
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    55
	if(CustomTitle())
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    56
		{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    57
		copy->SetCustomTitle();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    58
		}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    59
	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    60
	copy->SetLastError(LastError());
91
87cb33beeae2 Remove icon index. Start caching icons as mbms.
Lars Persson <lars.persson@embeddev.se>
parents: 32
diff changeset
    61
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    62
	CleanupStack::Pop(copy);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    63
	return copy;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    64
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    65
CFeedInfo::CFeedInfo()
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    66
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    67
	iCustomTitle = EFalse;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    68
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    69
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    70
EXPORT_C CFeedInfo::~CFeedInfo()
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    71
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    72
	delete iUrl;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    73
	delete iTitle;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    74
	delete iDescription;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    75
	delete iImageUrl;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    76
	delete iImageFileName;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    77
	delete iLink;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    78
	delete iFeedIcon;	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    79
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    80
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    81
void CFeedInfo::ConstructL()
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    82
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    83
	iFeedIcon = new (ELeave) CFbsBitmap;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    84
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    85
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    86
EXPORT_C const TDesC& CFeedInfo::Url() const
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    87
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    88
	return iUrl ? *iUrl : KNullDesC();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    89
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    90
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    91
EXPORT_C void CFeedInfo::SetUrlL(const TDesC &aUrl) 
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    92
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    93
	if (iUrl)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    94
		{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    95
		delete iUrl;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    96
		iUrl = NULL;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    97
		}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    98
		
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    99
	iUrl = aUrl.AllocL();		
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   100
	iUid = DefaultHash::Des16(Url());
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   101
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   102
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   103
EXPORT_C const TDesC& CFeedInfo::Title() const
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   104
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   105
	return iTitle ? *iTitle : KNullDesC();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   106
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   107
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   108
EXPORT_C void CFeedInfo::SetTitleL(const TDesC &aTitle)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   109
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   110
	if(iTitle)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   111
		{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   112
		delete iTitle;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   113
		iTitle = NULL;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   114
		}		
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   115
	iTitle = aTitle.AllocL();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   116
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   117
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   118
EXPORT_C const TDesC& CFeedInfo::Description() const
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   119
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   120
	return iDescription ? *iDescription : KNullDesC();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   121
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   122
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   123
EXPORT_C void CFeedInfo::SetDescriptionL(const TDesC &aDescription)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   124
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   125
	if (iDescription)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   126
		{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   127
		delete iDescription;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   128
		iDescription = NULL;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   129
		}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   130
	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   131
	iDescription = aDescription.AllocL(); 
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   132
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   133
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   134
EXPORT_C const TDesC& CFeedInfo::ImageUrl() const
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   135
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   136
	return iImageUrl ? *iImageUrl : KNullDesC();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   137
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   138
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   139
EXPORT_C void CFeedInfo::SetImageUrlL(const TDesC &aImageUrl)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   140
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   141
	if (iImageUrl)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   142
		{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   143
		delete iImageUrl;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   144
		iImageUrl = NULL;	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   145
		}	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   146
	iImageUrl = aImageUrl.AllocL();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   147
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   148
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   149
EXPORT_C const TDesC& CFeedInfo::Link() const
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   150
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   151
	return iLink ? *iLink : KNullDesC();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   152
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   153
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   154
EXPORT_C void CFeedInfo::SetLinkL(const TDesC& aLink)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   155
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   156
	if (iLink)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   157
		{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   158
		delete iLink;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   159
		iLink = NULL;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   160
		}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   161
	iLink = aLink.AllocL();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   162
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   163
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   164
EXPORT_C TTime CFeedInfo::BuildDate() const
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   165
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   166
	return iBuildDate;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   167
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   168
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   169
EXPORT_C void CFeedInfo::SetBuildDate(TTime aBuildDate)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   170
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   171
	iBuildDate = aBuildDate;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   172
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   173
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   174
EXPORT_C TTime CFeedInfo::LastUpdated() const
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   175
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   176
	return iLastUpdated;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   177
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   178
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   179
EXPORT_C void CFeedInfo::SetLastUpdated(TTime aUpdated)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   180
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   181
	iLastUpdated = aUpdated;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   182
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   183
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   184
EXPORT_C TUint CFeedInfo::Uid() const
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   185
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   186
	return iUid;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   187
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   188
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   189
EXPORT_C const TDesC& CFeedInfo::ImageFileName() const
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   190
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   191
	return iImageFileName ? *iImageFileName : KNullDesC();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   192
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   193
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   194
EXPORT_C void CFeedInfo::SetImageFileNameL(const TDesC& aFileName)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   195
	{
91
87cb33beeae2 Remove icon index. Start caching icons as mbms.
Lars Persson <lars.persson@embeddev.se>
parents: 32
diff changeset
   196
	TFileName cacheFileName;
87cb33beeae2 Remove icon index. Start caching icons as mbms.
Lars Persson <lars.persson@embeddev.se>
parents: 32
diff changeset
   197
	
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   198
	if (iImageFileName)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   199
		{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   200
		delete iImageFileName;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   201
		iImageFileName = NULL;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   202
		}
91
87cb33beeae2 Remove icon index. Start caching icons as mbms.
Lars Persson <lars.persson@embeddev.se>
parents: 32
diff changeset
   203
	iImageFileName = aFileName.AllocL();
87cb33beeae2 Remove icon index. Start caching icons as mbms.
Lars Persson <lars.persson@embeddev.se>
parents: 32
diff changeset
   204
	TParsePtrC parser(*iImageFileName);
87cb33beeae2 Remove icon index. Start caching icons as mbms.
Lars Persson <lars.persson@embeddev.se>
parents: 32
diff changeset
   205
	cacheFileName = parser.DriveAndPath();
87cb33beeae2 Remove icon index. Start caching icons as mbms.
Lars Persson <lars.persson@embeddev.se>
parents: 32
diff changeset
   206
	cacheFileName.Append(parser.Name());
87cb33beeae2 Remove icon index. Start caching icons as mbms.
Lars Persson <lars.persson@embeddev.se>
parents: 32
diff changeset
   207
	cacheFileName.Append(KMbmExtension());
87cb33beeae2 Remove icon index. Start caching icons as mbms.
Lars Persson <lars.persson@embeddev.se>
parents: 32
diff changeset
   208
	if( BaflUtils::FileExists(CEikonEnv::Static()->FsSession(), cacheFileName) )
87cb33beeae2 Remove icon index. Start caching icons as mbms.
Lars Persson <lars.persson@embeddev.se>
parents: 32
diff changeset
   209
		{
87cb33beeae2 Remove icon index. Start caching icons as mbms.
Lars Persson <lars.persson@embeddev.se>
parents: 32
diff changeset
   210
		iFeedIcon = CEikonEnv::Static()->CreateBitmapL(cacheFileName, 0);
87cb33beeae2 Remove icon index. Start caching icons as mbms.
Lars Persson <lars.persson@embeddev.se>
parents: 32
diff changeset
   211
		}	
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   212
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   213
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   214
EXPORT_C TBool CFeedInfo::CustomTitle() const
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   215
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   216
	return iCustomTitle;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   217
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   218
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   219
EXPORT_C void CFeedInfo::SetCustomTitle()
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   220
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   221
	iCustomTitle = ETrue;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   222
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   223
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   224
EXPORT_C void CFeedInfo::SetLastError(TInt aLastError)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   225
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   226
	iLastError = aLastError;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   227
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   228
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   229
EXPORT_C TInt CFeedInfo::LastError() const
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   230
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   231
	return iLastError;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   232
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   233
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   234
EXPORT_C CFbsBitmap* CFeedInfo::FeedIcon() const
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   235
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   236
	return iFeedIcon;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   237
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   238
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   239
EXPORT_C void CFeedInfo::SetFeedIcon(CFbsBitmap* aBitmapToClone)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   240
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   241
	iFeedIcon->Duplicate(aBitmapToClone->Handle());
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   242
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   243
91
87cb33beeae2 Remove icon index. Start caching icons as mbms.
Lars Persson <lars.persson@embeddev.se>
parents: 32
diff changeset
   244
void CFeedInfo::ImageOperationCompleteL(TInt aError, TUint /*aHandle*/)
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   245
	{
91
87cb33beeae2 Remove icon index. Start caching icons as mbms.
Lars Persson <lars.persson@embeddev.se>
parents: 32
diff changeset
   246
		
87cb33beeae2 Remove icon index. Start caching icons as mbms.
Lars Persson <lars.persson@embeddev.se>
parents: 32
diff changeset
   247
	if (aError == KErrNone && iImageFileName && iFeedIcon)
87cb33beeae2 Remove icon index. Start caching icons as mbms.
Lars Persson <lars.persson@embeddev.se>
parents: 32
diff changeset
   248
		{
87cb33beeae2 Remove icon index. Start caching icons as mbms.
Lars Persson <lars.persson@embeddev.se>
parents: 32
diff changeset
   249
		TFileName cacheFileName;
87cb33beeae2 Remove icon index. Start caching icons as mbms.
Lars Persson <lars.persson@embeddev.se>
parents: 32
diff changeset
   250
	
87cb33beeae2 Remove icon index. Start caching icons as mbms.
Lars Persson <lars.persson@embeddev.se>
parents: 32
diff changeset
   251
		TParsePtrC parser(*iImageFileName);
87cb33beeae2 Remove icon index. Start caching icons as mbms.
Lars Persson <lars.persson@embeddev.se>
parents: 32
diff changeset
   252
		cacheFileName = parser.DriveAndPath();
87cb33beeae2 Remove icon index. Start caching icons as mbms.
Lars Persson <lars.persson@embeddev.se>
parents: 32
diff changeset
   253
		cacheFileName.Append(parser.Name());
87cb33beeae2 Remove icon index. Start caching icons as mbms.
Lars Persson <lars.persson@embeddev.se>
parents: 32
diff changeset
   254
		cacheFileName.Append(KMbmExtension());
87cb33beeae2 Remove icon index. Start caching icons as mbms.
Lars Persson <lars.persson@embeddev.se>
parents: 32
diff changeset
   255
		if( !BaflUtils::FileExists(CEikonEnv::Static()->FsSession(), cacheFileName) )
87cb33beeae2 Remove icon index. Start caching icons as mbms.
Lars Persson <lars.persson@embeddev.se>
parents: 32
diff changeset
   256
			{
87cb33beeae2 Remove icon index. Start caching icons as mbms.
Lars Persson <lars.persson@embeddev.se>
parents: 32
diff changeset
   257
			iFeedIcon->Save(cacheFileName);
87cb33beeae2 Remove icon index. Start caching icons as mbms.
Lars Persson <lars.persson@embeddev.se>
parents: 32
diff changeset
   258
			}
87cb33beeae2 Remove icon index. Start caching icons as mbms.
Lars Persson <lars.persson@embeddev.se>
parents: 32
diff changeset
   259
			
87cb33beeae2 Remove icon index. Start caching icons as mbms.
Lars Persson <lars.persson@embeddev.se>
parents: 32
diff changeset
   260
		}
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   261
	}