Nokia N97 SDK
Example Applications Guide

CBrCtlSampleAppLayoutObserver Class Reference

#include <BrCtlSampleAppLayoutObserver.h>

Inheritance diagram for CBrCtlSampleAppLayoutObserver:

List of all members.

Detailed Description

CBrCtlSampleAppLayoutObserver class. This class inherits from the MBrCtlLayoutObserver interface. Methods on this class will be called when layout events occur.

Definition at line 33 of file BrCtlSampleAppLayoutObserver.h.


Public Member Functions

  ~CBrCtlSampleAppLayoutObserver ()
void  UpdateBrowserVScrollBarL (TInt aDocumentHeight, TInt aDisplayHeight, TInt aDisplayPosY)
void  UpdateBrowserHScrollBarL (TInt aDocumentWidth, TInt aDisplayWidth, TInt aDisplayPosX)
void  NotifyLayoutChange (TBrCtlLayout aNewLayout)
void  UpdateTitleL (const TDesC &aTitle)

Static Public Member Functions

static CBrCtlSampleAppLayoutObserver *  NewL (CBrCtlSampleAppContainer *aContainer)

Private Member Functions

void  ConstructL (CBrCtlSampleAppContainer *aContainer)

Private Attributes

CBrCtlSampleAppContainer *  iContainer


Constructor & Destructor Documentation

CBrCtlSampleAppLayoutObserver::~CBrCtlSampleAppLayoutObserver (   ) 
 

Destructor.

Definition at line 110 of file BrCtlSampleAppLayoutObserver.cpp.

00111     {
00112     }


Member Function Documentation

CBrCtlSampleAppLayoutObserver * CBrCtlSampleAppLayoutObserver::NewL (  CBrCtlSampleAppContainer *  aContainer  )  [static]
 

Two-phased constructor.

Definition at line 119 of file BrCtlSampleAppLayoutObserver.cpp.

Referenced by CBrCtlSampleAppContainer::ConstructL().

00120 {
00121   CBrCtlSampleAppLayoutObserver* self = new(ELeave)CBrCtlSampleAppLayoutObserver();
00122   CleanupStack::PushL(self);
00123   self->ConstructL(aContainer);
00124   CleanupStack::Pop();
00125   return self;
00126 }

void CBrCtlSampleAppLayoutObserver::UpdateBrowserVScrollBarL (  TInt  aDocumentHeight,
TInt  aDisplayHeight,
TInt  aDisplayPosY
) 
 

Update the position of vertical scrollbar.

Since:
2.8
Parameters:
aDocumentHeight  The total height of the markup page
aDisplayHeight  The height of the display
aDisplayPosY  The current Y position
Returns:
void

Definition at line 26 of file BrCtlSampleAppLayoutObserver.cpp.

References iContainer, CBrCtlSampleAppContainer::SetPoint(), and CBrCtlSampleAppContainer::SetText().

00029     {
00030     // Here we are creating a text string that will be displayed on the screen
00031     // But if you were implementing this method, you most likely would be implementing
00032     // your own scroll bars here.
00033     TBuf16<256> tgt;
00034     TPoint point(0, 220);
00035 
00036     _LIT(KUpdateScrollbar, "Doc Height=%d, Dis Height=%d, Dis Pos=%d");
00037 
00038     tgt.AppendFormat(KUpdateScrollbar, aDocumentHeight, aDisplayHeight, aDisplayPosY);
00039 
00040     iContainer->SetPoint(point);
00041     iContainer->SetText(tgt);
00042 
00043     iContainer->DrawNow();
00044     }

void CBrCtlSampleAppLayoutObserver::UpdateBrowserHScrollBarL (  TInt  aDocumentWidth,
TInt  aDisplayWidth,
TInt  aDisplayPosX
) 
 

Update the position of horizontal scrollbar.

Since:
2.8
Parameters:
aDocumentWidth  The total width of the markup page
aDisplayWidth  The width of the display
aDisplayPosX  The current X position
Returns:
void

Definition at line 50 of file BrCtlSampleAppLayoutObserver.cpp.

References iContainer, CBrCtlSampleAppContainer::SetPoint(), and CBrCtlSampleAppContainer::SetText().

00053     {
00054     // Here we are creating a text string that will be displayed on the screen
00055     // But if you were implementing this method, you most likely would be implementing
00056     // your own scroll bars here.
00057     TBuf16<256> tgt;
00058     TPoint point(0, 130);
00059 
00060     _LIT(KUpdateScrollbar, "Doc Width=%d, Dis Width=%d, Dis Pos=%d");
00061         
00062     tgt.AppendFormat(KUpdateScrollbar, aDocumentWidth, aDisplayWidth, aDisplayPosX);
00063 
00064     iContainer->SetPoint(point);
00065     iContainer->SetText(tgt);
00066 
00067     iContainer->DrawNow();
00068     }

void CBrCtlSampleAppLayoutObserver::NotifyLayoutChange (  TBrCtlLayout  aNewLayout  ) 
 

Inform the layout of the page: right to left or left to right. Useful when the application draws the scrollbar itself.

Since:
2.8
Parameters:
aNewLayout  RTL or LTR
Returns:
void

Definition at line 74 of file BrCtlSampleAppLayoutObserver.cpp.

References iContainer, CBrCtlSampleAppContainer::SetPoint(), and CBrCtlSampleAppContainer::SetText().

00075     {
00076     TBuf16<256> tgt;
00077     TPoint point(0, 120);
00078 
00079     _LIT(KUpdateLayout, "New layout is  %d");
00080 
00081     tgt.AppendFormat(KUpdateLayout, aNewLayout);
00082 
00083     iContainer->SetPoint(point);
00084     iContainer->SetText(tgt);
00085 
00086     iContainer->DrawNow();
00087     }

void CBrCtlSampleAppLayoutObserver::UpdateTitleL (  const TDesC &  aTitle  ) 
 

Update the title of the page in history view

Since:
3.0
Parameters:
aTitle  Title of the page
Returns:
void

Definition at line 93 of file BrCtlSampleAppLayoutObserver.cpp.

00094     {
00095     }

void CBrCtlSampleAppLayoutObserver::ConstructL (  CBrCtlSampleAppContainer *  aContainer  )  [private]
 

By default Symbian 2nd phase constructor is private.

Definition at line 101 of file BrCtlSampleAppLayoutObserver.cpp.

References iContainer.

00102     {
00103     iContainer = aContainer;
00104     }


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

© Nokia 2009

Back to top