S60 3rd Edition SDK for Symbian OS
Example Applications Guide

CLandmarksInfoView Class Reference

#include <LandmarksInfoView.h>

List of all members.

Public Member Functions

 ~CLandmarksInfoView ()
TUid Id () const
void HandleCommandL (TInt aCommand)
void DoActivateL (const TVwsViewId &aPrevViewId, TUid aCustomMessageId, const TDesC8 &aCustomMessage)
void DoDeactivate ()

Static Public Member Functions

static CLandmarksInfoView * NewLC (CAknNavigationDecorator *aNaviDecorator, CLandmarksApplicationEngine &aEngine)

Private Member Functions

 CLandmarksInfoView (CAknNavigationDecorator *aNaviDecorator, CLandmarksApplicationEngine &aEngine)
void ConstructL ()
void EditLandmarkL ()

Private Attributes

CLandmarksInfoContainer * iContainer
 The container containing the graphical components of the view.
CLandmarksApplicationEngine & iEngine
 The application engine used for accessing landmark data.
CAknNavigationDecorator * iNaviDecorator
 Ddecorates the navi pane (with navigation arrows etc).
HBufC * iAppName
 Application name.


Detailed Description

CLandmarksInfoView is the view displaying landmark's details

Definition at line 34 of file LandmarksInfoView.h.


Constructor & Destructor Documentation

CLandmarksInfoView::~CLandmarksInfoView (   ) 
 

Destructor.

Definition at line 76 of file LandmarksInfoView.cpp.

References iAppName, and iContainer.

00077     {
00078     delete iContainer;
00079     delete iAppName;
00080     }

CLandmarksInfoView::CLandmarksInfoView (  CAknNavigationDecorator *  aNaviDecorator,
CLandmarksApplicationEngine &  aEngine
)  [private]
 

C++ constructor.

Parameters:
aNaviDecorator the navigation decorator displaying the tabs
aEngine the engine used for fetching categories data.

Definition at line 39 of file LandmarksInfoView.cpp.

00042 :   iEngine(aEngine), 
00043     iNaviDecorator(aNaviDecorator)
00044     {
00045     // No implementation required
00046     }


Member Function Documentation

CLandmarksInfoView * CLandmarksInfoView::NewLC (  CAknNavigationDecorator *  aNaviDecorator,
CLandmarksApplicationEngine &  aEngine
)  [static]
 

Two-phased constructor.

Parameters:
aNaviDecorator the navigation decorator displaying the tabs
aEngine the engine used for fetching category data.

Definition at line 64 of file LandmarksInfoView.cpp.

References CLandmarksInfoView().

00067     {
00068     CLandmarksInfoView* self = new (ELeave) CLandmarksInfoView(
00069         aNaviDecorator, aEngine);
00070     CleanupStack::PushL(self);
00071     self->ConstructL();
00072     return self;
00073     }

TUid CLandmarksInfoView::Id (   )  const
 

Id Identity of this view to the system.

Returns:
the ID of this view

Definition at line 88 of file LandmarksInfoView.cpp.

00089     {
00090     return TUid::Uid(ELandmarksInfoViewId);
00091     }

void CLandmarksInfoView::HandleCommandL (  TInt  aCommand  ) 
 

HandleCommandL handles user menu selections.

Parameters:
aCommand the enumerated code for the option selected

Definition at line 99 of file LandmarksInfoView.cpp.

References CLandmarksInfoContainer::EditLandmarkL(), and iContainer.

00100     {
00101     switch (aCommand)
00102         {
00103         case EAknSoftkeyEdit:
00104             iContainer->EditLandmarkL();
00105             break;
00106 
00107         case EAknSoftkeyBack:
00108             AppUi()->ActivateLocalViewL(TUid::Uid(ELandmarksViewId));
00109             break;
00110 
00111         default:
00112             AppUi()->HandleCommandL(aCommand);
00113             break;
00114         }
00115     }

void CLandmarksInfoView::DoActivateL (  const TVwsViewId &  aPrevViewId,
TUid  aCustomMessageId,
const TDesC8 &  aCustomMessage
) 
 

DoActivateL is responsible for activating this view.

Parameters:
aPrevViewId The id of the previous view
aCustomMessageId message identifier
aCustomMessage custom message provided when the view is changed

Definition at line 123 of file LandmarksInfoView.cpp.

References CLandmarksInfoContainer::ConstructL(), iContainer, Id(), iEngine, iNaviDecorator, CLandmarksInfoContainer::LoadLandmarkL(), CLandmarksInfoContainer::MakeNaviPaneVisibleL(), CLandmarksApplicationEngine::NotifyViewActivated(), LandmarksUtils::Panic(), and CLandmarksInfoContainer::StoreTitlePaneL().

00127     {
00128     __ASSERT_ALWAYS(aCustomMessageId.iUid == ELandmarksViewInfoById,
00129                     LandmarksUtils::Panic(KErrGeneral));
00130     
00131     if (!iContainer)
00132         {
00133         iContainer = new (ELeave) CLandmarksInfoContainer(
00134             *this, iEngine, iNaviDecorator);
00135         iContainer->SetMopParent(this);
00136             iContainer->ConstructL(ClientRect());
00137         }
00138 
00139     iContainer->StoreTitlePaneL();
00140 
00141     // Enable receiving of keyboard events.
00142     AppUi()->AddToStackL(*this, iContainer);
00143 
00144     // custom message contains landmark id
00145     TPckgBuf<TPosLmItemId> lmid;
00146     lmid.Copy(aCustomMessage);
00147     iContainer->LoadLandmarkL(lmid());
00148     
00149     // Make view visible.
00150     iContainer->MakeNaviPaneVisibleL(EFalse);
00151     iContainer->MakeVisible(ETrue);
00152 
00153     // Notify that this view is active
00154     iEngine.NotifyViewActivated(Id(), ETrue);
00155     }

void CLandmarksInfoView::DoDeactivate (   ) 
 

DoDeactivate is responsible for deactivating this view.

Definition at line 163 of file LandmarksInfoView.cpp.

References iContainer, Id(), iEngine, CLandmarksInfoContainer::MakeNaviPaneVisibleL(), CLandmarksApplicationEngine::NotifyViewActivated(), and CLandmarksInfoContainer::RestoreTitlePane().

00164     {
00165     // Hide view.
00166     iContainer->MakeVisible(EFalse);
00167     TInt err = KErrNone;
00168     TRAP(err, iContainer->MakeNaviPaneVisibleL(ETrue));
00169     iContainer->RestoreTitlePane();
00170 
00171     // Notify that this view is inactive
00172     TBool isActive = EFalse;
00173     iEngine.NotifyViewActivated(Id(), isActive);
00174 
00175     // Disable receiving keyboard events.
00176     AppUi()->RemoveFromStack(iContainer);
00177     }

void CLandmarksInfoView::ConstructL (   )  [private]
 

By default Symbian 2nd phase constructor is private.

Definition at line 53 of file LandmarksInfoView.cpp.

References iAppName.

00054     {
00055     BaseConstructL(R_LMREFAPP_INFO_VIEW);
00056     iAppName = iCoeEnv->AllocReadResourceAsDes16L(R_LMREFAPP_APP_TITLE);
00057     }

void CLandmarksInfoView::EditLandmarkL (   )  [private]
 

Launches a landmark edit dialog


© Nokia 2006

Back to top