contentmgmt/contentaccessfwfordrm/source/f32agent/f32agentdata.cpp
changeset 8 35751d3474b7
parent 0 2c201484c85f
child 15 da2ae96f639b
equal deleted inserted replaced
2:675a964f4eb5 8:35751d3474b7
    17 
    17 
    18 
    18 
    19 #include <caf/caf.h>
    19 #include <caf/caf.h>
    20 #include "f32agentdata.h"
    20 #include "f32agentdata.h"
    21 #include "f32defaultattributes.h"
    21 #include "f32defaultattributes.h"
    22 #include "virtualpath.h"
    22 #include <caf/virtualpath.h>
    23 #include "f32agentui.h"
    23 #include <caf/f32agentui.h>
       
    24 #include <e32def.h>
    24 
    25 
    25 using namespace ContentAccess;
    26 using namespace ContentAccess;
    26 
    27 
    27 CF32AgentData* CF32AgentData::NewL(const TVirtualPathPtr& aVirtualPath, TContentShareMode aShareMode)
    28 CF32AgentData* CF32AgentData::NewL(const TVirtualPathPtr& aVirtualPath, TContentShareMode aShareMode)
    28 	{
    29 	{
    74 	User::LeaveIfError(iFile.Open(iFs, aVirtualPath.URI(), mode));
    75 	User::LeaveIfError(iFile.Open(iFs, aVirtualPath.URI(), mode));
    75 	}
    76 	}
    76 
    77 
    77 void CF32AgentData::ConstructL(RFile& aFile, const TDesC& aUniqueId)
    78 void CF32AgentData::ConstructL(RFile& aFile, const TDesC& aUniqueId)
    78 	{
    79 	{
       
    80 #ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API		
       
    81 	TInt64 pos = 0;
       
    82 #else
    79 	TInt pos = 0;
    83 	TInt pos = 0;
       
    84 #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
    80 
    85 
    81 	// Check that the client hasn't specified some incorrect UniqueId
    86 	// Check that the client hasn't specified some incorrect UniqueId
    82 	User::LeaveIfError(TF32DefaultAttributes::CheckUniqueId(aUniqueId));	
    87 	User::LeaveIfError(TF32DefaultAttributes::CheckUniqueId(aUniqueId));	
    83 	
    88 	
    84 	// When creating a CData from a file handle we must duplicate the file handle
    89 	// When creating a CData from a file handle we must duplicate the file handle
    87 	User::LeaveIfError(iFile.Seek(ESeekStart, pos));  // reset to start of file
    92 	User::LeaveIfError(iFile.Seek(ESeekStart, pos));  // reset to start of file
    88 	}
    93 	}
    89 
    94 
    90 void CF32AgentData::DataSizeL(TInt &aSize)
    95 void CF32AgentData::DataSizeL(TInt &aSize)
    91 	{
    96 	{
       
    97 #ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
       
    98 	TInt64 size;
       
    99 	User::LeaveIfError(iFile.Size(size));
       
   100 	aSize=size;
       
   101 #else
    92 	User::LeaveIfError(iFile.Size(aSize));
   102 	User::LeaveIfError(iFile.Size(aSize));
    93 	}
   103 #endif //SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
       
   104 	}
       
   105 
       
   106 #ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
       
   107 void CF32AgentData::DataSize64L(TInt64 &aSize)
       
   108 	{
       
   109 	User::LeaveIfError(iFile.Size(aSize));
       
   110 	}
       
   111 #endif //SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
    94 
   112 
    95 TInt CF32AgentData::EvaluateIntent(TIntent /*aIntent*/)
   113 TInt CF32AgentData::EvaluateIntent(TIntent /*aIntent*/)
    96 	{
   114 	{
    97 	return KErrNone;
   115 	return KErrNone;
    98 	}
   116 	}
   129 							 TRequestStatus& aStatus) 
   147 							 TRequestStatus& aStatus) 
   130 	{
   148 	{
   131 	iFile.Read(aPos, aDes, aLength, aStatus);
   149 	iFile.Read(aPos, aDes, aLength, aStatus);
   132 	return KErrNone;
   150 	return KErrNone;
   133 	}
   151 	}
       
   152 
       
   153 #ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
       
   154 TInt CF32AgentData::Read64(TInt64 aPos, TDes8& aDes,
       
   155 							 TInt aLength, 
       
   156 							 TRequestStatus& aStatus) 
       
   157 	{
       
   158 	iFile.Read(aPos, aDes, aLength, aStatus);
       
   159 	return KErrNone;
       
   160 	}
       
   161 #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
   134 	
   162 	
   135 void CF32AgentData::ReadCancel(TRequestStatus& aStatus)
   163 void CF32AgentData::ReadCancel(TRequestStatus& aStatus)
   136 {
   164 	{
   137 	iFile.ReadCancel(aStatus);
   165 	iFile.ReadCancel(aStatus);
   138 }
   166 	}
   139 
   167 
   140 TInt CF32AgentData::Seek(TSeek aMode, TInt& aPos) 
   168 TInt CF32AgentData::Seek(TSeek aMode, TInt& aPos) 
   141 	{
   169 	{
       
   170 #ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
       
   171 	TInt64 pos = aPos;
       
   172 	TInt offset = iFile.Seek(aMode, pos);
       
   173 	aPos = I64INT(pos);
       
   174 #else
       
   175 	TInt offset = iFile.Seek(aMode, aPos);
       
   176 #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
       
   177 	return offset;
       
   178 	}
       
   179 
       
   180 #ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
       
   181 TInt CF32AgentData::Seek64(TSeek aMode, TInt64& aPos) 
       
   182 	{
   142 	return iFile.Seek(aMode, aPos);
   183 	return iFile.Seek(aMode, aPos);
   143 	}
   184 	}
       
   185 #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
       
   186 
   144 
   187 
   145 TInt CF32AgentData::SetProperty(TAgentProperty aProperty, TInt aValue)
   188 TInt CF32AgentData::SetProperty(TAgentProperty aProperty, TInt aValue)
   146 	{
   189 	{
   147 	
   190 	
   148 	if(aProperty==EAgentPropertyAgentUI)
   191 	if(aProperty==EAgentPropertyAgentUI)
   220 		// load agent UI from f32AgentUi.dll
   263 		// load agent UI from f32AgentUi.dll
   221 		iAgentUi = TF32AgentUiFactory::CreateF32AgentUiL();
   264 		iAgentUi = TF32AgentUiFactory::CreateF32AgentUiL();
   222 		}
   265 		}
   223 	return *iAgentUi;
   266 	return *iAgentUi;
   224 	}
   267 	}
       
   268