browser/src/BrCtlApiTestStateChangeObserver.cpp
author Maciej Seroka <maciejs@symbian.org>
Tue, 03 Aug 2010 14:51:01 +0100
branchSymbian3
changeset 58 7a02f8565ef5
parent 3 235c00e46fb7
permissions -rw-r--r--
Implemented Language-setting smoke test for ATS4
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     1
/*
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     2
* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     3
* All rights reserved.
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     5
* under the terms of the License "Eclipse Public License v1.0"
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     8
*
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     9
* Initial Contributors:
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    11
*
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    12
* Contributors:
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    13
*
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    14
* Description:  Handle state changed events
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    15
*
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    16
*/
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    17
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    18
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    19
// INCLUDE FILES
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    20
#include "BrCtlApiTestContainer.h"
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    21
#include "BrCtlApiTestStateChangeObserver.h"
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    22
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    23
// ================= MEMBER FUNCTIONS =======================
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    24
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    25
// ---------------------------------------------------------
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    26
// CBrCtlApiTestStateChangeObserver::StateChanged
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    27
// ---------------------------------------------------------
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    28
//
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    29
void 
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    30
CBrCtlApiTestStateChangeObserver::StateChanged(TBrCtlDefs::TBrCtlState /* aState */, 
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    31
                                                 TInt /* aValue */)
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    32
    {
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    33
    // Here we are creating a string to be displayed on the screen, but you would
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    34
    // implement this method to have code that would be executed when the observer
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    35
    // receives state changed events.
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    36
    TBuf16<256> tgt; 
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    37
    TPoint point(0, 120);
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    38
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    39
//    _LIT(KHandleBrowserStateChange, "State Change event = %d, value = %d");
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    40
     
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    41
//    tgt.AppendFormat(KHandleBrowserStateChange, aState, aValue);
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    42
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    43
//    iContainer->SetPoint(point);
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    44
//    iContainer->SetText(tgt);
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    45
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    46
    iContainer->DrawNow();
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    47
    }
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    48
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    49
// ---------------------------------------------------------
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    50
// CBrCtlApiTestStateChangeObserver::ConstructL
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    51
// ---------------------------------------------------------
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    52
//
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    53
void 
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    54
CBrCtlApiTestStateChangeObserver::ConstructL(CBrCtlApiTestContainer* aContainer)
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    55
    {
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    56
    iContainer = aContainer;
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    57
    }
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    58
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    59
// ---------------------------------------------------------
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    60
// CBrCtlApiTestStateChangeObserver::~CBrCtlApiTestStateChangeObserver
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    61
// ---------------------------------------------------------
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    62
//
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    63
CBrCtlApiTestStateChangeObserver::~CBrCtlApiTestStateChangeObserver()
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    64
    {
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    65
    }
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    66
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    67
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    68
// ---------------------------------------------------------
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    69
// CBrCtlApiTestStateChangeObserver::NewL
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    70
// ---------------------------------------------------------
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    71
//
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    72
CBrCtlApiTestStateChangeObserver* 
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    73
CBrCtlApiTestStateChangeObserver::NewL(CBrCtlApiTestContainer* aContainer)
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    74
{
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    75
  CBrCtlApiTestStateChangeObserver* self = new(ELeave)CBrCtlApiTestStateChangeObserver;
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    76
  CleanupStack::PushL(self);
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    77
  self->ConstructL(aContainer);
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    78
  CleanupStack::Pop();
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    79
  return self;
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    80
}
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    81
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    82
// End of File  
235c00e46fb7 Added Symbian3 smoketests
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    83