idlehomescreen/widgetmanager/tsrc/wmunittest/src/wmunittest_plugin.cpp
branchRCL_3
changeset 11 ff572dfe6d86
parent 9 f966699dea19
child 19 79311d856354
equal deleted inserted replaced
9:f966699dea19 11:ff572dfe6d86
    20 #include <stdlib.h>
    20 #include <stdlib.h>
    21 #include <stifparser.h>
    21 #include <stifparser.h>
    22 #include <stiftestinterface.h>
    22 #include <stiftestinterface.h>
    23 #include <bautils.h>
    23 #include <bautils.h>
    24 #include <aknsskininstance.h>
    24 #include <aknsskininstance.h>
       
    25 #include <utf.h>
    25 #include "wmunittest.h"
    26 #include "wmunittest.h"
    26 // components to test
    27 // components to test
    27 #include "wmplugin.h"
    28 #include "wmplugin.h"
    28 #include <hscontentinfo.h>
    29 #include <hscontentinfo.h>
    29 #include <hscontentinfoarray.h>
    30 #include <hscontentinfoarray.h>
    45 const TInt KName = 100;
    46 const TInt KName = 100;
    46 const TInt KDescription = 101;
    47 const TInt KDescription = 101;
    47 const TInt KLogoPath = 102;
    48 const TInt KLogoPath = 102;
    48 const TInt KCanBeAdded = 103;
    49 const TInt KCanBeAdded = 103;
    49 const TInt KCanBeRemoved = 104;
    50 const TInt KCanBeRemoved = 104;
    50 
    51 const TInt KPublisherId = 105;
       
    52 const TInt KType = 106;
    51 
    53 
    52 // ============================ MEMBER FUNCTIONS ===============================
    54 // ============================ MEMBER FUNCTIONS ===============================
    53 
    55 
    54 
    56 
    55 // -----------------------------------------------------------------------------
    57 // -----------------------------------------------------------------------------
    96 // -----------------------------------------------------------------------------
    98 // -----------------------------------------------------------------------------
    97 //
    99 //
    98 TInt CWmUnitTest::PluginDeactivateL( CStifItemParser& /*aItem*/ )
   100 TInt CWmUnitTest::PluginDeactivateL( CStifItemParser& /*aItem*/ )
    99     {
   101     {
   100     if ( iWmPlugin == 0 ) User::Leave( KErrArgument );
   102     if ( iWmPlugin == 0 ) User::Leave( KErrArgument );
   101     iWmPlugin->CloseView();
   103     iWmPlugin->DeActivate();
   102     _RETURN("PluginActivateL End", KErrNone);
   104     _RETURN("PluginActivateL End", KErrNone);
   103     }
   105     }
   104 
   106 
   105 // -----------------------------------------------------------------------------
   107 // -----------------------------------------------------------------------------
   106 // CWmUnitTest::PluginWidgetsChangedL
   108 // CWmUnitTest::PluginWidgetsChangedL
   121     {
   123     {
   122     CreateContentInfoArrayL( aArray, iMass );
   124     CreateContentInfoArrayL( aArray, iMass );
   123     return KErrNone;
   125     return KErrNone;
   124     }
   126     }
   125 
   127 
       
   128 TInt CWmUnitTest::WidgetListL( CHsContentInfo& aInfo, CHsContentInfoArray& aArray )
       
   129     {
       
   130     return KErrNone;
       
   131     }
       
   132 
   126 TInt CWmUnitTest::ViewListL( CHsContentInfoArray& /*aArray*/ )
   133 TInt CWmUnitTest::ViewListL( CHsContentInfoArray& /*aArray*/ )
   127     {
   134     {
   128     return KErrNone;
   135     return KErrNone;
   129     }
   136     }
   130 
   137 
   163     return KErrNone;
   170     return KErrNone;
   164     }
   171     }
   165 
   172 
   166 TInt CWmUnitTest::ActiveViewL( CHsContentInfo& /*aInfo*/ )
   173 TInt CWmUnitTest::ActiveViewL( CHsContentInfo& /*aInfo*/ )
   167     {
   174     {
   168     return 0;
   175     return KErrNone;
   169     }
   176     }
   170 
   177 
   171 TInt CWmUnitTest::ActiveAppL( CHsContentInfo& /*aInfo*/ )
   178 TInt CWmUnitTest::ActiveAppL( CHsContentInfo& /*aInfo*/ )
   172     {
   179     {
   173     return 0;
   180     return KErrNone;
   174     }
   181     }
   175 
   182 
   176 
   183 
   177 // -----------------------------------------------------------------------------
   184 // -----------------------------------------------------------------------------
   178 // CWmUnitTest::ChangeContentL
   185 // CWmUnitTest::ChangeContentL
   234             { info->SetIconPathL( *iChangeValue ); }
   241             { info->SetIconPathL( *iChangeValue ); }
   235         else if ( iChangeType == KCanBeAdded )
   242         else if ( iChangeType == KCanBeAdded )
   236             { info->SetCanBeAdded( s2b(*iChangeValue) ); }
   243             { info->SetCanBeAdded( s2b(*iChangeValue) ); }
   237         else if ( iChangeType == KCanBeRemoved )
   244         else if ( iChangeType == KCanBeRemoved )
   238             { info->SetCanBeRemoved( s2b(*iChangeValue) ); }
   245             { info->SetCanBeRemoved( s2b(*iChangeValue) ); }
       
   246         else if ( iChangeType == KPublisherId )
       
   247             { info->SetPublisherIdL( *iChangeValue ); }
       
   248         else if ( iChangeType == KType )
       
   249             {
       
   250             TBuf8<128> buf;
       
   251             CnvUtfConverter::ConvertFromUnicodeToUtf8( buf, *iChangeValue );
       
   252             info->SetTypeL( buf ); 
       
   253             }
   239         }
   254         }
   240     }
   255     }
   241 
   256 
   242 // End of File
   257 // End of File