imagingandcamerafws/imaginginttest/TestImageIAgent/src/testimageiagentmanager.cpp
changeset 0 40261b775718
equal deleted inserted replaced
-1:000000000000 0:40261b775718
       
     1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #include "testimageiagentmanager.h"
       
    17 
       
    18 using namespace ContentAccess;
       
    19 
       
    20 _LIT(KTestJPEGIContentExtension, "JPGI");
       
    21 _LIT(KTestTIFIContentExtension, "TIFI");
       
    22 
       
    23 
       
    24 CTestIMAGEIAgentManager* CTestIMAGEIAgentManager::NewL()
       
    25 	{
       
    26 	CTestIMAGEIAgentManager* self = NewLC();
       
    27 	CleanupStack::Pop(self);
       
    28 	return self;
       
    29 	}
       
    30 
       
    31 CTestIMAGEIAgentManager* CTestIMAGEIAgentManager::NewLC()
       
    32 	{
       
    33 	CTestIMAGEIAgentManager* self=new(ELeave) CTestIMAGEIAgentManager();
       
    34 	CleanupStack::PushL(self);
       
    35 	self->ConstructL();
       
    36 	return self;
       
    37 	}
       
    38 
       
    39 CTestIMAGEIAgentManager::CTestIMAGEIAgentManager()
       
    40 	{
       
    41 	}
       
    42 
       
    43 CTestIMAGEIAgentManager::~CTestIMAGEIAgentManager()
       
    44 	{
       
    45 	}
       
    46 
       
    47 void CTestIMAGEIAgentManager::ConstructL()
       
    48 	{
       
    49 	}
       
    50 
       
    51 void CTestIMAGEIAgentManager::DeleteFileL(const TDesC &aFileName)
       
    52 	{
       
    53 	RFs fs;
       
    54 	User::LeaveIfError(fs.Connect());
       
    55 	CleanupClosePushL(fs);
       
    56 	User::LeaveIfError(fs.Delete(aFileName));
       
    57 	CleanupStack::PopAndDestroy();
       
    58 	}
       
    59 
       
    60 TInt CTestIMAGEIAgentManager::DeleteFile(const TDesC &aFileName)
       
    61 	{
       
    62 	TRAPD(err, DeleteFileL(aFileName));
       
    63 	return err;
       
    64 	}
       
    65 
       
    66 
       
    67 TInt CTestIMAGEIAgentManager::CopyFile(const TDesC& /*aSource*/, const TDesC& /*aDestination*/)
       
    68 	{
       
    69 	return KErrNone;
       
    70 	}
       
    71 
       
    72 TInt CTestIMAGEIAgentManager::RenameFile(const TDesC& /*aSource*/, const TDesC& /*aDestination*/)
       
    73 	{
       
    74 	return KErrNone;
       
    75 	}
       
    76 
       
    77 TInt CTestIMAGEIAgentManager::MkDir(const TDesC& /*aPath*/)
       
    78 	{
       
    79 	return KErrNone;
       
    80 	}
       
    81 
       
    82 TInt CTestIMAGEIAgentManager::MkDirAll(const TDesC& /*aPath*/)
       
    83 	{
       
    84 	return KErrNone;
       
    85 	}
       
    86 
       
    87 TInt CTestIMAGEIAgentManager::RmDir(const TDesC& /*aPath*/)
       
    88 	{
       
    89 	return KErrNone;
       
    90 	}
       
    91 
       
    92 TInt CTestIMAGEIAgentManager::GetDir(const TDesC& /*aName*/,TUint /*anEntryAttMask*/,TUint /*anEntrySortKey*/, CDir*& /*anEntryList*/) const
       
    93 	{
       
    94 	return KErrNone;
       
    95 	}
       
    96 
       
    97 TInt CTestIMAGEIAgentManager::GetDir(const TDesC& /*aName*/,TUint /*anEntryAttMask*/,TUint /*anEntrySortKey*/, CDir*& /*anEntryList*/,CDir*& /*aDirList*/) const
       
    98 	{
       
    99 	return KErrNone;
       
   100 	}
       
   101 
       
   102 TInt CTestIMAGEIAgentManager::GetDir(const TDesC& /*aName*/,const TUidType& /*anEntryUid*/,TUint /*anEntrySortKey*/, CDir*& /*aFileList*/) const
       
   103 	{
       
   104 	return KErrNone;
       
   105 	}
       
   106 
       
   107 TInt CTestIMAGEIAgentManager::GetAttribute(TInt /*aAttribute*/, TInt& /*aValue*/, const TVirtualPathPtr& /*aVirtualPath*/)
       
   108 	{
       
   109 	return KErrNone;
       
   110 	}
       
   111 
       
   112 TInt CTestIMAGEIAgentManager::GetAttributeSet(RAttributeSet& /*aAttributeSet*/, const TVirtualPathPtr& /*aVirtualPath*/)
       
   113 	{
       
   114 	return KErrNone;
       
   115 	}
       
   116 
       
   117 TInt CTestIMAGEIAgentManager::GetStringAttribute(TInt /*aAttribute*/, TDes& /*aValue*/, const TVirtualPathPtr& /*aVirtualPath*/)
       
   118 	{
       
   119 	return KErrNone;
       
   120 	}
       
   121 
       
   122 TInt CTestIMAGEIAgentManager::GetStringAttributeSet(RStringAttributeSet& /*aStringAttributeSet*/, const TVirtualPathPtr& /*aVirtualPath*/)
       
   123 	{
       
   124 	return KErrNone;
       
   125 	}
       
   126 
       
   127 void CTestIMAGEIAgentManager::NotifyStatusChange(const TDesC& /*aURI*/, TEventMask /*aMask*/, TRequestStatus& /*aStatus*/)
       
   128 	{
       
   129 	}
       
   130 
       
   131 TInt CTestIMAGEIAgentManager::CancelNotifyStatusChange(const TDesC& /*aURI*/, TRequestStatus& /*aStatus*/)
       
   132 	{
       
   133 	return KErrNone;
       
   134 	}
       
   135 
       
   136 TInt CTestIMAGEIAgentManager::SetProperty(TAgentProperty /*aProperty*/, TInt /*aValue*/)
       
   137 	{
       
   138 	return KErrNone;
       
   139 	}
       
   140 
       
   141 void CTestIMAGEIAgentManager::DisplayInfoL(TDisplayInfo /*aInfo*/, const TVirtualPathPtr& /*aVirtualPath*/)
       
   142 	{
       
   143 	}
       
   144 
       
   145 TBool CTestIMAGEIAgentManager::IsRecognizedL(const TDesC& aURI, TContentShareMode /*aShareMode*/) const
       
   146 	{
       
   147 	// Convert URI to uppercase
       
   148 	HBufC *uriUpper = aURI.AllocL();
       
   149 	TPtr uriPtr(uriUpper->Des());
       
   150 	uriPtr.UpperCase();
       
   151 
       
   152 	// Check that the file extension is .JPEGI
       
   153 	TPtrC jpegextension = uriPtr.Right(KTestJPEGIContentExtension().Length());
       
   154 	TInt jpegresult = jpegextension.Compare(KTestJPEGIContentExtension);
       
   155 	
       
   156 	// Check that the file extension is .TIFI
       
   157 	TPtrC tifextension = uriPtr.Right(KTestTIFIContentExtension().Length());
       
   158 	TInt tifresult = tifextension.Compare(KTestTIFIContentExtension);
       
   159 		
       
   160 	delete uriUpper;
       
   161 
       
   162 	if( jpegresult == 0 || tifresult == 0 )
       
   163 		{
       
   164 		return ETrue;
       
   165 		}
       
   166 	else
       
   167 		{
       
   168 		return EFalse;
       
   169 		}
       
   170 	}
       
   171 
       
   172 TBool CTestIMAGEIAgentManager::IsRecognizedL(RFile& /*aFile*/) const
       
   173 	{
       
   174 	return EFalse;
       
   175 	}
       
   176 
       
   177 TBool CTestIMAGEIAgentManager::RecognizeFileL(const TDesC& /*aFileName*/, const TDesC8& /*aBuffer*/, TDes8& /*aFileMimeType*/, TDes8& /*aContentMimeType*/) const
       
   178 	{
       
   179 	// don't return anything to apparc for now
       
   180 	return EFalse;
       
   181 	}
       
   182 
       
   183 TInt CTestIMAGEIAgentManager::AgentSpecificCommand(TInt /*aCommand*/, const TDesC8& /*aInputBuffer*/, TDes8& /*aOutputBuffer*/)
       
   184 	{
       
   185 	return KErrNone;
       
   186 	}
       
   187 
       
   188 void CTestIMAGEIAgentManager::AgentSpecificCommand(TInt /*aCommand*/, const TDesC8& /*aInputBuffer*/, TDes8& /*aOutputBuffer*/, TRequestStatus& /*aStatus*/)
       
   189 	{
       
   190 	}
       
   191 
       
   192 void CTestIMAGEIAgentManager::DisplayManagementInfoL()
       
   193 	{
       
   194 	}
       
   195 
       
   196 void CTestIMAGEIAgentManager::PrepareHTTPRequestHeaders(RStringPool& /*aStringPool*/, RHTTPHeaders& /*aRequestHeaders*/) const
       
   197 	{
       
   198 	}