csxhelp/HelpEngine/src/CSXHGenericTOC1.cpp
branchRCL_3
changeset 5 d06b1526f62c
parent 0 1f04cf54edd8
equal deleted inserted replaced
1:27f5851bd5a5 5:d06b1526f62c
    19 #include "csxhconstants.h"
    19 #include "csxhconstants.h"
    20 
    20 
    21 // ---------------------------------------------------------
    21 // ---------------------------------------------------------
    22 // Items commented in header.
    22 // Items commented in header.
    23 // ---------------------------------------------------------
    23 // ---------------------------------------------------------
    24 CCSXHGenericTOC1::CCSXHGenericTOC1(const TDesC& aName):
    24 CCSXHGenericTOC1::CCSXHGenericTOC1(const TDesC& aName, const TInt32 aPriority):
    25                     CCSXHHelpContentBase(aName),iChildList(NULL)
    25                     CCSXHHelpContentBase(aName, aPriority), iChildList(NULL)
    26     {//No Implementation required
    26     {//No Implementation required
    27     }
    27     }
    28     
    28     
    29 // ---------------------------------------------------------
    29 // ---------------------------------------------------------
    30 // Items commented in header.
    30 // Items commented in header.
   106         return EFalse;
   106         return EFalse;
   107         }
   107         }
   108     return ETrue;           
   108     return ETrue;           
   109     }
   109     }
   110 
   110 
       
   111 TBool CCSXHGenericTOC1::InsertChildWithPriority(CCSXHHelpContentBase* aChild, TBool aDeleteObject)
       
   112     {
       
   113     ConstructChildList();
       
   114     TLinearOrder<CCSXHHelpContentBase> anOrder(OrdererWithPriority<CCSXHHelpContentBase>);  
       
   115     if (KErrNone != iChildList->InsertInOrder(aChild,anOrder))
       
   116         {
       
   117         if(aDeleteObject)
       
   118             delete aChild;
       
   119         
       
   120         return EFalse;
       
   121         }
       
   122     return ETrue;              
       
   123     }
       
   124 
   111 // ---------------------------------------------------------
   125 // ---------------------------------------------------------
   112 // Items commented in header.
   126 // Items commented in header.
   113 // ---------------------------------------------------------    
   127 // ---------------------------------------------------------    
   114 void CCSXHGenericTOC1::CopyChildListL(CDesCArray* aArray)
   128 void CCSXHGenericTOC1::CopyChildListL(CDesCArray* aArray)
   115     {
   129     {
   116     TInt count =    iChildList->Count();
   130     TInt count =    iChildList->Count();
   117     CCSXHHelpContentBase* child;
   131     CCSXHHelpContentBase* child;
   118     for(TInt i=0;i<count;++i )
   132     for(TInt i = 0; i < count; ++i)
   119         {
   133         {
   120         child = (*iChildList)[i];
   134         child = (*iChildList)[i];
   121         TBuf<KMaxFileName> toc2Entry(KTabSpace);
   135         if (child && child->GetName().Length() != 0)
   122         toc2Entry.Append(child->GetName());
   136         	{
   123         aArray->AppendL(toc2Entry);
   137             TBuf<KMaxFileName> toc2Entry(KTabSpace);
       
   138             toc2Entry.Append(child->GetName());
       
   139             aArray->AppendL(toc2Entry);
       
   140             }
   124         }       
   141         }       
   125     }
   142     }
   126 
   143 
   127 // ---------------------------------------------------------
   144 // ---------------------------------------------------------
   128 // Items commented in header.
   145 // Items commented in header.