1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/security/contentmgmt/contentaccessfwfordrm/source/caf/Agentfactory.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,185 @@
1.4 +/*
1.5 +* Copyright (c) 2004-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 "Eclipse Public License v1.0"
1.9 +* which accompanies this distribution, and is available
1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.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 +
1.21 +
1.22 +
1.23 +#include <ecom/ecom.h>
1.24 +#include <caf/agentfactory.h>
1.25 +#include <caf/agentinterface.h>
1.26 +#include <caf/caferr.h>
1.27 +
1.28 +using namespace ContentAccess;
1.29 +
1.30 +
1.31 +CAgentFactory* CAgentFactory::NewL(TUid aUid)
1.32 + {
1.33 + return static_cast<CAgentFactory*> (REComSession::CreateImplementationL(aUid, _FOFF(CAgentFactory,iEcomKey)));
1.34 + }
1.35 +
1.36 +
1.37 +EXPORT_C CAgentFactory::~CAgentFactory()
1.38 + {
1.39 + // Finished with ECOM session so destroy implementation pointer
1.40 + // iEcomKey was set by ECOM during construction
1.41 + // This may cause the agent DLL to unload
1.42 + REComSession::DestroyedImplementation(iEcomKey);
1.43 + }
1.44 +
1.45 +
1.46 +// default implementations
1.47 +
1.48 +EXPORT_C TInt CAgentManager::RenameDir(const TDesC& /*aOldName*/, const TDesC& /* aNewName */)
1.49 + {
1.50 + return KErrCANotSupported;
1.51 + }
1.52 +
1.53 +EXPORT_C void CAgentImportFile::Cancel()
1.54 + {
1.55 + // default implementation does nothing
1.56 + }
1.57 +EXPORT_C TBool CAgentImportFile::ContentMimeTypeL(TDes8& /*aContentMime*/)
1.58 + {
1.59 + User::Leave(KErrCANotSupported);
1.60 + return EFalse;
1.61 + }
1.62 +EXPORT_C TInt CAgentManager::CopyFile(RFile& /* aSource */, const TDesC& /* aDestination */)
1.63 + {
1.64 + return KErrCANotSupported;
1.65 + }
1.66 +
1.67 +EXPORT_C TInt CAgentData::Read(TInt /* aPos */, TDes8& /* aDes */, TInt /* aLength */, TRequestStatus& /* aStatus */)
1.68 + {
1.69 + return KErrCANotSupported;
1.70 + }
1.71 +
1.72 +#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
1.73 +EXPORT_C TInt CAgentData::Read64(TInt64 /* aPos */, TDes8& /* aDes */, TInt /* aLength */, TRequestStatus& /* aStatus */)
1.74 + {
1.75 + return KErrCANotSupported;
1.76 + }
1.77 +
1.78 +EXPORT_C void CAgentData::DataSize64L(TInt64& /*aSize*/)
1.79 + {
1.80 + User::Leave(KErrCANotSupported);
1.81 + }
1.82 +
1.83 +EXPORT_C TInt CAgentData::Seek64(TSeek /*aMode*/, TInt64& /*aPos*/)
1.84 + {
1.85 + return KErrCANotSupported;
1.86 + }
1.87 +#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
1.88 +
1.89 +EXPORT_C void CAgentData::ReadCancel(TRequestStatus&)
1.90 + {
1.91 + }
1.92 +
1.93 +EXPORT_C void CAgentRightsManager::ListRightsL(RStreamablePtrArray<CRightsInfo>& /* aArray */, RFile& /* aFile */, const TDesC& /* aUniqueId */) const
1.94 + {
1.95 + User::Leave(KErrCANotSupported);
1.96 + }
1.97 +
1.98 +EXPORT_C TInt CAgentRightsManager::DeleteAllRightsObjects (RFile& /* aFile */, const TDesC& /* aUniqueId */)
1.99 + {
1.100 + return KErrCANotSupported;
1.101 + }
1.102 +
1.103 +EXPORT_C TInt CAgentManager::GetAttribute(TInt /* aAttribute */, TInt& /* aValue */, RFile& /* aFile */, const TDesC& /* aUniqueId */)
1.104 + {
1.105 + return KErrCANotSupported;
1.106 + }
1.107 +
1.108 +EXPORT_C TInt CAgentManager::GetAttributeSet(RAttributeSet& /* aAttributeSet */, RFile& /* aFile */, const TDesC& /* aUniqueId */)
1.109 + {
1.110 + return KErrCANotSupported;
1.111 + }
1.112 +
1.113 +EXPORT_C TInt CAgentManager::GetStringAttribute(TInt /* aAttribute */, TDes& /* aValue */, RFile& /* aFile */, const TDesC& /* aUniqueId */)
1.114 + {
1.115 + return KErrCANotSupported;
1.116 + }
1.117 +
1.118 +EXPORT_C TInt CAgentManager::GetStringAttributeSet(RStringAttributeSet& /* aStringAttributeSet */, RFile& /* aFile */, const TDesC& /* aUniqueId */)
1.119 + {
1.120 + return KErrCANotSupported;
1.121 + }
1.122 +
1.123 +EXPORT_C void CAgentManager::DisplayInfoL (TDisplayInfo /* aInfo */, RFile& /* aFile */, const TDesC& /* aUniqueId */)
1.124 + {
1.125 + User::Leave(KErrCANotSupported);
1.126 + }
1.127 +
1.128 +#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
1.129 +
1.130 +EXPORT_C TInt CAgentData::Read(const TDesC8& /*aEncryptedInputDataPacket*/, TDes8& /*aDecryptedOutputDataPacket*/)
1.131 + {
1.132 + return KErrCANotSupported;
1.133 + }
1.134 +
1.135 +EXPORT_C void CAgentData::Read(const TDesC8& /*aEncryptedInputDataPacket*/, TDes8& /*aDecryptedOutputDataPacket*/, TRequestStatus& aStatus)
1.136 + {
1.137 + TRequestStatus* status = &aStatus;
1.138 + User::RequestComplete(status, KErrCANotSupported);
1.139 + }
1.140 +
1.141 +EXPORT_C TBool CAgentManager::IsRecognizedL(const TDesC8& /*aHeaderData*/) const
1.142 + {
1.143 + return EFalse;
1.144 + }
1.145 +
1.146 +EXPORT_C TBool CAgentManager::RecognizeContentL(const TDesC8& /*aHeaderData*/, TDes8& aFileMimeType, TDes8& aContentMimeType) const
1.147 + {
1.148 + aFileMimeType.Copy(KNullDesC8());
1.149 + aContentMimeType.Copy(KNullDesC8());
1.150 + return EFalse;
1.151 + }
1.152 +
1.153 +EXPORT_C TInt CAgentManager::GetAttribute(const TDesC8& /*aHeaderData*/, TInt /*aAttribute*/, TInt& /*aValue*/)
1.154 + {
1.155 + return KErrCANotSupported;
1.156 + }
1.157 +
1.158 +EXPORT_C TInt CAgentManager::GetAttributeSet(const TDesC8& /*aHeaderData*/, RAttributeSet& /*aAttributeSet*/)
1.159 + {
1.160 + return KErrCANotSupported;
1.161 + }
1.162 +
1.163 +EXPORT_C TInt CAgentManager::GetStringAttribute(const TDesC8& /*aHeaderData*/, TInt /*aAttribute*/, TDes& /*aValue*/)
1.164 + {
1.165 + return KErrCANotSupported;
1.166 + }
1.167 +
1.168 +EXPORT_C TInt CAgentManager::GetStringAttributeSet(const TDesC8& /*aHeaderData*/, RStringAttributeSet& /*aStringAttributeSet*/)
1.169 + {
1.170 + return KErrCANotSupported;
1.171 + }
1.172 +
1.173 +EXPORT_C CAgentData* CAgentFactory::CreateDataConsumerL(const TDesC8& /*aHeaderData*/)
1.174 + {
1.175 + User::Leave(KErrCANotSupported);
1.176 + // cannot reach here. The return statement is added to avoid warning.
1.177 + return NULL;
1.178 + }
1.179 +
1.180 +EXPORT_C CAgentContent* CAgentFactory::CreateContentBrowserL(const TDesC8& /*aHeaderData*/)
1.181 + {
1.182 + User::Leave(KErrCANotSupported);
1.183 + // cannot be reach here . The return statement is added to avoid warning.
1.184 + return NULL;
1.185 + }
1.186 +
1.187 +
1.188 +#endif //#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT