javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/inc/swtmobiledevice.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 13 Oct 2010 14:23:59 +0300
branchRCL_3
changeset 83 26b2b12093af
parent 66 2455ef1f5bbc
permissions -rw-r--r--
Revision: v2.2.17 Kit: 201041

/*******************************************************************************
 * Copyright (c) 2005, 2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     Nokia Corporation - S60 implementation
 *******************************************************************************/


#ifndef SWTMOBILEDEVICE_H
#define SWTMOBILEDEVICE_H


#include <aknappui.h>
#include "eswtmobileextensions.h"
#include "swtflipwatch.h"


/**
 * CSwtMobileDevice
 * @lib eswt
 */
NONSHARABLE_CLASS(CSwtMobileDevice)
        : public CBase
        , public MSwtMobileDevice
        , public MSwtFlipObserver
{
// Types
public:
    /** Input info */
    struct TSwtHwInput
    {
        TInt iType;
        TInt iLocation;
    };

// Own Methods
public:
    static CSwtMobileDevice* NewL(MSwtDisplay& aDisplay, TSwtPeer aPeer);
    static TInt HwScreenCount();
    static void GetHwInputs(RArray<TSwtHwInput>& aInputs);
private:
    inline CSwtMobileDevice(MSwtDisplay& aDisplay, TSwtPeer aPeer);
    virtual ~CSwtMobileDevice();
    void ConstructL();

// From MSwtMobileDevice
public:
    void Alert(TAlertLevel aLevel);
    TSwtPeer Dispose();
    TInt GetInputNumber() const;
    TInt GetScreenNumber() const;
    TBool IsOpen() const;
    TBool AddObserverL(const MSwtMobileDeviceObserver* aObserver);
    TBool RemoveObserver(const MSwtMobileDeviceObserver* aObserver);

// From MSwtFlipObserver
public:
    void FlipChangingL();
    void FlipChangedL(TBool aState);

// Data
private:
    MSwtDisplay& iDisplay;
    const TSwtPeer iPeer;
    TBool iFlipOpen;
    TBool iFlipChanging;
    TInt iScreenCount;
    TInt iActiveScreenId;
    RPointerArray<MSwtMobileDeviceObserver> iObservers;
    CSwtFlipWatch* iFlipWatch;
};


#endif // SWTMOBILEDEVICE_H