1.1 --- a/epoc32/include/concnf.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/concnf.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,180 @@
1.4 -concnf.h
1.5 +// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +// All rights reserved.
1.7 +// This component and the accompanying materials are made available
1.8 +// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
1.9 +// which accompanies this distribution, and is available
1.10 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.11 +//
1.12 +// Initial Contributors:
1.13 +// Nokia Corporation - initial contribution.
1.14 +//
1.15 +// Contributors:
1.16 +//
1.17 +// Description:
1.18 +//
1.19 +
1.20 +#if !defined(__CONCNF_H__)
1.21 +#define __CONCNF_H__
1.22 +
1.23 +#include <e32base.h>
1.24 +#include <f32file.h>
1.25 +#include <s32stor.h>
1.26 +#include <apmstd.h>
1.27 +#include <barsc.h>
1.28 +#include <barsread.h>
1.29 +
1.30 +/**
1.31 +@publishedAll
1.32 +@released
1.33 +*/
1.34 +#define KMaxTranslation 50
1.35 +
1.36 +/** Buffer to contain a localised data type name.
1.37 +
1.38 +@publishedAll
1.39 +@released */
1.40 +typedef TBuf<KMaxTranslation> TTranslation;
1.41 +
1.42 +
1.43 +class TLanguageInfo
1.44 +/** Holds a localised name for a data type.
1.45 +
1.46 +@publishedAll
1.47 +@released */
1.48 + {
1.49 +public:
1.50 + TLanguageInfo();
1.51 + IMPORT_C TLanguageInfo(TLanguage aLanguage,TTranslation aTranslation);
1.52 +public:
1.53 + void InternalizeL(RReadStream& aStream);
1.54 + void ExternalizeL(RWriteStream& aStream) const;
1.55 + TLanguage Language();
1.56 + TTranslation Translation();
1.57 + void ReadFromResource(TResourceReader& aReader);
1.58 +public:
1.59 + TLanguage iLanguage;
1.60 + TTranslation iTranslation;
1.61 + };
1.62 +
1.63 +class CMimeInfo : public CBase
1.64 +/** Holds the localised names for a data type.
1.65 +
1.66 +@publishedAll
1.67 +@released */
1.68 + {
1.69 +public:
1.70 + IMPORT_C ~CMimeInfo();
1.71 + IMPORT_C static CMimeInfo* NewLC(TDataType& aMime);
1.72 + static CMimeInfo* NewL();
1.73 + static CMimeInfo* NewLC(const CMimeInfo* aInfo);
1.74 +public:
1.75 + void InternalizeL(RReadStream& aStream);
1.76 + void ExternalizeL(RWriteStream& aStream) const;
1.77 + TDataType Mime();
1.78 + TTranslation Text();
1.79 + IMPORT_C void AddLanguageL(TLanguageInfo aLang);
1.80 + static CMimeInfo* NewLC(TResourceReader& aReader);
1.81 +private:
1.82 + void ConstructL();
1.83 + void ConstructL(TResourceReader& aReader);
1.84 + void AddLanguageInfoL(TResourceReader& aReader);
1.85 +private:
1.86 + TDataType iMime;
1.87 + CArrayFixFlat<TLanguageInfo> *iLanguageInfo;
1.88 + };
1.89 +
1.90 +class CCnaConverter : public CBase
1.91 +/** Holds the inherent properties of a converter.
1.92 +
1.93 +These are its UID and the data types it supports.
1.94 +
1.95 +Note that the setter functions affect only the current object, not the stored
1.96 +information for the converter.
1.97 +
1.98 +@publishedAll
1.99 +@released */
1.100 + {
1.101 +public:
1.102 + static CCnaConverter* NewLC();
1.103 + static CCnaConverter* NewL();
1.104 + IMPORT_C static CCnaConverter* NewL(TUid aUid);
1.105 + IMPORT_C static CCnaConverter* NewLC(TUid aUid);
1.106 + IMPORT_C static CCnaConverter* NewL(const CCnaConverter& aConverter);
1.107 + IMPORT_C static CCnaConverter* NewLC(const CCnaConverter& aConverter);
1.108 + IMPORT_C ~CCnaConverter();
1.109 + IMPORT_C void SetUid(TUid aUid);
1.110 + IMPORT_C TBool MimeFrom(const TDataType& aMimeType) const;
1.111 + IMPORT_C TBool MimeTo(const TDataType& aMimeType) const;
1.112 + IMPORT_C TTranslation MimeFromText(const TDataType& aMimeType) const;
1.113 + IMPORT_C TTranslation MimeToText(const TDataType& aMimeType) const;
1.114 + IMPORT_C TInt CountFrom() const;
1.115 + IMPORT_C TInt CountTo() const;
1.116 + IMPORT_C TDataType MimeFrom(TInt aIndex) const;
1.117 + IMPORT_C TDataType MimeTo(TInt aIndex) const;
1.118 + IMPORT_C TTranslation MimeFromText(TInt aIndex) const;
1.119 + IMPORT_C TTranslation MimeToText(TInt aIndex) const;
1.120 + inline TUid Uid() const;
1.121 + static CCnaConverter* NewL(TUid aUid,TResourceReader& aReader);
1.122 +private:
1.123 + CCnaConverter();
1.124 + void ConstructL();
1.125 + TBool FindMime(const TDataType& aMimeType, const CArrayPtrFlat<CMimeInfo>* aList) const;
1.126 + TTranslation FindMimeText(const TDataType& aMimeType, const CArrayPtrFlat<CMimeInfo>* aList) const;
1.127 + void ConstructL(TUid aUid,TResourceReader& aReader);
1.128 + void AddMimeDataL(TResourceReader& aReader, CArrayPtrFlat<CMimeInfo>& aMimeInfo);
1.129 +private:
1.130 + TUid iUid;
1.131 + CArrayPtrFlat<CMimeInfo>* iMimeFrom;
1.132 + CArrayPtrFlat<CMimeInfo>* iMimeTo;
1.133 + };
1.134 +
1.135 +inline TUid CCnaConverter::Uid() const
1.136 +/** Gets the converter UID.
1.137 +
1.138 +@return Converter UID */
1.139 + {return iUid;}
1.140 +
1.141 +class CCnaConvInfoFile2 : public CBase
1.142 +/**
1.143 +implementation class
1.144 +@internalComponent
1.145 +*/
1.146 + {
1.147 +public:
1.148 + ~CCnaConvInfoFile2();
1.149 + //
1.150 +protected:
1.151 + void ConstructL();
1.152 +protected:
1.153 + RFs iFs;
1.154 + RResourceFile iResourceFile;
1.155 + CArrayPtr<CCnaConverter>* iConverters;
1.156 + };
1.157 +
1.158 +/** Encapsulates a collection of converter properties (CCnaConverter) read from a converter
1.159 +information (.rsc) file.
1.160 +
1.161 +@publishedAll
1.162 +@released
1.163 +*/
1.164 +// Each RSC file contains CCnaConverter information for each
1.165 +// available CConverterBase2 derived class in its associated DLL.
1.166 +
1.167 +// In addition there may be INI files for each converter which supply run time extended
1.168 +// CCnaConverter information such as additional mime types.
1.169 +class CCnaConvInfoFileReader2 : public CCnaConvInfoFile2
1.170 + {
1.171 +public:
1.172 + IMPORT_C static CCnaConvInfoFileReader2* NewLC(const TDesC& aFileName);
1.173 + IMPORT_C static CCnaConvInfoFileReader2* NewL(const TDesC& aFileName);
1.174 + IMPORT_C TInt Count();
1.175 + IMPORT_C CCnaConverter* AtL(TInt anIndex);
1.176 + //
1.177 + IMPORT_C void RestoreL();
1.178 +private:
1.179 + CCnaConvInfoFileReader2();
1.180 + void RestoreConverterL(TResourceReader& aReader);
1.181 + void ConstructL(const TDesC& aFileName);
1.182 + };
1.183 +
1.184 +#endif