os/mm/mmlibs/mmfw/tsrc/mmvalidationsuite/mmvalidationsuiteapp/src/MVSViewMetaInfoDialog.cpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/mm/mmlibs/mmfw/tsrc/mmvalidationsuite/mmvalidationsuiteapp/src/MVSViewMetaInfoDialog.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,160 @@
     1.4 +// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +// Part of the MVS Application for TechView
    1.18 +//
    1.19 +
    1.20 +
    1.21 +#include "MVSViewMetaInfoDialog.h"
    1.22 +#include "MVSApp.hrh"
    1.23 +#include <techview/eiklabel.h>
    1.24 +#include "MVSAppUI.h"
    1.25 +#include "MVSConstants.h"
    1.26 +
    1.27 +
    1.28 +
    1.29 +void CMVSViewMetaInfoDialog::SetupDialogLD(RPointerArray<CMMFMetaDataEntry> aMetaArray,
    1.30 +                                        CMVSAppUi* aAppUi)
    1.31 +     {
    1.32 +     CMVSViewMetaInfoDialog* dialog = new (ELeave) CMVSViewMetaInfoDialog(aAppUi);
    1.33 +     CleanupStack::PushL(dialog); 
    1.34 +     dialog->ConstructL(aMetaArray);
    1.35 +     CleanupStack::Pop(dialog);
    1.36 +     dialog->ExecuteLD(R_MVS_DIALOG_SETMETAINFO);
    1.37 +     }
    1.38 +
    1.39 +
    1.40 +void CMVSViewMetaInfoDialog::PreLayoutDynInitL()
    1.41 +	{
    1.42 +    CEikEdwin* myEdwin1 = static_cast<CEikEdwin*>(Control(EMVSMeta1));
    1.43 +    //author
    1.44 +    if(myEdwin1)
    1.45 +    	{
    1.46 +    	myEdwin1->SetReadOnly(TRUE);
    1.47 +    	myEdwin1->SetBackgroundColorL(KRgbGray);
    1.48 +    	}
    1.49 +    
    1.50 +    CEikEdwin* myEdwin2 = static_cast<CEikEdwin*>(Control(EMVSMeta2));
    1.51 +    if(myEdwin2)
    1.52 +    	{
    1.53 +    	myEdwin2->SetReadOnly(TRUE);
    1.54 +    	myEdwin2->SetBackgroundColorL(KRgbGray);
    1.55 +    	}
    1.56 +    
    1.57 +    //copyright
    1.58 +    CEikEdwin* myEdwin3 = static_cast<CEikEdwin*>(Control(EMVSMeta3));
    1.59 +    if(myEdwin3)
    1.60 +    	{
    1.61 +    	myEdwin3->SetReadOnly(TRUE);
    1.62 +    	myEdwin3->SetBackgroundColorL(KRgbGray);
    1.63 +    	}
    1.64 +    
    1.65 +    //revision
    1.66 +    CEikEdwin* myEdwin4 = static_cast<CEikEdwin*>(Control(EMVSMeta4));
    1.67 +    if(myEdwin4)
    1.68 +    	{
    1.69 +    	myEdwin4->SetReadOnly(TRUE);
    1.70 +    	myEdwin4->SetBackgroundColorL(KRgbGray);
    1.71 +    	}
    1.72 +    
    1.73 +    //category
    1.74 +    CEikEdwin* myEdwin5 = static_cast<CEikEdwin*>(Control(EMVSMeta5));
    1.75 +    if(myEdwin5)
    1.76 +    	{
    1.77 +    	myEdwin5->SetReadOnly(TRUE);
    1.78 +    	myEdwin5->SetBackgroundColorL(KRgbGray);
    1.79 +    	}
    1.80 +    
    1.81 +    //comments
    1.82 +    CEikEdwin* myEdwin6 = static_cast<CEikEdwin*>(Control(EMVSMeta6));
    1.83 +	if(myEdwin6)
    1.84 +    	{
    1.85 +    	myEdwin6->SetReadOnly(TRUE);
    1.86 +    	myEdwin6->SetBackgroundColorL(KRgbGray);
    1.87 +    	}
    1.88 +    
    1.89 +    TRAPD(err,iAppUi->GetMetaDataL(iMetaArray));
    1.90 +	TInt metaArrayCount = iMetaArray.Count();
    1.91 +	if(err == KErrNone && metaArrayCount > 0)
    1.92 +		{
    1.93 +		for(TInt counter = 0; counter< iMetaArray.Count(); counter++)
    1.94 +	    	{
    1.95 +	        TBufC<256> temp(iMetaArray[counter]->Name());
    1.96 +	        TBufC<256> tempval(iMetaArray[counter]->Value());
    1.97 +	        if((iMetaArray[counter]->Name()).CompareF(KTitle)==0)
    1.98 +	        	{
    1.99 +	            myEdwin1->SetTextL(&(iMetaArray[counter]->Value()));
   1.100 +	            iTitlePos = counter;
   1.101 +	            }
   1.102 +	        if((iMetaArray[counter]->Name()).CompareF(KAuthor)==0)
   1.103 +	            {
   1.104 +	            myEdwin2->SetTextL(&(iMetaArray[counter]->Value()));
   1.105 +	            iAuthorPos = counter;
   1.106 +	            }
   1.107 +	        if((iMetaArray[counter]->Name()).CompareF(KCopyrt)==0)
   1.108 +	            {
   1.109 +	            myEdwin3->SetTextL(&(iMetaArray[counter]->Value()));
   1.110 +	            iCopyrightPos = counter;
   1.111 +	            }
   1.112 +	        if((iMetaArray[counter]->Name()).CompareF(KRevision)==0)
   1.113 +	            {
   1.114 +	            myEdwin4->SetTextL(&(iMetaArray[counter]->Value()));
   1.115 +	            iRevisionPos = counter;
   1.116 +	            }
   1.117 +	        if((iMetaArray[counter]->Name()).CompareF(KCategory)==0)
   1.118 +	            {
   1.119 +	            myEdwin5->SetTextL(&(iMetaArray[counter]->Value()));
   1.120 +	            iCategoryPos = counter;
   1.121 +	            }
   1.122 +	        if((iMetaArray[counter]->Name()).CompareF(KComments)==0)
   1.123 +	            {
   1.124 +	            myEdwin6->SetTextL(&(iMetaArray[counter]->Value()));
   1.125 +	            iCommentsPos = counter;
   1.126 +	            }
   1.127 +	        }	
   1.128 +		}
   1.129 +    
   1.130 +     
   1.131 +    if(err == KErrNotSupported || metaArrayCount == 0)
   1.132 +		{
   1.133 +		User::InfoPrint(KNotSupported);
   1.134 +		}
   1.135 +     }
   1.136 +
   1.137 +
   1.138 +
   1.139 +
   1.140 +CMVSViewMetaInfoDialog::CMVSViewMetaInfoDialog(CMVSAppUi* aAppUi)
   1.141 +: iTitlePos(-1), iAuthorPos(-1), iCopyrightPos(-1), iRevisionPos(-1),\
   1.142 +iCategoryPos(-1), iCommentsPos(-1), iAppUi(aAppUi)
   1.143 +    {
   1.144 +     
   1.145 +    }
   1.146 +    
   1.147 +    
   1.148 +void CMVSViewMetaInfoDialog::ConstructL(RPointerArray<CMMFMetaDataEntry> aMetaArray)
   1.149 +    {
   1.150 +    iMetaArray.Reset();
   1.151 +    TInt noElements = aMetaArray.Count();
   1.152 +    for(TInt counter = 0; counter < noElements; counter++)
   1.153 +    	{
   1.154 +        iMetaArray.Append(aMetaArray[counter]);
   1.155 +        }
   1.156 +    }
   1.157 +
   1.158 +TBool CMVSViewMetaInfoDialog::OkToExitL(TInt /*aButtonId*/)
   1.159 +     {
   1.160 +     //Delete the metadata entries populated in the array
   1.161 +     iMetaArray.ResetAndDestroy();
   1.162 +     return ETrue;
   1.163 +     }