engine/inc/PodcastUtils.h
author Sebastian Brannstrom <sebastianb@symbian.org>
Sat, 10 Jul 2010 13:35:21 +0100
branch3rded
changeset 176 1c8b56cb6409
parent 60 4d230e702aa3
child 279 5a44ec2f6f4d
permissions -rw-r--r--
Now compiles for 3rd ed, but does not launch due to malloc error in SQLite
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
#ifndef PODCASTUTILS_H_
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    20
#define PODCASTUTILS_H_
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    21
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    22
#include <e32cmn.h>
176
1c8b56cb6409 Now compiles for 3rd ed, but does not launch due to malloc error in SQLite
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 60
diff changeset
    23
#include "sqlite3.h"
60
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 15
diff changeset
    24
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 15
diff changeset
    25
// Cleanup stack macro for SQLite3
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 15
diff changeset
    26
static void Cleanup_sqlite3_finalize_wrapper(TAny* handle)
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 15
diff changeset
    27
	{
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 15
diff changeset
    28
	sqlite3_finalize(static_cast<sqlite3_stmt*>(handle));
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 15
diff changeset
    29
	}
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 15
diff changeset
    30
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 15
diff changeset
    31
#define Cleanup_sqlite3_finalize_PushL(__handle) CleanupStack::PushL(TCleanupItem(&Cleanup_sqlite3_finalize_wrapper, __handle))
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    32
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    33
_LIT(KURLPrefix, "http://");
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    34
_LIT(KItpcPrefix, "itpc://");
60
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 15
diff changeset
    35
_LIT(KPcastPrefix, "pcast://");
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 15
diff changeset
    36
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 15
diff changeset
    37
_LIT(KVideoFormat1, ".wmv");
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 15
diff changeset
    38
_LIT(KVideoFormat2, ".avi");
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 15
diff changeset
    39
_LIT(KVideoFormat3, ".mp4");
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 15
diff changeset
    40
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 15
diff changeset
    41
2
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
class PodcastUtils
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
public:
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    46
	IMPORT_C static void FixProtocolsL(TDes &aUrl);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    47
	IMPORT_C static void CleanHtmlL(TDes &str);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    48
	IMPORT_C static void ReplaceString(TDes & aString, const TDesC& aStringToReplace, const TDesC& aReplacement);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    49
	IMPORT_C static void ReplaceChar(TDes & aString, TUint aCharToReplace, TUint aReplacement);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    50
	IMPORT_C static void EnsureProperPathName(TFileName &aPath);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    51
	IMPORT_C static void FileNameFromUrl(const TDesC &aUrl, TFileName &aFileName);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    52
	IMPORT_C static void SQLEncode(TDes &aString);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    53
	IMPORT_C static void XMLEncode(TDes &aString);
15
93d9f66bf50b Cleaning description better for second line in search results
teknolog
parents: 2
diff changeset
    54
	IMPORT_C static void RemoveAllFormatting(TDes & aString);
60
4d230e702aa3 Moved development branch from MCL to FCL
teknolog
parents: 15
diff changeset
    55
	IMPORT_C static TBool IsVideoShow(TDesC &aUrl);
2
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
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    58
#endif /* PODCASTUTILS_H_ */