CDirectoryLocalizer Class Reference

API published in: S60 3rd Ed FP 2

Link against: directorylocalizer.lib

Capability Information

Required Capabilities

None


#include <cdirectorylocalizer.h>

Detailed Description

Directory Localizer interface class.

Public Member Functions

virtual IMPORT_C  ~CDirectoryLocalizer ()
  Destructor.
IMPORT_C void  AddFromResourceL (TResourceReader &aReader)
  Adds entries to the localizer from resource pointed by aReader.
IMPORT_C void  AddFromResourceL (TInt aResourceId)
  Adds entries to the localizer from resource pointed by aResourceId.
IMPORT_C void  SetFullPath (const TDesC &aFullPath)
  This method is used to set the absolute path to be localized.
IMPORT_C TBool  IsLocalized () const
  Tells if the last given path is recognized as a localized directory.
IMPORT_C const TDesC &  LocalizedName () const
  Returns a reference to a TDesC that contains the last given path's localized name.
IMPORT_C const TDesC &  ExtraData () const
  Returns a reference to a TDesC that contains the last given path's extra data.
IMPORT_C TInt  Icon () const
  Returns the icon index of the last given path.

Static Public Member Functions

static IMPORT_C CDirectoryLocalizer NewL ()
  Two-phased constructor.
static IMPORT_C CDirectoryLocalizer NewL (TResourceReader &aReader)
  Two-phased constructor.
static IMPORT_C CDirectoryLocalizer NewL (TInt aResourceId)
  Two-phased constructor.

Protected Member Functions

  CDirectoryLocalizer ()
  C++ default constructor.
void  ConstructL ()
  Symbian 2nd phase constructor.

Constructor & Destructor Documentation

virtual IMPORT_C CDirectoryLocalizer::~CDirectoryLocalizer  )  [virtual]
 

Destructor.

CDirectoryLocalizer::CDirectoryLocalizer  )  [protected]
 

C++ default constructor.


Member Function Documentation

IMPORT_C void CDirectoryLocalizer::AddFromResourceL TInt  aResourceId  ) 
 

Adds entries to the localizer from resource pointed by aResourceId.

Parameters:
aResourceId  Resource identifier to DIRECTORYLOCALIZER resource.
Returns:
None.
IMPORT_C void CDirectoryLocalizer::AddFromResourceL TResourceReader &  aReader  ) 
 

Adds entries to the localizer from resource pointed by aReader.

Parameters:
aReader  Reference to an initialized resouce reader instance.
Returns:
None.
void CDirectoryLocalizer::ConstructL  )  [protected]
 

Symbian 2nd phase constructor.

IMPORT_C const TDesC& CDirectoryLocalizer::ExtraData  )  const
 

Returns a reference to a TDesC that contains the last given path's extra data.

If the path is not a localized directory or no extra data is defined, then a pointer to KNullDesc is returned.

Returns:
the last given path's extra data.
IMPORT_C TInt CDirectoryLocalizer::Icon  )  const
 

Returns the icon index of the last given path.

If the path is not a localized directory KErrGeneral is returned.

Returns:
the icon index of the last given path.
 CDirectoryLocalizer loc = CDirectoryLocalizer::NewL();
 loc-> SetFullPath( aDir );
 if ( loc->Icon() != KErrGeneral )
     {
     //...
     }
IMPORT_C TBool CDirectoryLocalizer::IsLocalized  )  const
 

Tells if the last given path is recognized as a localized directory.

Returns:
ETrue if last given path is localized and EFalse if not.
IMPORT_C const TDesC& CDirectoryLocalizer::LocalizedName  )  const
 

Returns a reference to a TDesC that contains the last given path's localized name.

If the path is not a localized directory, then a pointer to KNullDesc is returned.

Returns:
the last given path's localized name.
static IMPORT_C CDirectoryLocalizer* CDirectoryLocalizer::NewL TInt  aResourceId  )  [static]
 

Two-phased constructor.

Construct a CDirectoryLocalizer and initialize it from a resource ID.

Parameters:
aResourceId  Resource identifier to DIRECTORYLOCALIZER resource.
Returns:
apointer to the created instance of CDirectoryLocalizer.
static IMPORT_C CDirectoryLocalizer* CDirectoryLocalizer::NewL TResourceReader &  aReader  )  [static]
 

Two-phased constructor.

Construct a CDirectoryLocalizer and initialize it from resource pointed by aReader.

Parameters:
aReader  Reference to an initialized resource reader instance.
Returns:
apointer to the created instance of CDirectoryLocalizer.
static IMPORT_C CDirectoryLocalizer* CDirectoryLocalizer::NewL  )  [static]
 

Two-phased constructor.

Construct a CDirectoryLocalizer and initialize it with platform specific default localization data.

Returns:
apointer to the created instance of CDirectoryLocalizer.
IMPORT_C void CDirectoryLocalizer::SetFullPath const TDesC &  aFullPath  ) 
 

This method is used to set the absolute path to be localized.

For example "c:\\nokia\\images\\pictures". Take care that the path is given with or without the trailing backslash depending on how the paths are defined in the resource. localizer can utilize pathinfo to retrieve predefined folder paths.

Parameters:
aFullPath  Full path name.
Returns:
None.
  #include <PathInfo.h>

  // Get the the full path of the contacts folder in the memory card.
  TFileName path = PathInfo::GetPath( PathInfo::EImagesPath );

  // 'path' contains now the images path to be appended to a root path.

 CDirectoryLocalizer loc = CDirectoryLocalizer::NewL();
 loc->SetFullPath ( path );
See also:
PathInfo

The documentation for this class was generated from the following file:

Copyright © Nokia Corporation 2001-2008
Back to top